No way to respect PHP version requirements when `only-best-candidates` set to `true`
- Dominant language
- PHP
- Stars
- 3.3k
- Forks
- 530
- Avg merge
- 6h 53m
- Merged PRs (30d)
- 13
Description
**Is your feature request related to a problem? Please describe.**
It seems that there is no way to configure satis to build repository working for given PHP version if `only-best-candidates` is set to `true`.
For example if we have an environment running PHP 7.3 and we want to use `"friendsofphp/php-cs-fixer": "2.18.1"`, which is compatible with `php: ^5.6 || ^7.0 || ^8.0`, setting the flag `only-best-candidates` to `true` will cause building a repo with some of the dependencies that are compatible only with PHP 8 (for example `"symfony/string": "v6.0.2"`).
Then, if we try to use our satis repository in the application, composer will fail with the message:

I tried to set desired environment in satis.json file `require` section, but then building fails with the message:

**Describe the solution you'd like**
There should be possibility to define desired platform requirement.
**Describe alternatives you've considered**
Alternatively, setting the flag `only-best-candidates` to `true` should result in including best dependency candidate for each PHP version compatible with packages defined in satis.json
Contributor guide
Assessment
This issue has not been assessed yet.