ErrorHandler::stackErrors()

static stackErrors() Configures the error handler for delayed handling. Ensures also that non-catchable fatal errors are never silenced. As shown by http://bugs.php.net/42098 and http://bugs.php.net/60724 PHP has a compile stage where it behaves unusually. To workaround it, we plug an error handler that only stacks errors for later. The most important feature of this is to prevent autoloading until unstackErrors() is called.

ErrorHandler::setExceptionHandler()

callable|null setExceptionHandler(callable $handler = null) Sets a user exception handler. Parameters callable $handler A handler that will be called on Exception Return Value callable|null The previous exception handler

ErrorHandler::unstackErrors()

static unstackErrors() Unstacks stacked errors and forwards to the logger.

ErrorHandler::setLoggers()

array setLoggers(array $loggers) Sets a logger for each error level. Parameters array $loggers Error levels to [LoggerInterface|null, LogLevel::*] map Return Value array The previous map Exceptions InvalidArgumentException

ErrorHandler::scopeAt()

int scopeAt(int $levels, bool $replace = false) Sets the PHP error levels for which local variables are preserved. Parameters int $levels A bit field of E_* constants for scoped errors bool $replace Replace or amend the previous value Return Value int The previous value

ErrorHandler::screamAt()

int screamAt(int $levels, bool $replace = false) Sets the error levels where the @-operator is ignored. Parameters int $levels A bit field of E_* constants for screamed errors bool $replace Replace or amend the previous value Return Value int The previous value

ErrorHandler::handleException()

handleException(Exception|Throwable $exception, array $error = null) Handles an exception by logging then forwarding it to another handler. Parameters Exception|Throwable $exception An exception to handle array $error An array as returned by errorgetlast()

ErrorHandler::register()

static ErrorHandler register(ErrorHandler $handler = null, bool $replace = true) Registers the error handler. Parameters ErrorHandler $handler The handler to register bool $replace Whether to replace or not any existing handler Return Value ErrorHandler The registered error handler

ErrorHandler::handleFatalError()

static handleFatalError(array $error = null) Shutdown registered function for handling PHP fatal errors. Parameters array $error An array as returned by errorgetlast()

ErrorHandler::handleError()

bool handleError(int $type, string $message, string $file, int $line, array $context, array $backtrace = null) Handles errors by filtering then logging them according to the configured bit fields. Parameters int $type One of the E_* constants string $message string $file int $line array $context array $backtrace Return Value bool Returns false when no handling happens so that the PHP engine can handle the error itself Exceptions ErrorException When $this->thrownErrors r