You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
628 B

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