0 follower

Final Class Yiisoft\Yii\Debug\Collector\ExceptionCollector

InheritanceYiisoft\Yii\Debug\Collector\ExceptionCollector
ImplementsYiisoft\Yii\Debug\Collector\SummaryCollectorInterface
Uses TraitsYiisoft\Yii\Debug\Collector\CollectorTrait

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Yii\Debug\Collector\TimelineCollector $timelineCollector )
$timelineCollector Yiisoft\Yii\Debug\Collector\TimelineCollector

                public function __construct(
    private readonly TimelineCollector $timelineCollector
) {
}

            
collect() public method

public void collect ( \Yiisoft\ErrorHandler\Event\ApplicationError $error )
$error \Yiisoft\ErrorHandler\Event\ApplicationError

                public function collect(ApplicationError $error): void
{
    if (!$this->isActive()) {
        return;
    }
    $this->exception = $error->getThrowable();
    $this->timelineCollector->collect($this, $error::class);
}

            
getCollected() public method

public array getCollected ( )

                public function getCollected(): array
{
    if (!$this->isActive()) {
        return [];
    }
    if ($this->exception === null) {
        return [];
    }
    $throwable = $this->exception;
    $exceptions = [
        $throwable,
    ];
    while (($throwable = $throwable->getPrevious()) !== null) {
        $exceptions[] = $throwable;
    }
    return array_map([$this, 'serializeException'], $exceptions);
}

            
getName() public method
public string getName ( )

                public function getName(): string
{
    return self::class;
}

            
getSummary() public method

public array getSummary ( )

                public function getSummary(): array
{
    if (!$this->isActive()) {
        return [];
    }
    if ($this->exception === null) {
        return [];
    }
    return [
        'class' => $this->exception::class,
        'message' => $this->exception->getMessage(),
        'file' => $this->exception->getFile(),
        'line' => $this->exception->getLine(),
        'code' => $this->exception->getCode(),
    ];
}

            
shutdown() public method
public void shutdown ( )

                public function shutdown(): void
{
    $this->reset();
    $this->isActive = false;
}

            
startup() public method
public void startup ( )

                public function startup(): void
{
    $this->isActive = true;
}