Returns a reference to a Processor object, only creating it
if it doesn't already exist.

@param   string  $type  The format to load
@return  object  Registry format handler
@throws  Exception
779984
public static function instance($type)
	{
		// Sanitize format type.
		$type = strtolower(preg_replace('/[^A-Z0-9_]/i', '', $type));

		// Only instantiate the object if it doesn't already exist.
		if (!isset(self::$instances[$type]))
		{
			// Only load the file if the class does not exist.
			$class = __NAMESPACE__ . '\\Processor\\' . ucfirst($type);

			if (!class_exists($class))
			{
				foreach (self::all() as $inst)
				{
					if (in_array($type, $inst->getSupportedExtensions()))
					{
						$class = get_class($inst);
					}
				}

				if (!class_exists($class))
				{
					throw new InvalidArgumentException(sprintf('Unable to load format class for format "%s"', $type), 500);
				}
			}

			self::$instances[$type] = new $class;
		}

		return self::$instances[$type];
	}
823304
protected function makeRequest($type) {

        if(isset($this->{$type . 'Request'}) && $this->{$type . 'Request'}) {
            $request = app()->make($this->{$type . 'Request'});
            if (!$request instanceof Request) {
                throw new \Exception("Class {$this->{$type . 'Request'}} must be an instance of Illuminate\\Http\\Request");
            }
            return $request;
        }

    }
628584
public function fetch($type = 'num')
    {
        $row = parent::fetch($type);
        if ($type == 'assoc' && is_array($row) && !empty($this->_driver->autoShortenedIdentifiers)) {
            //Need to preserve order of row results
            $translatedRow = [];
            foreach ($row as $key => $val) {
                if (array_key_exists($key, $this->_driver->autoShortenedIdentifiers)) {
                    $translatedRow[$this->_driver->autoShortenedIdentifiers[$key]] = $val;
                } else {
                    $translatedRow[$key] = $val;
                }
            }
            $row = $translatedRow;
        }
        return $row;
    }
56445
public function to(string $type): HandlerInterface
    {
        $type = $this->normalizeType($type);

        if (isset($this->handlers[$type])) {
            $key = $type;
        } elseif ($type === 'integer|float' || $type === 'float|integer') {
            $key = 'number';
        } elseif (strpos($type, '|') !== false) {
            $key = 'multiple';
        } elseif (substr($type, -2) === '[]' || is_a($type, Traversable::class, true)) {
            $key = 'array';
        } else {
            $key = 'object';
        }

        if (!isset($this->handlers[$key])) {
            throw new OutOfBoundsException("Unable to find handler to cast to '$type'");
        }

        return $this->handlers[$key]->forType($type);
    }
1321784
public function getType($type)
    {
        if (!$this->hasType($type)) {
            $this->metaTypeList[$type] = new $type();
        }

        return $this->metaTypeList[$type];
    }
690713
protected function getTypeConfig($type = null)
    {
        if ($type == null) {
            $type = static::BASE_TYPE;
        }

        if (is_object($type)) {
            $type = $this->getTypeName($type);
        }

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

        return $this->types->get($type);
    }
1094365
public function get($type)
    {
        if ($type === self::TYPE_MAILER) {
            $name = $this->configService->getValue('system_mailer');
        } elseif ($type === self::TYPE_DISPATCHER) {
            $name = $this->configService->getValue('system_dispatcher');
        } else {
            throw new \InvalidArgumentException('Provided type does not exist');
        }

        if (empty($name)) {
            return null;
        }

        return $this->connector->getConnection($name);
    }
608442
public function getRegister($type, array $args = [])
    {
        try {
            $wrapper = $this->wrapperFactory($type, $args, ServiceTypeResolver\RegisterWrapper::class);
        } catch (\Exception $e) {
            throw new Exception\ErrorCreatingRegisterException($e->getMessage(), $e->getCode(), $e);
        }
        return $wrapper;
    }
931858
public static function object($objectType)
    {
        //====================================================================//
        // First Access to Local Objects
        if (!isset(self::core()->objects)) {
            //====================================================================//
            // Initialize Local Objects Class Array
            self::core()->objects = array();
        }

        //====================================================================//
        // Check in Cache
        if (array_key_exists($objectType, self::core()->objects)) {
            return self::core()->objects[$objectType];
        }

        //====================================================================//
        // Verify if Object Class is Valid
        if (!self::validate()->isValidObject($objectType)) {
            throw new Exception('You requested access to an Invalid Object Type : '.$objectType);
        }

        //====================================================================//
        // Check if Object Manager is Overriden
        if (self::local() instanceof ObjectsProviderInterface) {
            //====================================================================//
            // Initialize Local Object Manager
            self::core()->objects[$objectType] = self::local()->object($objectType);
        } else {
            //====================================================================//
            // Initialize Standard Class
            $className = SPLASH_CLASS_PREFIX.'\\Objects\\'.$objectType;
            self::core()->objects[$objectType] = new $className();
        }

        //====================================================================//
        //  Load Translation File
        self::translator()->load('objects');

        return self::core()->objects[$objectType];
    }
1300596
public function get(string $type): array
    {
        try {
            return $this->converters[$this->resolveType($type)];
        } catch (\Throwable $t) {
            throw new InvalidTypeConverterException(
                sprintf('Invalid converter type `%s`.', $type)
            );
        }
    }
345759
public function Cast( $type )
	{

		$obj = $this->getClone();

		foreach ($obj->repository as &$value) {
			settype($value, $type);
		}

		return $obj;

	}
615225
public function getValueByType($type)
    {
        $type = strtoupper($type);

        switch ($type) {
            case static::EAN:
                return $this->asEan();

            case static::ISBN10:
                return $this->asIsbn10();

            case static::ISBN13:
                return $this->asIsbn13();

            case static::UPC:
                return $this->asUpc();

            default:
                throw new Exception("Type {$type} not supported");
        }
    }
895591
public function create(string $type): RenderableElementInterface
    {
        $type = (string) $type;
        $search = strtolower($type);

        if (isset($this->typeToView[$search])) {
            $class = $this->typeToView[$search];

            return new $class();
        } elseif (class_exists($type)) {
            $class = new $type();
            if ($class instanceof RenderableElementInterface) {
                return $class;
            }
        }

        throw new Exception\UnknownTypeException(
            sprintf(
                'The given type "%s" is not an instance of "%s".',
                $type,
                RenderableElementInterface::class
            )
        );
    }
38079
public function format($type)
    {
        switch (strtolower($type)) {

            case 'rgba':
                return $this->getRgba();

            case 'hex':
                return $this->getHex('#');

            case 'int':
            case 'integer':
                return $this->getInt();

            case 'array':
                return $this->getArray();

            case 'obj':
            case 'object':
                return $this;

            default:
                throw new \Intervention\Image\Exception\NotSupportedException(
                    "Color format ({$type}) is not supported."
                );
        }
    }
484502
protected function getCustomType($type)
    {
        $root = $this;
        while ($cur = $root->getParent()) {
            $root = $cur;
        }
        $customTypes = $root->getSchema()->getCustomTypes();
        $type = ltrim($type, '&');

        if (isset($customTypes[$type])) {
            return $customTypes[$type];
        }

        throw new Exception("Unable to resolve '$type' to a custom type-definition.");
    }
413949
protected function getType($type)
    {
        if (isset($this->typeAlias[$type])) {
            return $this->typeAlias[$type];
        }

        return $type;
    }
1013404
public function getConverter($type)
    {
        if (isset($this->converters[$type])) {
            return $this->converters[$type];
        }

        return $this->converters[$type] = new JsonConverter($this->domainHydrator);
    }