@param string $type

@return mixed
777667
protected function instantiateTransformerModel(string $type)
    {
        try {
            // try Eloquent model factory
            return factory($type)->make();
        } catch (\Exception $e) {
            $instance = new $type;
            if ($instance instanceof \Illuminate\Database\Eloquent\Model) {
                try {
                    // we can't use a factory but can try to get one from the database
                    $firstInstance = $type::first();
                    if ($firstInstance) {
                        return $firstInstance;
                    }
                } catch (\Exception $e) {
                    // okay, we'll stick with `new`
                }
            }
        }

        return $instance;
    }
260648
public function getClassForType(string $type):?string
    {
        if (isset($this->typeMap[$type])) {
            return $this->typeMap[$type];
        }

        return null;
    }
513744
public function inferType($type)
    {
        if (DataTypes::isPrimitive($type)) {
            return $type;
        } elseif (DataTypes::COLLECTION === strtolower($type)) {
            return $type;
        }
        return DataTypes::STRING;
    }
726924
public function type($type = null)
    {
        if ($type !== null) {
            $this->type = $type;
            return $this;
        }
        return $this->type;
    }
1112694
public static function get($type)
    {
        $instance = null;

        switch ($type) {

            case 'IM/Send':
                $instance = new SendService();
                break;

            case 'IM/Status':
                $instance = new StatusService();
                break;

            case 'TFA/Request':
                $instance = new RequestService();
                break;

            case 'TFA/Validate':
                $instance = new ValidateService();
                break;

            default:
                throw new \Exception("Error - Unknow service", 1);

        }
        return $instance;
    }
116780
public function getTypeClass($type)
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        if (\class_exists($type)) {
            return $type;
        }

        return null;
    }
241038
public function &get($type) {
        $list = array();

        foreach ($this->args as &$d) {
            if ($this->_isType($d, $type)) {
                $list[] = $d;
            }
        }

        return $list;
    }
1137531
public function get($type = null)
    {
        $result = [];

        foreach ($this->session[$this->prefix] as $offset => $message) {
            if ($type === null || $message['type'] === $type) {
                $result[] = $message;
                unset($this->session[$this->prefix][$offset]);
            }
        }

        return $result;
    }
831916
protected static function extractType($type)
    {
        if (substr($type, -2) === Connection::PARAM_ARRAY) {
            return substr($type, 0, strlen($type) - 2);
        }

        return false;
    }
1113775
public static function getInstance($type)
    {
        $classname = self::getClassname($type);

        if (!isset(self::$__instances[$classname])) {
            $instance = new $classname();
            self::$__instances[$classname] = $instance;
        }

        $instance = clone self::$__instances[$classname];

        return $instance;
    }
59054
public function getWeight($type)
    {
        if (isset($this->weights[$type])) {
            return $this->weights[$type];
        }

        return null;
    }
1073689
public function type($type = null)
    {
        if (is_null($type)) {
            return $this->type;
        }

        $this->type = $type;

        return $this;
    }
1260095
protected function getTypeConfig($type)
    {
        if (is_object($type)) {
            $type = $this->getTypeName($type);
        } else if (class_exists($type)) {
            $type = $this->getTypeFromClassName($type);
        }

        if (!$this->types->containsKey($type)) {
            $this->throwInvalidTypeException($type);
        }

        return $this->types->get($type);
    }
316371
public function getMachine(string $type)
	{
		foreach ($this->backends as $b => $backend) {
			$m = $backend->getMachine($this, $type);
			if ($m !== null) {
				return $m;
			}
		}
		return null;
	}
15428
protected function typeToPDOParamType($type)
    {
        switch ($type) {
        case "boolean":
            return PDO::PARAM_BOOL;
        case "integer":
            return PDO::PARAM_STR;
        case "NULL":
            return PDO::PARAM_NULL;
        case "resource":
            return PDO::PARAM_LOB;
        case "double":
        case "string":
        default:
            return PDO::PARAM_STR;
        }
    }
240495
private function getFromMemory($type)
    {
        if (isset($this->loaded[$type])) {
            return $this->loaded[$type];
        }
        return null;
    }
1131638
public function hasType($type)
    {
        if ($type instanceof Type) {
            $type = $type->getName();
        }

        return \in_array($type, $this->_types);
    }