PHP Class ZF\Console\ExceptionHandler

Afficher le fichier Open project: zfcampus/zf-console

Protected Properties

Свойство Type Description
$console Zend\Console\Adapter\AdapterInterface
$messageTemplate string The message template to use when exceptions are handled.

Méthodes publiques

Méthode Description
__construct ( Zend\Console\Adapter\AdapterInterface $console )
__invoke ( Exceptio\Exception | Throwabl\Throwable $exception ) Handle an exception
createMessage ( Exceptio\Exception | Throwabl\Throwable $exception ) : string Create the message to emit based on the provided exception and current message template
setMessageTemplate ( mixed $messageTemplate ) Set the message template to use.

Méthodes protégées

Méthode Description
fillTemplate ( Exceptio\Exception | Throwabl\Throwable $exception, false | string $previous = false ) : string Fill the message template with details of the given exception

Private Methods

Méthode Description
validateException ( mixed $exception ) : void Validate that an exception was received

Method Details

__construct() public méthode

public __construct ( Zend\Console\Adapter\AdapterInterface $console )
$console Zend\Console\Adapter\AdapterInterface

__invoke() public méthode

On completion, exits with a non-zero status code.
public __invoke ( Exceptio\Exception | Throwabl\Throwable $exception )
$exception Exceptio\Exception | Throwabl\Throwable

createMessage() public méthode

Create the message to emit based on the provided exception and current message template
public createMessage ( Exceptio\Exception | Throwabl\Throwable $exception ) : string
$exception Exceptio\Exception | Throwabl\Throwable
Résultat string

fillTemplate() protected méthode

Fill the message template with details of the given exception
protected fillTemplate ( Exceptio\Exception | Throwabl\Throwable $exception, false | string $previous = false ) : string
$exception Exceptio\Exception | Throwabl\Throwable
$previous false | string If provided, adds the ":previous" template and this value
Résultat string

setMessageTemplate() public méthode

Message templates may define the following variable placeholders: - :className - :message - :code - :file - :line - :stack - :previous (this is used to report previous exceptions in a trace)
public setMessageTemplate ( mixed $messageTemplate )
$messageTemplate mixed

Property Details

$console protected_oe property

protected AdapterInterface,Zend\Console\Adapter $console
Résultat Zend\Console\Adapter\AdapterInterface

$messageTemplate protected_oe property

The message template to use when exceptions are handled.
protected string $messageTemplate
Résultat string