1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Yiisoft\Yii\Debug\Collector; |
||
6 | |||
7 | final class TimelineCollector implements CollectorInterface |
||
8 | { |
||
9 | use CollectorTrait; |
||
10 | |||
11 | private array $events = []; |
||
12 | |||
13 | public function getCollected(): array |
||
14 | { |
||
15 | if (!$this->isActive()) { |
||
16 | return []; |
||
17 | } |
||
18 | return $this->events; |
||
19 | } |
||
20 | |||
21 | public function collect(CollectorInterface $collector, string|int $reference, ...$data): void |
||
22 | { |
||
23 | if (!$this->isActive()) { |
||
24 | return; |
||
25 | } |
||
26 | |||
27 | $this->events[] = [microtime(true), $reference, $collector::class, array_values($data)]; |
||
28 | } |
||
29 | |||
30 | private function reset(): void |
||
0 ignored issues
–
show
|
|||
31 | { |
||
32 | $this->events = []; |
||
33 | } |
||
34 | } |
||
35 |
This check looks for private methods that have been defined, but are not used inside the class.