Final Class Yiisoft\Yii\Debug\Collector\ExceptionCollector
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
| Uses Traits | Yiisoft\ |
Public Methods
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $timelineCollector | Yiisoft\ |
|
public function __construct(
private readonly TimelineCollector $timelineCollector,
) {}
| public void collect ( \ | ||
| $error | \ |
|
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;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.