Returns config reader class

@param string $type
@return AbstractReader
350862
public static function get(string $type): AbstractReader
    {
        if (!\array_key_exists($type, static::$invokableClasses)) {
            throw new InvalidArgumentException('Unsupported config file type: '.$type);
        }

        return new static::$invokableClasses[$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);
    }
343579
protected function generateReadScalarStatement($type)
    {
        $mapping = [
            Type::TYPE_INT32_VALUE    => '$reader->readVarint($stream)',
            Type::TYPE_INT64_VALUE    => '$reader->readVarint($stream)',
            Type::TYPE_UINT64_VALUE   => '$reader->readVarint($stream)',
            Type::TYPE_UINT32_VALUE   => '$reader->readVarint($stream)',
            Type::TYPE_DOUBLE_VALUE   => '$reader->readDouble($stream)',
            Type::TYPE_FIXED64_VALUE  => '$reader->readFixed64($stream)',
            Type::TYPE_SFIXED64_VALUE => '$reader->readSFixed64($stream)',
            Type::TYPE_FLOAT_VALUE    => '$reader->readFloat($stream)',
            Type::TYPE_FIXED32_VALUE  => '$reader->readFixed32($stream)',
            Type::TYPE_SFIXED32_VALUE => '$reader->readSFixed32($stream)',
            Type::TYPE_ENUM_VALUE     => '$reader->readVarint($stream)',
            Type::TYPE_SINT32_VALUE   => '$reader->readZigzag($stream)',
            Type::TYPE_SINT64_VALUE   => '$reader->readZigzag($stream)',
            Type::TYPE_BOOL_VALUE     => '$reader->readBool($stream)',
            Type::TYPE_STRING_VALUE   => '$reader->readString($stream)',
            Type::TYPE_BYTES_VALUE    => '$reader->readByteStream($stream)',
        ];

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

        throw new InvalidArgumentException('Unknown field type : ' . $type);
    }
1060303
public function getClassname($type)
    {
        $types = $this->types();

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

        return static::DEFAULT_CLASSNAME;
    }
941740
protected static function getConnection($type) {
    $mapper = self::getMapper($type);
    $conn = $mapper->getConnection();
    return $conn;
  }
1218314
public static function getExporter($type) {
        // normalize type
        $className = 'Garp_Content_Export_' . ucfirst($type);
        $obj = new $className();
        if (!$obj instanceof Garp_Content_Export_Abstract) {
            throw new Garp_Content_Export_Exception(
                "Class $className does not implement Garp_Content_Export_Abstract."
            );
        }
        return $obj;
    }
153969
public function getMessageClassString($type) {
        $em = $this->container->get('doctrine')->getManager();

        $messageClass = "Sopinet\ChatBundle\Entity\Message";

        $cmf = $em->getMetadataFactory();
        $meta = $cmf->getMetadataFor($messageClass);

        $config = $this->container->getParameter('sopinet_chat.config');
        foreach($meta->discriminatorMap as $typeString => $typeClass) {
            if ($typeString == $type) {
                if (!$config['all_type_message'][$type]['interfaceEnabled']) {
                    // Type forbidden, interfaceEnabled for this type is setted in False
                    return;
                } else {
                    return $typeClass;
                }
            }
        }

        if ($config['anyType'] && $type != "") {
            return "Sopinet\ChatBundle\Entity\MessageAny";
        }

        // Type unknow
        return;
    }
91287
protected function getGenerator($type)
    {
        switch ($type) {
            case "controller":
                return new ControllerGenerator($this);

            case "model":
                return new ModelGenerator($this);

            case "customposttype":
                return new CustomPostTypeGenerator($this);

            case "viewhelper" :
            case "helper":
                return new HelperGenerator($this);

            case "taxonomy":
                return new TaxonomyGenerator($this);

            case "validator":
                return new ValidatorGenerator($this);

            case "command":
                return new CommandGenerator($this);
        }

        throw new InvalidArgumentException("That is not a valid command.");
    }
364483
public function reader($key, $reader = null)
    {
        if ($reader === null) {
            return $this->getConfig('readers.' . $key);
        }

        return $this->setConfig('readers.' . $key, $reader);
    }
963361
public static function getCache($type = '') {
        static $caches = [];

        if (!$type) {
            $loader = new ConfigurationLoader();
            $cfg    = $loader->loadConfig('cache');
            $type   = $cfg->get('default', CACHE_TYPE_REDIS);
        }
        if (!isset($caches[ $type ])) {
            if (!isset($cfg)) {
                $loader = new ConfigurationLoader();
                $cfg    = $loader->loadConfig('cache');
            }
            if (!$cfg->getb('enabled')) {
                return new Cache();
            }
            $cache = apply_filter('get_' . $type . '_cache', null, $cfg);
            if (!$cache instanceof Cache) {
                $cache = new Cache ();
            }
            $caches[ $type ] = $cache;
        }

        return $caches[ $type ];
    }
242312
public static function getType($type)
    {
        $type = strtolower($type);

        if (!isset(static::$typeMapping[$type])) {
            return $type;
        }

        return static::$typeMapping[$type];
    }
1070735
static public function addReader( $type, $readerClass )
    {
        // Check if the passed classname actually exists
        if ( !ezcBaseFeatures::classExists( $readerClass, true ) )
        {
            throw new ezcDbSchemaInvalidReaderClassException( $readerClass );
        }

        // Check if the passed classname actually implements the interface.
        if ( !in_array( 'ezcDbSchemaReader', class_implements( $readerClass ) ) )
        {
            throw new ezcDbSchemaInvalidReaderClassException( $readerClass );
        }
        self::$readHandlers[$type] = $readerClass;
    }
91957
protected function columnTypeToHintType($type) {
		if (static::$typeMap === null) {
			static::$typeMap = (array)Configure::read('IdeHelper.typeMap') + static::$typeMapDefaults;
		}

		if (isset(static::$typeMap[$type])) {
			return static::$typeMap[$type];
		}

		return null;
	}
479061
protected function _getConstraintClass($type)
    {
        $class = null;
        foreach ($this->_constraintExpressions as $className => $exp) {
            if (preg_match("/{$exp}/i", $type)) {
                $class = $className;
                break;
            }
        }
        return $class;
    }
828429
public function create($type)
    {
        $typeOptions    = $this->getOption(self::OPTION_MAPPERS);
        $typeOption     = isset($typeOptions[$type]) ? $typeOptions[$type] : $this->throwException();
        $importerString = isset($typeOption[self::OPTION_MAPPERS_IMPORTER]) ? $typeOption[self::OPTION_MAPPERS_IMPORTER] : $this->throwException();
        $importer       = $this->buildService($importerString, ImportServiceInterface::class);

        if (isset($typeOption[self::OPTION_MAPPERS_MAPPER])) {
            $mapperString = $typeOption[self::OPTION_MAPPERS_MAPPER];
            $mapper       = $this->buildService($mapperString);
        } else {
            $mapper = $this->getDefaultMapper();
        }

        $this->propagate($mapper);
        $importer->setMapper($mapper);

        return $importer;
    }
664522
public function getType(string $type): Type
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        $instance = $this->createType($type);
        $this->addType($instance);
        $this->types[$type] = $instance;

        return $instance;
    }
661511
public function getReader($type = 'country', $locales = array('en'))
    {
        $type = preg_replace_callback('/([A-Z])/', function ($match) {
            return '_'.strtolower($match[1]);
        }, $type);

        if (!isset($this->config['db'][$type])) {
            throw new GeoIpException(
                sprintf('Unknown database type %s', $type)
            );
        }

        return new Reader($this->config['path'].'/'.$this->config['db'][$type], $locales);
    }