Skip to content

Commit 6babf86

Browse files
committed
bug #47019 [Console] Fix comparison with completion api version (GromNaN)
This PR was merged into the 6.2 branch. Discussion ---------- [Console] Fix comparison with completion api version | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #46901 | License | MIT | Doc PR | n/a Comparison introduced in #46901 is wrong. Commits ------- 91c8c83 Fix comparison with completion api version
2 parents 7b5cb25 + 91c8c83 commit 6babf86

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy