SYMBOL_NONE
SYMBOL_NONE = -1
$actionBase : array
$lexer : \PhpParser\Lexer
$errorHandler : \PhpParser\ErrorHandler
$errors : array<mixed,\PhpParser\Error>
__construct(\PhpParser\Lexer $lexer, array $options = array())
Creates a parser instance.
\PhpParser\Lexer | $lexer | A lexer |
array | $options | Options array. Currently no options are supported. |
parse(string $code, \PhpParser\ErrorHandler|null $errorHandler = null) : array<mixed,\PhpParser\Node>|null
Parses PHP code into a node tree.
If a non-throwing error handler is used, the parser will continue parsing after an error occurred and attempt to build a partial AST.
string | $code | The source code to parse |
\PhpParser\ErrorHandler|null | $errorHandler | Error handler to use for lexer/parser errors, defaults to ErrorHandler\Throwing. |
Array of statements (or null if the 'throwOnError' option is disabled and the parser was unable to recover from an error).
emitError(\PhpParser\Error $error)
\PhpParser\Error | $error |
handleNamespaces(array<mixed,\PhpParser\Node> $stmts) : array<mixed,\PhpParser\Node>
Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.
array<mixed,\PhpParser\Node> | $stmts |
handleBuiltinTypes(\PhpParser\Node\Name $name)
\PhpParser\Node\Name | $name |
checkParam(\PhpParser\Node\Param $node)
\PhpParser\Node\Param | $node |
checkTryCatch(\PhpParser\Node\Stmt\TryCatch $node)
\PhpParser\Node\Stmt\TryCatch | $node |
checkNamespace(\PhpParser\Node\Stmt\Namespace_ $node)
\PhpParser\Node\Stmt\Namespace_ | $node |
checkClass(\PhpParser\Node\Stmt\Class_ $node, $namePos)
\PhpParser\Node\Stmt\Class_ | $node | |
$namePos |
checkInterface(\PhpParser\Node\Stmt\Interface_ $node, $namePos)
\PhpParser\Node\Stmt\Interface_ | $node | |
$namePos |
checkClassMethod(\PhpParser\Node\Stmt\ClassMethod $node, $modifierPos)
\PhpParser\Node\Stmt\ClassMethod | $node | |
$modifierPos |
checkClassConst(\PhpParser\Node\Stmt\ClassConst $node, $modifierPos)
\PhpParser\Node\Stmt\ClassConst | $node | |
$modifierPos |
checkProperty(\PhpParser\Node\Stmt\Property $node, $modifierPos)
\PhpParser\Node\Stmt\Property | $node | |
$modifierPos |
checkUseUse(\PhpParser\Node\Stmt\UseUse $node, $namePos)
\PhpParser\Node\Stmt\UseUse | $node | |
$namePos |