From b461f1e0dbc2af8d1c3f6ac8ca69fbd1da5c3148 Mon Sep 17 00:00:00 2001 From: HypeMC Date: Thu, 18 Dec 2025 14:06:19 +0100 Subject: [PATCH] Simplify command arg definition --- phpstan-baseline.neon | 6 ------ src/Command/DebugCommand.php | 16 +--------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index cf50443..c84157d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -66,12 +66,6 @@ parameters: count: 1 path: src/Cache/RouteMetadata/YamlMetadataProvider.php - - - message: '#^Strict comparison using \=\=\= between 8 and 6 will always evaluate to false\.$#' - identifier: identical.alwaysFalse - count: 1 - path: src/Command/DebugCommand.php - - message: '#^Parameter \#2 \$configurator of method Symfony\\Component\\DependencyInjection\\ContainerBuilder\:\:registerAttributeForAutoconfiguration\(\) expects callable\(Symfony\\Component\\DependencyInjection\\ChildDefinition, Sofascore\\PurgatoryBundle\\Attribute\\AsExpressionLanguageFunction, Reflector\)\: void, Closure\(Symfony\\Component\\DependencyInjection\\ChildDefinition, Sofascore\\PurgatoryBundle\\Attribute\\AsExpressionLanguageFunction, ReflectionClass\|ReflectionMethod\)\: void given\.$#' identifier: argument.type diff --git a/src/Command/DebugCommand.php b/src/Command/DebugCommand.php index 6d8c0e4..696d1c1 100644 --- a/src/Command/DebugCommand.php +++ b/src/Command/DebugCommand.php @@ -17,7 +17,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\HttpKernel\Kernel; #[AsCommand( name: 'purgatory:debug', @@ -36,20 +35,7 @@ public function __construct( protected function configure(): void { - $params = [ - 'name' => 'target', - 'mode' => InputArgument::OPTIONAL, - 'description' => 'The entity name or a substring of its name', - 'default' => null, - 'suggestedValues' => array_keys($this->getEntityCollection()), - ]; - - if (Kernel::MAJOR_VERSION === 6) { - // cannot use named arguments with SF6 - $params = array_values($params); - } - - $this->addArgument(...$params); + $this->addArgument('target', InputArgument::OPTIONAL, 'The entity name or a substring of its name', null, array_keys($this->getEntityCollection())); $this->addOption('subscription', null, InputOption::VALUE_REQUIRED, 'The entity FQCN, optionally followed by a property path separated by "::"'); $this->addOption('with-properties', null, InputOption::VALUE_NONE, 'Display all property subscriptions for an entity'); $this->addOption('route', null, InputOption::VALUE_REQUIRED, 'Display subscriptions for specific route');