class PhpCollector extends DataCollector implements Renderable

This class collects all PHP errors, notice, advices, trigger_error, .

.. Supports 15 different types included.

Properties

protected string $name Collector name.
protected array $messages List of messages. Each item includes: 'message', 'message_html', 'is_string', 'label', 'time'.

Methods

__construct(string $name = 'Error handler')

PHPCollector constructor.

array
collect()

Called by the DebugBar when data needs to be collected.

array
getMessages()

Returns a list of messages ordered by their timestamp.

array
getWidgets()

Returns a hash where keys are control names and their values an array of options as defined in {see DebugBar\JavascriptRenderer::addControl()}

string
getName()

Returns the unique name of the collector.

errorHandler(int $severity, string $message, string $fileName, int $line)

Exception error handler. Called from constructor with set_error_handler to add all details.

string
friendlyErrorType(int $type)

Return error name from error code.

Details

at line 38
__construct(string $name = 'Error handler')

PHPCollector constructor.

Parameters

string $name The name used by this collector widget.

at line 49
array collect()

Called by the DebugBar when data needs to be collected.

Return Value

array Collected data.

at line 63
array getMessages()

Returns a list of messages ordered by their timestamp.

Return Value

array A list of messages ordered by time.

at line 83
array getWidgets()

Returns a hash where keys are control names and their values an array of options as defined in {see DebugBar\JavascriptRenderer::addControl()}

Return Value

array Needed details to render the widget.

at line 105
string getName()

Returns the unique name of the collector.

Return Value

string The widget name.

at line 118
errorHandler(int $severity, string $message, string $fileName, int $line)

Exception error handler. Called from constructor with set_error_handler to add all details.

Parameters

int $severity Error type.
string $message Message of error.
string $fileName File where error is generated.
int $line Line number where error is generated.

at line 143
private string friendlyErrorType(int $type)

Return error name from error code.

Parameters

int $type Error code.

Return Value

string Error name.