\PhpParser\ErrorHandlerCollecting

Error handler that collects all errors into an array.

This allows graceful handling of errors.

Summary

Methods
Properties
Constants
handleError()
getErrors()
hasErrors()
clearErrors()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$errors
N/A

Properties

$errors

$errors : array<mixed,\PhpParser\Error>

Type

array<mixed,\PhpParser\Error> — Collected errors

Methods

handleError()

handleError(\PhpParser\Error  $error) 

Handle an error generated during lexing, parsing or some other operation.

Parameters

\PhpParser\Error $error

The error that needs to be handled

getErrors()

getErrors() : array<mixed,\PhpParser\Error>

Get collected errors.

Returns

array<mixed,\PhpParser\Error>

hasErrors()

hasErrors() : boolean

Check whether there are any errors.

Returns

boolean

clearErrors()

clearErrors() 

Reset/clear collected errors.