mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-17 15:18:17 +01:00
653757bec6
Adds ? before type declarations for parameters with a default null value
26 lines
775 B
PHP
26 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;
|
|
}
|