src/Hal/Application/Config/File/ConfigFileReaderFactory.php
public static function createFromFileName($filename)
    {
        if (!is_file($filename) || !is_readable($filename)) {
            throw new \InvalidArgumentException("Cannot read configuration file '{$filename}'");
        }

        switch (pathinfo($filename, PATHINFO_EXTENSION)) {
            case 'json':
                return new ConfigFileReaderJson($filename);
            case 'ini':
                return new ConfigFileReaderIni($filename);
                break;
            default:
                throw new \InvalidArgumentException("Unsupported config file format: '$filename'");
        }
    }
public static function createFromFileName($filename)
    {
        if (!is_file($filename) || !is_readable($filename)) {
            throw new \InvalidArgumentException("Cannot read configuration file '{$filename}'");
        }

        switch (pathinfo($filename, PATHINFO_EXTENSION)) {
            case 'json':
                return new ConfigFileReaderJson($filename);
            case 'ini':
                return new ConfigFileReaderIni($filename);
                break;
            default:
                throw new \InvalidArgumentException("Unsupported config file format: '$filename'");
        }
    }
@param string $filename

@return ConfigFileReaderInterface