Skip to content

Commit 21caaf8

Browse files
committed
refactor to use ->has() method
1 parent 62328c7 commit 21caaf8

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/Console/ConsoleApplication.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@ final class ConsoleApplication extends Application
2323
{
2424
private const string NAME = 'Rector';
2525

26-
/**
27-
* @var string[]
28-
*/
29-
private const array ALLOWED_COMMANDS = [
30-
'custom-rule',
31-
'process',
32-
'list',
33-
'setup-ci',
34-
'worker',
35-
'help',
36-
'completion',
37-
];
38-
3926
/**
4027
* @param Command[] $commands
4128
*/
@@ -90,7 +77,7 @@ public function doRun(InputInterface $input, OutputInterface $output): int
9077
$tokens = $privatesAccessor->getPrivateProperty($input, 'tokens');
9178
$tokens = array_merge(['process'], $tokens);
9279
$privatesAccessor->setPrivateProperty($input, 'tokens', $tokens);
93-
} elseif (! in_array($commandName, self::ALLOWED_COMMANDS, true)) {
80+
} elseif (! $this->has($commandName)) {
9481
$this->symfonyStyle->error(
9582
sprintf(
9683
'The following given path does not match any files or directories: %s%s',

0 commit comments

Comments
 (0)