/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/HttpKernel/Profiler/ProfilerStateChecker.php
33 строки
742 B
Nicolas Grekas
Don't enable tracing unless the profiler is enabled
22 апр 2025, 12:11
22 апр 2025, 12:11
d5a3769
Код
Авторство
О чём код?
<?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\Profiler; use Psr\Container\ContainerInterface; class ProfilerStateChecker { public function __construct( private ContainerInterface $container, private bool $defaultEnabled, ) { } public function isProfilerEnabled(): bool { return $this->container->get('profiler')?->isEnabled() ?? $this->defaultEnabled; } public function isProfilerDisabled(): bool { return !$this->isProfilerEnabled(); } }