/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/HttpKernel/Tests/Logger.php
48 строк
990 B
Alexander M. Turek
[HttpKernel] Fix method naming collision
27 авг 2024, 10:30
27 авг 2024, 10:30
ec9f13e
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests; use Psr\Log\AbstractLogger; class Logger extends AbstractLogger { protected array $logs; public function __construct() { $this->clear(); } public function getLogsForLevel(string $level): array { return $this->logs[$level]; } public function clear(): void { $this->logs = [ 'emergency' => [], 'alert' => [], 'critical' => [], 'error' => [], 'warning' => [], 'notice' => [], 'info' => [], 'debug' => [], ]; } public function log($level, $message, array $context = []): void { $this->logs[$level][] = $message; } }