[hotfix] unknown constants when executed with composer 2.2 #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The objective of this PR is to add constants which were supposed to be inherited but can't in older versions of
symfony/console.Details
In this package we're registering two composer commands:
Our classes inherit from
Composer\Command\BaseCommandwhich itself inherits fromSymfony\Component\Console\Command\Command. The latter, in newer versions, defines constants for return values (SUCCESS,FAILURE, etc.).When these commands are run, they are executed by the composer binary (composer.phar).
Example:
This means that the relevant version of
symfony/consoleis the one baked into the composer.phar that you're using.In our services we deliberately use the LTS version 2.2 of composer.
This version builds on a rather old version of
symfony/console, see https://github.com/composer/composer/blob/2.2.25/composer.json#L35C30-L35C36.In that version, the
Symfony\Component\Console\Command\Commandclass did not yet define constants for return values, see https://github.com/symfony/console/blob/v2.8.52/Command/Command.phpHowever, when developing with an IDE like PHPstorm we were tricked into believing that the constants exist because
symfony/consolemight be installed in a newer version locally or within a service. Plus, executed with composer locally might even have worked if you have a newer composer version installed.