PHP Class PhpParser\Parser\Multiple

Inheritance: implements PhpParser\Parser
Afficher le fichier Open project: nikic/php-parser Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $parsers ) Create a parser which will try multiple parsers in an order of preference.
parse ( $code, PhpParser\ErrorHandler $errorHandler = null )

Private Methods

Méthode Description
tryParse ( PhpParser\Parser $parser, PhpParser\ErrorHandler $errorHandler, $code )

Method Details

__construct() public méthode

Parsers will be invoked in the order they're provided to the constructor. If one of the parsers runs without throwing, it's output is returned. Otherwise the exception that the first parser generated is thrown.
public __construct ( array $parsers )
$parsers array

parse() public méthode

public parse ( $code, PhpParser\ErrorHandler $errorHandler = null )
$errorHandler PhpParser\ErrorHandler