Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91c8c83

Browse files
committed
Fix comparison with completion api version
1 parent 9ccf365 commit 91c8c83

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Console/Command/CompleteCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8282
try {
8383
// "symfony" must be kept for compat with the shell scripts generated by Symfony Console 5.4 - 6.1
8484
$version = $input->getOption('symfony') ? '1' : $input->getOption('api-version');
85-
if ($version && version_compare($version, self::COMPLETION_API_VERSION, '>=')) {
85+
if ($version && version_compare($version, self::COMPLETION_API_VERSION, '<')) {
8686
$message = sprintf('Completion script version is not supported ("%s" given, ">=%s" required).', $version, self::COMPLETION_API_VERSION);
8787
$this->log($message);
8888

src/Symfony/Component/Console/Tests/Command/CompleteCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function provideCompleteCommandInputDefinitionInputs()
128128
private function execute(array $input)
129129
{
130130
// run in verbose mode to assert exceptions
131-
$this->tester->execute($input ? ($input + ['--shell' => 'bash']) : $input, ['verbosity' => OutputInterface::VERBOSITY_DEBUG]);
131+
$this->tester->execute($input ? ($input + ['--shell' => 'bash', '--api-version' => CompleteCommand::COMPLETION_API_VERSION]) : $input, ['verbosity' => OutputInterface::VERBOSITY_DEBUG]);
132132
}
133133
}
134134

0 commit comments

Comments
 (0)