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;
use JetBrains\PhpStorm\ArrayShape;
final class LogCollector implements LogCollectorInterface, IndexCollectorInterface
{
use CollectorTrait;
private array $messages = [];
public function getCollected(): array
return $this->messages;
}
public function collect(string $level, $message, array $context): void
if (!$this->isActive()) {
return;
$this->messages[] = [
'time' => microtime(true),
'level' => $level,
'message' => $message,
'context' => $context,
];
private function reset(): void
reset()
This check looks for private methods that have been defined, but are not used inside the class.
$this->messages = [];
#[ArrayShape(['totalLogs' => 'int'])]
public function getIndexData(): array
return [
'totalLogs' => count($this->messages),
This check looks for private methods that have been defined, but are not used inside the class.