Skip to content

PHP Deprecation warning when using PHP 8.1.22 #7

@DJCrispyRice

Description

@DJCrispyRice

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions