You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Package "php" could not be found with constraint "100", results below will most likely be incomplete.
__root__ - requires php (^8.1)
Not finding what you were looking for? Try calling `composer update "php:100" --dry-run` to get another view on the problem.
with exit code 0.
And I expected this to happen:
Exit code > 0
Compare that to the "OK" case:
When I run this command:
composer why-not php ^8.1
I get the following output:
There is no installed package depending on "php" in versions not matching ^8.1
Not finding what you were looking for? Try calling `composer update "php:^8.1" --dry-run` to get another view on the problem.
with exit code 0.
So right now the only way to determine that we have a problem in the one case but not the other is to parse the output.
That's very unfortunate (and unexpected, at least for me).
Please note that what I need is a way to distinguish the cases where there is an actual problem from those where there is none.
For example if you execute the below, you'll receive a warning/error hinting at possibly incomplete results but that should not count as an error as far as the exit code is concerned:
When I run this command:
composer why-not php ^8.2
I get the following output:
Package "php" could not be found with constraint "^8.2", results below will most likely be incomplete.
There is no installed package depending on "php" in versions not matching ^8.2
Not finding what you were looking for? Try calling `composer update "php:^8.2" --dry-run` to get another view on the problem.
with exit code 0.
The text was updated successfully, but these errors were encountered:
Well those are not wrong per se.. They are nonsensical as you used php version 100 but that's just you and I knowing that is unlikely. If you used php 9 you will also not find anything, even tho that's a much less nonsensical prompt, and in both cases it is not something Composer can know is wrong IMO.
So I am not sure in what case you would expect a non-zero exit code.
Sorry, I thought this would be obvious. Let me rephrase, and assume version 8.3 instead of 100 for a more realistic version constraint.
Assuming you have any package that includes a "php" version constraint either directly or through its dependencies, I expect the following exit codes depending on the case:
the package can be installed with the PHP version (constraint) provided on the command line: exit code 0
the package cannot be installed with the PHP version (constraint) provided on the command line: exit code > 0 (and explanation why in the output)
As I said, right now I can only distinguish the two different outcomes right now by parsing the output which is neither elegant nor future-proof.
composer.json:
When I run this command:
I get the following output:
with exit code 0.
And I expected this to happen:
Exit code > 0
Compare that to the "OK" case:
When I run this command:
I get the following output:
with exit code 0.
So right now the only way to determine that we have a problem in the one case but not the other is to parse the output.
That's very unfortunate (and unexpected, at least for me).
Please note that what I need is a way to distinguish the cases where there is an actual problem from those where there is none.
For example if you execute the below, you'll receive a warning/error hinting at possibly incomplete results but that should not count as an error as far as the exit code is concerned:
When I run this command:
I get the following output:
with exit code 0.
The text was updated successfully, but these errors were encountered: