Add constants for exit return codes#3696
Closed
BafS wants to merge 1 commit intosquizlabs:masterfrom
Closed
Conversation
Member
|
This is a good idea in general, but the exit codes don't map like that. PHPCS and PHPCBF use the same exit codes to mean different things, which has resulted in a suggestion like: if ($this->reporter->totalFixable === 0) {
// PHPCBF fixed all fixable errors.
return self::FAILURE;
}That's obviously not a failed run for PHPCS given it fixed all errors. So this would need a bit of work before it could be merged. Likely different constants for PHPCS and PHPCBF, with appropriate names and documentation of the constant itself. Linking the 4.0 issue to change the exit codes as this would be helpful there: #2898 |
Author
|
I see that return codes are not consistent, so maybe that could be done for v4 only yes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Inspired by https://github.com/symfony/symfony/blob/6.2/src/Symfony/Component/Console/Command/Command.php#L37-L40, to make the code more readable and to avoid miss-using exit codes.