/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Console/Tests/Descriptor/JsonDescriptorTest.php
48 строк
1 KB
flkasper
[Console] Add hidden and deprecated option flags
10 авг 2026, 12:18
10 авг 2026, 12:18
3e8e5e2
Код
Авторство
О чём код?
<?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\Console\Tests\Descriptor; use Symfony\Component\Console\Descriptor\JsonDescriptor; class JsonDescriptorTest extends AbstractDescriptorTestCase { protected function getDescriptor() { return new JsonDescriptor(); } protected static function getFormat() { return 'json'; } protected function normalizeOutput($output) { if (null === $output || !\is_array($output = json_decode($output, true))) { return $output; } return array_map($this->normalizeOutputRecursively(...), $output); } private function normalizeOutputRecursively($output) { if (\is_array($output)) { return array_map($this->normalizeOutputRecursively(...), $output); } return match ($output) { null, true, false => $output, default => parent::normalizeOutput($output), }; } }