| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace PhpParser; |
| 4: | |
| 5: | interface Parser |
| 6: | { |
| 7: | /** |
| 8: | * Parses PHP code into a node tree. |
| 9: | * |
| 10: | * @param string $code The source code to parse |
| 11: | * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults |
| 12: | * to ErrorHandler\Throwing. |
| 13: | * |
| 14: | * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and |
| 15: | * the parser was unable to recover from an error). |
| 16: | */ |
| 17: | public function parse(string $code, ErrorHandler $errorHandler = null); |
| 18: | } |
| 19: |