/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Console/Attribute/MapDateTime.php
36 строк
1 KB
Robin Chalas
[Console] Add argument resolvers
05 янв 2026, 20:31
Не верифицирован
05 янв 2026, 20:31
7008e30
Код
Авторство
О чём код?
<?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\Attribute; /** * Defines how a DateTime parameter should be resolved from command input. * * @author Robin Chalas <robin.chalas@gmail.com> */ #[\Attribute(\Attribute::TARGET_PARAMETER)] class MapDateTime { /** * @param string|null $format The DateTime format (@see https://php.net/datetime.format) * @param string|null $argument The argument name to read from (defaults to parameter name) * @param string|null $option The option name to read from (mutually exclusive with $argument) */ public function __construct( public readonly ?string $format = null, public readonly ?string $argument = null, public readonly ?string $option = null, ) { if ($argument && $option) { throw new \LogicException('MapDateTime cannot specify both argument and option.'); } } }