Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify PHP version constraint #587

Closed
fadrian06 opened this issue May 9, 2024 · 4 comments · Fixed by #588
Closed

Simplify PHP version constraint #587

fadrian06 opened this issue May 9, 2024 · 4 comments · Fixed by #588

Comments

@fadrian06
Copy link
Contributor

Reading the composer documentation and testing it with some tools, it turns out that the operator >= 7.4 It would be a simplified way to the PHP version constraints that currently exist both in composer.json, in the packagist info, and in the README badge

https://getcomposer.org/doc/articles/versions.md#version-range

Tool: https://semver.madewithlove.com/?package=php&constraint=%3E%3D7.4

Screenshot_20240509-022705.png

fadrian06 added a commit that referenced this issue May 9, 2024
@fadrian06 fadrian06 linked a pull request May 9, 2024 that will close this issue
@vlakoff
Copy link
Contributor

vlakoff commented May 17, 2024

Generally speaking, the >= operator should be avoided, because it is recommended to always put an upper bound, at least on the next major version (i.e. the first number).

I would recommend ^7.4|^8.0 instead. So the previous code, but removing the ^8.1|^8.2|^8.3 part that was redundant.

  • ^7.4: >=7.4 and < 8.0
  • ^8.0: >=8.0 and < 9.0

This way we support PHP >= 7.4, but we prevent running on an hypothetical future PHP 9.0, as it would certainly require updates in Flight to work.

@fadrian06
Copy link
Contributor Author

I guess you're right, even if we guarantee that flight will always support latest and lts versions... for older versions it might break

1 similar comment
@fadrian06
Copy link
Contributor Author

I guess you're right, even if we guarantee that flight will always support latest and lts versions... for older versions it might break

@fadrian06
Copy link
Contributor Author

Although honestly, if I had php 9 and flight was already in version 6 for example...why would it cross my mind to download an old version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants