PHP Class TheSeer\phpDox\ErrorHandler

Afficher le fichier Open project: theseer/phpdox Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Version $version ) ErrorHandler constructor.
__destruct ( ) : void Destructor
clearLastError ( )
handleError ( integer $errno, string $errstr, string $errfile, integer $errline ) General System error handler
handleException ( Exception | Throwable $exception ) : void System Exception Handler
handleShutdown ( ) : void System shutdown handler
register ( ) : void Init method

Private Methods

Méthode Description
getLastError ( ) : array This method implements a workaround for PHP < 7 where no error_clear_last() exists by considering a last error of type E_USER_NOTICE as "cleared".
renderException ( Exception | Throwable $exception )

Method Details

__construct() public méthode

ErrorHandler constructor.
public __construct ( Version $version )
$version Version

__destruct() public méthode

Destructor
public __destruct ( ) : void
Résultat void

clearLastError() public méthode

public clearLastError ( )

handleError() public méthode

Capture error messages and transform them into an exception
public handleError ( integer $errno, string $errstr, string $errfile, integer $errline )
$errno integer Error code
$errstr string Error message
$errfile string Filename error occured in
$errline integer Line of error

handleException() public méthode

System Exception Handler
public handleException ( Exception | Throwable $exception ) : void
$exception Exception | Throwable The exception to handle
Résultat void

handleShutdown() public méthode

Used to grab fatal errors and handle them gracefully
public handleShutdown ( ) : void
Résultat void

register() public méthode

Register shutdown, exception and error handler
public register ( ) : void
Résultat void