PHP-Parser/lib/PhpParser/Parser.php
MathiasReker 653757bec6 Nullable type declaration for default null value
Adds ? before type declarations for parameters with a default null value
2022-07-04 20:34:31 +02:00

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;
}