The recently released version 6 contains changes that are only available since PHP 8.1, like initializing class variables in the constructor (see this RFC ). The code example below is from LtiMessageLaunch:
Having a php version designated in the composer.json throws an error if someone with an out-of-date php version attempts to require the package, providing an early warning that they wouldn't be able to use it due to the newer language constructs implemented.
Testing
[ ] I have added automated tests for my changes - N/A
[ ] I ran composer test before opening this PR - N/A
[ ] I ran composer lint-fix before opening this PR - N/A
Summary of Changes
The recently released version 6 contains changes that are only available since PHP 8.1, like initializing class variables in the constructor (see this RFC ). The code example below is from LtiMessageLaunch:
Having a php version designated in the
composer.json
throws an error if someone with an out-of-date php version attempts to require the package, providing an early warning that they wouldn't be able to use it due to the newer language constructs implemented.Testing
composer test
before opening this PR - N/Acomposer lint-fix
before opening this PR - N/A