CloneableInstantiable
ImplementsPhpParser\Parser
Methods
public __construct(array $parsers)
 

Create a parser which will try multiple parsers in an order of preference.

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 parse(string $code, ?PhpParser\ErrorHandler $errorHandler = NULL)
    Properties
    private $parsers
     
    • var Parser[] List of parsers to try, in order of preference
    Methods
    private tryParse(PhpParser\Parser $parser, PhpParser\ErrorHandler $errorHandler, $code)
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only