flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.6k stars 407 forks source link

Simplify PHP version constraint #587

Closed fadrian06 closed 2 months ago

fadrian06 commented 2 months ago

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

vlakoff commented 1 month ago

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.

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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?