PHP Class Autarky\Errors\ErrorHandlerManager

Inheritance: implements Autarky\Errors\ErrorHandlerManagerInterface
Afficher le fichier Open project: autarky/framework Class Usage Examples

Protected Properties

Свойство Type Description
$defaultHandler Autarky\Errors\ErrorHandlerInterface | null
$handlers SplDoublyLinkedList
$resolver HandlerResolver
$rethrow boolean Re-throw exceptions rather than handling them.

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

public __construct ( HandlerResolver $resolver )
$resolver HandlerResolver

appendHandler() public méthode

public appendHandler ( $handler )

callHandler() protected méthode

Call an exception handler.
protected callHandler ( mixed $handler, Exception $exception ) : mixed
$handler mixed
$exception Exception
Résultat mixed

checkHandler() protected méthode

protected checkHandler ( $handler )

handle() public méthode

public handle ( Exception $exception )
$exception Exception

handleError() public méthode

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() public méthode

Handle a PHP fatal error.
public handleShutdown ( ) : void
Résultat void

handleUncaught() public méthode

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
Résultat Symfony\Component\HttpFoundation\Response

makeFatalErrorException() protected méthode

Create a FatalErrorException out of the information stored on the last PHP error.
protected makeFatalErrorException ( ) : Symfony\Component\Debug\Exception\FatalErrorException | null
Résultat Symfony\Component\Debug\Exception\FatalErrorException | null

makeResponse() protected méthode

Transform an exception handler's response into a Response object.
protected makeResponse ( mixed $response, Exception $exception ) : Response
$response mixed
$exception Exception
Résultat Symfony\Component\HttpFoundation\Response

matchesTypehint() protected méthode

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
Résultat boolean

prependHandler() public méthode

public prependHandler ( $handler )

register() public méthode

public register ( )

setDefaultHandler() public méthode

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

setRethrow() public méthode

public setRethrow ( $rethrow )

throwFatalErrorException() public méthode

Throw a FatalErrorException if an error has occured.
public throwFatalErrorException ( ) : void
Résultat void

Property Details

$defaultHandler protected_oe property

protected ErrorHandlerInterface,Autarky\Errors|null $defaultHandler
Résultat Autarky\Errors\ErrorHandlerInterface | null

$handlers protected_oe property

protected SplDoublyLinkedList $handlers
Résultat SplDoublyLinkedList

$resolver protected_oe property

protected HandlerResolver,Autarky\Errors $resolver
Résultat HandlerResolver

$rethrow protected_oe property

Re-throw exceptions rather than handling them.
protected bool $rethrow
Résultat boolean