PHP Класс Autarky\Errors\ErrorHandlerManager

Наследование: implements Autarky\Errors\ErrorHandlerManagerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$defaultHandler Autarky\Errors\ErrorHandlerInterface | null
$handlers SplDoublyLinkedList
$resolver HandlerResolver
$rethrow boolean Re-throw exceptions rather than handling them.

Открытые методы

Метод Описание
__construct ( HandlerResolver $resolver )
appendHandler ( $handler )
handle ( Exception $exception )
handleError ( integer $level, string $message, string $file = '', integer $line, array $context = [] ) Handle a PHP error.
handleShutdown ( ) : void Handle a PHP fatal error.
handleUncaught ( Exception $exception ) : Response Handle an uncaught exception. Does the same as handle(), but also sends the response, as we can assume that the exception happened outside of HttpKernelInterface::handle.
prependHandler ( $handler )
register ( )
setDefaultHandler ( Autarky\Errors\ErrorHandlerInterface $handler )
setRethrow ( $rethrow )
throwFatalErrorException ( ) : void Throw a FatalErrorException if an error has occured.

Защищенные методы

Метод Описание
callHandler ( mixed $handler, Exception $exception ) : mixed Call an exception handler.
checkHandler ( $handler )
makeFatalErrorException ( ) : Symfony\Component\Debug\Exception\FatalErrorException | null Create a FatalErrorException out of the information stored on the last PHP error.
makeResponse ( mixed $response, Exception $exception ) : Response Transform an exception handler's response into a Response object.
matchesTypehint ( callable | Autarky\Errors\ErrorHandlerInterface $handler, Exception $exception ) : boolean Check if a handler's argument typehint matches an exception.

Описание методов

__construct() публичный метод

public __construct ( HandlerResolver $resolver )
$resolver HandlerResolver

appendHandler() публичный метод

public appendHandler ( $handler )

callHandler() защищенный метод

Call an exception handler.
protected callHandler ( mixed $handler, Exception $exception ) : mixed
$handler mixed
$exception Exception
Результат mixed

checkHandler() защищенный метод

protected checkHandler ( $handler )

handle() публичный метод

public handle ( Exception $exception )
$exception Exception

handleError() публичный метод

Handle a PHP error.
public handleError ( integer $level, string $message, string $file = '', integer $line, array $context = [] )
$level integer
$message string
$file string
$line integer
$context array

handleShutdown() публичный метод

Handle a PHP fatal error.
public handleShutdown ( ) : void
Результат void

handleUncaught() публичный метод

Handle an uncaught exception. Does the same as handle(), but also sends the response, as we can assume that the exception happened outside of HttpKernelInterface::handle.
public handleUncaught ( Exception $exception ) : Response
$exception Exception
Результат Symfony\Component\HttpFoundation\Response

makeFatalErrorException() защищенный метод

Create a FatalErrorException out of the information stored on the last PHP error.
protected makeFatalErrorException ( ) : Symfony\Component\Debug\Exception\FatalErrorException | null
Результат Symfony\Component\Debug\Exception\FatalErrorException | null

makeResponse() защищенный метод

Transform an exception handler's response into a Response object.
protected makeResponse ( mixed $response, Exception $exception ) : Response
$response mixed
$exception Exception
Результат Symfony\Component\HttpFoundation\Response

matchesTypehint() защищенный метод

Check if a handler's argument typehint matches an exception.
protected matchesTypehint ( callable | Autarky\Errors\ErrorHandlerInterface $handler, Exception $exception ) : boolean
$handler callable | Autarky\Errors\ErrorHandlerInterface
$exception Exception
Результат boolean

prependHandler() публичный метод

public prependHandler ( $handler )

register() публичный метод

public register ( )

setDefaultHandler() публичный метод

public setDefaultHandler ( Autarky\Errors\ErrorHandlerInterface $handler )
$handler Autarky\Errors\ErrorHandlerInterface

setRethrow() публичный метод

public setRethrow ( $rethrow )

throwFatalErrorException() публичный метод

Throw a FatalErrorException if an error has occured.
public throwFatalErrorException ( ) : void
Результат void

Описание свойств

$defaultHandler защищенное свойство

protected ErrorHandlerInterface,Autarky\Errors|null $defaultHandler
Результат Autarky\Errors\ErrorHandlerInterface | null

$handlers защищенное свойство

protected SplDoublyLinkedList $handlers
Результат SplDoublyLinkedList

$resolver защищенное свойство

protected HandlerResolver,Autarky\Errors $resolver
Результат HandlerResolver

$rethrow защищенное свойство

Re-throw exceptions rather than handling them.
protected bool $rethrow
Результат boolean