Final Class Yiisoft\Yii\Debug\Collector\ExceptionCollector
| Inheritance | Yiisoft\Yii\Debug\Collector\ExceptionCollector |
|---|---|
| Implements | Yiisoft\Yii\Debug\Collector\SummaryCollectorInterface |
| Uses Traits | Yiisoft\Yii\Debug\Collector\CollectorTrait |
Public Methods
Method Details
| public mixed __construct ( Yiisoft\Yii\Debug\Collector\TimelineCollector $timelineCollector ) | ||
| $timelineCollector | Yiisoft\Yii\Debug\Collector\TimelineCollector | |
public function __construct(
private readonly TimelineCollector $timelineCollector
) {
}
| 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);
}
| 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);
}
| 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(),
];
}
| public void shutdown ( ) |
public function shutdown(): void
{
$this->reset();
$this->isActive = false;
}
Signup or Login in order to comment.