Skip to content

Commit b461f1e

Browse files
committed
Simplify command arg definition
1 parent 89263ca commit b461f1e

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ parameters:
6666
count: 1
6767
path: src/Cache/RouteMetadata/YamlMetadataProvider.php
6868

69-
-
70-
message: '#^Strict comparison using \=\=\= between 8 and 6 will always evaluate to false\.$#'
71-
identifier: identical.alwaysFalse
72-
count: 1
73-
path: src/Command/DebugCommand.php
74-
7569
-
7670
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\.$#'
7771
identifier: argument.type

src/Command/DebugCommand.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\Console\Input\InputOption;
1818
use Symfony\Component\Console\Output\OutputInterface;
1919
use Symfony\Component\Console\Style\SymfonyStyle;
20-
use Symfony\Component\HttpKernel\Kernel;
2120

2221
#[AsCommand(
2322
name: 'purgatory:debug',
@@ -36,20 +35,7 @@ public function __construct(
3635

3736
protected function configure(): void
3837
{
39-
$params = [
40-
'name' => 'target',
41-
'mode' => InputArgument::OPTIONAL,
42-
'description' => 'The entity name or a substring of its name',
43-
'default' => null,
44-
'suggestedValues' => array_keys($this->getEntityCollection()),
45-
];
46-
47-
if (Kernel::MAJOR_VERSION === 6) {
48-
// cannot use named arguments with SF6
49-
$params = array_values($params);
50-
}
51-
52-
$this->addArgument(...$params);
38+
$this->addArgument('target', InputArgument::OPTIONAL, 'The entity name or a substring of its name', null, array_keys($this->getEntityCollection()));
5339
$this->addOption('subscription', null, InputOption::VALUE_REQUIRED, 'The entity FQCN, optionally followed by a property path separated by "::"');
5440
$this->addOption('with-properties', null, InputOption::VALUE_NONE, 'Display all property subscriptions for an entity');
5541
$this->addOption('route', null, InputOption::VALUE_REQUIRED, 'Display subscriptions for specific route');

0 commit comments

Comments
 (0)