mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-17 15:18:17 +01:00
dd63ddbc24
The formatting in this project has become something of a mess, because it changed over time. Add a CS fixer config and reformat to the desired style, which is PSR-12, but with sane brace placement.
25 lines
775 B
PHP
25 lines
775 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace PhpParser;
|
|
|
|
interface Parser {
|
|
/**
|
|
* Parses PHP code into a node tree.
|
|
*
|
|
* @param string $code The source code to parse
|
|
* @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults
|
|
* to ErrorHandler\Throwing.
|
|
*
|
|
* @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and
|
|
* the parser was unable to recover from an error).
|
|
*/
|
|
public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array;
|
|
|
|
/**
|
|
* Return the lexer used by this parser instance.
|
|
*
|
|
* @return Lexer
|
|
*/
|
|
public function getLexer(): Lexer;
|
|
}
|