Final Class Yiisoft\Yii\Debug\Collector\ServiceCollector
| Inheritance | Yiisoft\Yii\Debug\Collector\ServiceCollector |
|---|---|
| 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 ( string $service, string $class, string $method, array|null $arguments, mixed $result, string $status, object|null $error, float $timeStart, float $timeEnd ) | ||
| $service | string | |
| $class | string | |
| $method | string | |
| $arguments | array|null | |
| $result | mixed | |
| $status | string | |
| $error | object|null | |
| $timeStart | float | |
| $timeEnd | float | |
public function collect(
string $service,
string $class,
string $method,
?array $arguments,
mixed $result,
string $status,
?object $error,
float $timeStart,
float $timeEnd
): void {
if (!$this->isActive()) {
return;
}
$this->items[] = [
'service' => $service,
'class' => $class,
'method' => $method,
'arguments' => $arguments,
'result' => $result,
'status' => $status,
'error' => $error,
'timeStart' => $timeStart,
'timeEnd' => $timeEnd,
];
$this->timelineCollector->collect($this, count($this->items));
}
| public array getCollected ( ) |
public function getCollected(): array
{
if (!$this->isActive()) {
return [];
}
return $this->items;
}
| public array getSummary ( ) |
public function getSummary(): array
{
if (!$this->isActive()) {
return [];
}
return [
'total' => count($this->items),
];
}
| public void shutdown ( ) |
public function shutdown(): void
{
$this->reset();
$this->isActive = false;
}
Signup or Login in order to comment.