protected function getParser($extension)
    {
        foreach ($this->supportedParsers as $parser) {
            if (in_array($extension, $parser::getSupportedExtensions())) {
                return new $parser();
            }
        }

        // If none exist, then throw an exception
        throw new UnsupportedFormatException('Unsupported configuration format');
    }
protected function getParser($extension)
    {
        foreach ($this->supportedParsers as $parser) {
            if (in_array($extension, $parser::getSupportedExtensions())) {
                return new $parser();
            }
        }

        // If none exist, then throw an exception
        throw new UnsupportedFormatException('Unsupported configuration format');
    }
protected function getParser ( $ extension ) { foreach ( $ this -> supportedParsers as $ parser ) { if ( in_array ( $ extension , $ parser :: getSupportedExtensions ( ) ) ) { return new $ parser ( ) ; } } // If none exist, then throw an exception throw new UnsupportedFormatException ( 'Unsupported configuration format' ) ; }
Gets a parser for a given file extension.

@param  string $extension

@return Noodlehaus\Parser\ParserInterface

@throws UnsupportedFormatException If `$extension` is an unsupported file format
Gets a parser for a given file extension .