/PHP-Parser/test/PhpParser/ErrorHandler/ |
H A D | CollectingTest.php | 9 $errorHandler = new Collecting(); 10 $this->assertFalse($errorHandler->hasErrors()); 11 $this->assertEmpty($errorHandler->getErrors()); 13 $errorHandler->handleError($e1 = new Error('Test 1')); 14 $errorHandler->handleError($e2 = new Error('Test 2')); 15 $this->assertTrue($errorHandler->hasErrors()); 16 $this->assertSame([$e1, $e2], $errorHandler->getErrors()); 18 $errorHandler->clearErrors(); 19 $this->assertFalse($errorHandler->hasErrors()); 20 $this->assertEmpty($errorHandler->getErrors());
|
H A D | ThrowingTest.php | 11 $errorHandler = new Throwing(); 12 $errorHandler->handleError(new Error('Test'));
|
/PHP-Parser/lib/PhpParser/ |
H A D | Lexer.php | 20 * @param ErrorHandler|null $errorHandler Error handler to use for lexing errors. Defaults to 24 public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array { argument 25 if (null === $errorHandler) { 26 $errorHandler = new ErrorHandler\Throwing(); 32 $this->postprocessTokens($tokens, $errorHandler); 41 private function handleInvalidCharacter(Token $token, ErrorHandler $errorHandler): void { argument 52 $errorHandler->handleError(new Error($errorMsg, [ 69 protected function postprocessTokens(array &$tokens, ErrorHandler $errorHandler): void { argument 86 $this->handleInvalidCharacter($token, $errorHandler); 105 $errorHandler->handleError(new Error('Unterminated comment', [
|
H A D | Parser.php | 10 * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults 16 public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array; argument
|
H A D | NameContext.php | 20 protected ErrorHandler $errorHandler; variable in PhpParser\\NameContext 25 * @param ErrorHandler $errorHandler Error handling used to report errors 27 public function __construct(ErrorHandler $errorHandler) { argument 28 $this->errorHandler = $errorHandler; 70 $this->errorHandler->handleError(new Error( 105 $this->errorHandler->handleError(new Error(
|
H A D | ParserAbstract.php | 126 protected ErrorHandler $errorHandler; variable in PhpParser\\ParserAbstract 174 * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults 180 public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array { argument 181 $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing(); 184 $this->tokens = $this->lexer->tokenize($code, $this->errorHandler); 193 $this->errorHandler->handleError( 419 $this->errorHandler->handleError($error);
|
/PHP-Parser/test/PhpParser/ |
H A D | LexerTest.php | 21 $errorHandler = new ErrorHandler\Collecting(); 23 $lexer->tokenize($code, $errorHandler); 24 $errors = $errorHandler->getErrors();
|
H A D | ParserTestAbstract.php | 208 public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array { argument
|
/PHP-Parser/lib/PhpParser/Lexer/ |
H A D | Emulative.php | 64 public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array { argument 71 return parent::tokenize($code, $errorHandler); 74 if ($errorHandler === null) { 75 $errorHandler = new ErrorHandler\Throwing(); 92 $errorHandler->handleError($error);
|
/PHP-Parser/doc/component/ |
H A D | Error_handling.markdown | 43 $errorHandler = new PhpParser\ErrorHandler\Collecting; 45 $stmts = $parser->parse($code, $errorHandler); 47 if ($errorHandler->hasErrors()) { 48 foreach ($errorHandler->getErrors() as $error) {
|
H A D | Name_resolution.markdown | 66 public function __construct(ErrorHandler $errorHandler);
|
/PHP-Parser/bin/ |
H A D | php-parse | 57 $errorHandler = new PhpParser\ErrorHandler\Collecting; variable 58 $stmts = $parser->parse($code, $errorHandler); 59 foreach ($errorHandler->getErrors() as $error) {
|
/PHP-Parser/test/PhpParser/Lexer/ |
H A D | EmulativeTest.php | 160 $errorHandler = new ErrorHandler\Collecting(); 162 $lexer->tokenize('<?php ' . $code . "\0", $errorHandler); 164 $errors = $errorHandler->getErrors();
|
/PHP-Parser/lib/PhpParser/NodeVisitor/ |
H A D | NameResolver.php | 34 * @param ErrorHandler|null $errorHandler Error handler 37 public function __construct(?ErrorHandler $errorHandler = null, array $options = []) { argument 38 $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing());
|
/PHP-Parser/ |
H A D | UPGRADE-3.0.md | 65 $errorHandler = new ErrorHandler\Collecting; 66 $stmts = $parser->parse($code, $errorHandler); 67 if ($errorHandler->hasErrors()) { 68 handleErrors($errorHandler->getErrors()); 115 public function startLexing($code, ErrorHandler $errorHandler = null);
|