-
Notifications
You must be signed in to change notification settings - Fork 0
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 Deprecation warning when using PHP 8.1.22 #7
Comments
Hi, Thanks for the ticket. I don't have the time for php++ anymore :( |
Tbh I already have a fix working on my part, I would happily do a PR if you're interested. If not, I'll fork your project for internal purposes if that's ok with you. |
You can send a PR if you have the fix ;) |
Hi, I was going to submit the PR but unfortunately I saw the project should be compatible with PHP ^7.4 which means I can't use union types nor mixed as a return for the incriminated function. As a result, unless support for this legacy PHP version is dropped, I cannot find a way to suppress this deprecation warning which is a shame. I guess I'll have to use a fork for our projects or migrate to collection. |
When running unit tests in a PHP 8.1.22/Symfony 6.4 project with php-pp/core installed, I always get a deprecation warning :
PHPUnit 10.5.20 by Sebastian Bergmann and contributors.
Runtime: PHP 8.1.22 with Xdebug 3.1.6
PHP Deprecated: Return type of PhpPp\Core\Component\Collection\AbstractCollection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in {projectPath}/symfony/vendor/php-pp/core/src/Collection/AbstractCollection.php on line 298
Easy fix is to add the expected return for the key() function as stated in the deprecation.
The text was updated successfully, but these errors were encountered: