public static function init(string $handlerType, array $resLocations): Container
    {
        switch (strtolower($handlerType)) {
            case Config::PHP_CONFIG_HANDLER:
                $handler = new PhpHandler($resLocations);
                break;
            case Config::XML_CONFIG_HANDLER:
                $xml = new \Desperado\XmlBundle\Model\XmlReader;
                $handler = new XmlHandler($resLocations, $xml);
                break;
            case Config::YAML_CONFIG_HANDLER:
                $handler = new YamlHandler($resLocations);
                break;
            default:
                throw new Exception\InvalidHandlerTypeException(
                    "Handler type must be one of ['php', 'xml', 'yaml']"
                );
        }

        return new Container($handler);
    }
public static function init(string $handlerType, array $resLocations): Container
    {
        switch (strtolower($handlerType)) {
            case Config::PHP_CONFIG_HANDLER:
                $handler = new PhpHandler($resLocations);
                break;
            case Config::XML_CONFIG_HANDLER:
                $xml = new \Desperado\XmlBundle\Model\XmlReader;
                $handler = new XmlHandler($resLocations, $xml);
                break;
            case Config::YAML_CONFIG_HANDLER:
                $handler = new YamlHandler($resLocations);
                break;
            default:
                throw new Exception\InvalidHandlerTypeException(
                    "Handler type must be one of ['php', 'xml', 'yaml']"
                );
        }

        return new Container($handler);
    }
public static function init ( string $ handlerType , array $ resLocations ) : Container { switch ( strtolower ( $ handlerType ) ) { case Config :: PHP_CONFIG_HANDLER : $ handler = new PhpHandler ( $ resLocations ) ; break ; case Config :: XML_CONFIG_HANDLER : $ xml = new \ Desperado \ XmlBundle \ Model \ XmlReader ; $ handler = new XmlHandler ( $ resLocations , $ xml ) ; break ; case Config :: YAML_CONFIG_HANDLER : $ handler = new YamlHandler ( $ resLocations ) ; break ; default : throw new Exception \ InvalidHandlerTypeException ( "Handler type must be one of ['php', 'xml', 'yaml']" ) ; } return new Container ( $ handler ) ; }
Instantiate Config class

Instantiate the configuration handler, pass it to the Config class when
instantiating it, and return its object.
@param string $handlerType Type of handler to use
@param array $resLocations Locations of configuration resource
@return \SlaxWeb\Config\Container
Instantiate Config class