Home
last modified time | relevance | path

Searched refs:errorHandler (Results 1 – 15 of 15) sorted by relevance

/PHP-Parser/test/PhpParser/ErrorHandler/
H A DCollectingTest.php9 $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 DThrowingTest.php11 $errorHandler = new Throwing();
12 $errorHandler->handleError(new Error('Test'));
/PHP-Parser/lib/PhpParser/
H A DLexer.php20 * @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 DParser.php10 * @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 DNameContext.php20 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 DParserAbstract.php126 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 DLexerTest.php21 $errorHandler = new ErrorHandler\Collecting();
23 $lexer->tokenize($code, $errorHandler);
24 $errors = $errorHandler->getErrors();
H A DParserTestAbstract.php208 public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array { argument
/PHP-Parser/lib/PhpParser/Lexer/
H A DEmulative.php64 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 DError_handling.markdown43 $errorHandler = new PhpParser\ErrorHandler\Collecting;
45 $stmts = $parser->parse($code, $errorHandler);
47 if ($errorHandler->hasErrors()) {
48 foreach ($errorHandler->getErrors() as $error) {
H A DName_resolution.markdown66 public function __construct(ErrorHandler $errorHandler);
/PHP-Parser/bin/
H A Dphp-parse57 $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 DEmulativeTest.php160 $errorHandler = new ErrorHandler\Collecting();
162 $lexer->tokenize('<?php ' . $code . "\0", $errorHandler);
164 $errors = $errorHandler->getErrors();
/PHP-Parser/lib/PhpParser/NodeVisitor/
H A DNameResolver.php34 * @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 DUPGRADE-3.0.md65 $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);

Completed in 24 milliseconds