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

Fix: #11 - Add compatibility for PHP 8.4. Drop compatibility with PHP 7.0 #12

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

fisharebest
Copy link
Contributor

This change adds compatibility with PHP 8.4.

Specifically, the deprecation notices about "implicit null parameters". The code has been updated to use "explicit null".

This is a one-line, one-character change.

This fix requires PHP syntax which is not compatible with PHP 7.0, so I have raised the minimum supported version from PHP 7.0 to PHP 7.1.

I've updated the test scripts and CI to work with a wide range of PHP and PHPUNIT versions. Hence the dupliation in the docblock / attributes.

@@ -23,14 +23,14 @@
"issues": "https://github.com/oscarotero/dispatcher/issues"
},
"require": {
"php": "^7.0|^8.0",
"php": "7.1 - 8.4",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, change it to ^7.1|^8.0 so it's compatible with future versions (8.5 and upper)

@fisharebest
Copy link
Contributor Author

Please don't remove 7.0 compatibility.

To add compatibility with PHP 8.4, we must change (Foo $foo = null) to (?Foo $foo = null).

But this syntax is not compatible with PHP 7.0.

The PHP RFC https://wiki.php.net/rfc/deprecate-implicitly-nullable-types says that the required code-change is only available in PHP 7.1

I cannot think of any other solution.

Please, change it to ^7.1|^8.0 so it's compatible with future versions (8.5 and upper)

How can you know that it will be compatible with PHP 8.5?

When PHP 8.5 is released, create a new release with an updated dependency?

@oscarotero
Copy link
Owner

How can you know that it will be compatible with PHP 8.5?

PHP is semver, it doesn't introduce breaking changes between major versions. So anything that works on 8.4 should work on 8.5.
In fact, the latest version of this library was released 4 years ago and only now needs some minor tweaks to make it work with 8.4.

@oscarotero oscarotero merged commit 1b1fe86 into oscarotero:master Jan 6, 2025
10 checks passed
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 this pull request may close these issues.

2 participants