-
Notifications
You must be signed in to change notification settings - Fork 78
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
PHP 8.4 support #672
PHP 8.4 support #672
Conversation
I have no clue why PHP 7.2 tests suddenly fail. It feels related to bugsnag/bugsnag-laravel#544 |
I tried applying the same fix as in that Laravel PR, but it didn't help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this against our previous versions, and it seems to resolve the 8.4 issues nicely! I've also tested with PHP 5, and can confirm it works there as well.
Could we retarget the merge into next
, then I can take care of the changelog and version bumps, and get it released?
Co-authored-by: Tom Longridge <[email protected]>
Goal
With the recent release of PHP 8.4, some of the features that were used by the notifier were marked as deprecated and started throwing depreciation warnings. This PR removes both of the depreciation warnings without breaking backwards compatibility.
https://php.watch/versions/8.4/E_STRICT-deprecated
https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated
Design
The issue with nullable types was solved by removing type annotations from parameters that default to
null
. Type annotations provided in the doc comments above already provide accurate annotations, so LSPs should continue to infer types correctly.The depreciation of
E_STRICT
required more widespread changes. Due to conditional properties in associative arrays not being supported in <6.0, the list of errors had to be rewritten with an initializer that conditionally adds the value to the array. This also warranted a change in tests that rely onE_STRICT
.The added tests for PHP 8.3 and 8.4 required small changes in the unit tests to account for differences in error messages.
Changeset
E_STRICT
in PHP 8.4+.Testing
Tested manually and automatically. No new tests were added. Some of the existing tests were extended.