for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Yii\Debug\Collector;
final class ServiceCollector implements SummaryCollectorInterface
{
use CollectorTrait;
private array $items = [];
public function getCollected(): array
return $this->items;
}
public function collect(
string $service,
string $class,
string $method,
?array $arguments,
$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,
];
public function getSummary(): array
return [
'service' => [
'total' => count($this->items),
],
private function reset(): void
reset()
This check looks for private methods that have been defined, but are not used inside the class.
$this->items = [];
This check looks for private methods that have been defined, but are not used inside the class.