DebugHandlersListener
in package
implements
EventSubscriberInterface
Configures errors and exceptions handlers.
Tags
Interfaces, Classes, Traits and Enums
- EventSubscriberInterface
- An EventSubscriber knows itself what events it is interested in.
Table of Contents
- $earlyHandler : mixed
- $exceptionHandler : mixed
- $fileLinkFormat : mixed
- $firstCall : mixed
- $hasTerminatedWithException : mixed
- $levels : mixed
- $logger : mixed
- $scope : mixed
- $scream : mixed
- $throwAt : mixed
- __construct() : mixed
- configure() : mixed
- Configures the error handler.
- getSubscribedEvents() : array<string, mixed>
- Returns an array of event names this subscriber wants to listen to.
Properties
$earlyHandler
private
mixed
$earlyHandler
$exceptionHandler
private
mixed
$exceptionHandler
$fileLinkFormat
private
mixed
$fileLinkFormat
$firstCall
private
mixed
$firstCall
= true
$hasTerminatedWithException
private
mixed
$hasTerminatedWithException
$levels
private
mixed
$levels
$logger
private
mixed
$logger
$scope
private
mixed
$scope
$scream
private
mixed
$scream
$throwAt
private
mixed
$throwAt
Methods
__construct()
public
__construct([callable|null $exceptionHandler = null ][, LoggerInterface $logger = null ][, array<string|int, mixed>|int $levels = E_ALL ][, int|null $throwAt = E_ALL ][, bool $scream = true ][, string|FileLinkFormatter|null $fileLinkFormat = null ][, bool $scope = true ]) : mixed
Parameters
- $exceptionHandler : callable|null = null
-
A handler that must support \Throwable instances that will be called on Exception
- $logger : LoggerInterface = null
- $levels : array<string|int, mixed>|int = E_ALL
-
An array map of E_* to LogLevel::* or an integer bit field of E_* constants
- $throwAt : int|null = E_ALL
-
Thrown errors in a bit field of E_* constants, or null to keep the current value
- $scream : bool = true
-
Enables/disables screaming mode, where even silenced errors are logged
- $fileLinkFormat : string|FileLinkFormatter|null = null
-
The format for links to source files
- $scope : bool = true
-
Enables/disables scoping mode
Return values
mixed —configure()
Configures the error handler.
public
configure([Event $event = null ]) : mixed
Parameters
- $event : Event = null
Return values
mixed —getSubscribedEvents()
Returns an array of event names this subscriber wants to listen to.
public
static getSubscribedEvents() : array<string, mixed>
The array keys are event names and the value can be:
- The method name to call (priority defaults to 0)
- An array composed of the method name to call and the priority
- An array of arrays composed of the method names to call and respective priorities, or 0 if unset
For instance:
- ['eventName' => 'methodName']
- ['eventName' => ['methodName', $priority]]
- ['eventName' => [['methodName1', $priority], ['methodName2']]]
The code must not depend on runtime state as it will only be called at compile time. All logic depending on runtime state must be put into the individual methods handling the events.
Return values
array<string, mixed> —The event names to listen to