Heroyt / tournament-generator

A set of classes used to create multiple kinds of tournament brackets in PHP
MIT License
60 stars 15 forks source link

PHP 8.1.5 Throwing Deprecated Error on Iterator Class #4

Open jshster opened 2 years ago

jshster commented 2 years ago

Any plans to develop this and bring it up to speed with PHP 8.1.5?

I'm running your sample code and getting the following error: Deprecated: Return type of TournamentGenerator\Containers\BaseContainer::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .\sandbox\bracket-may-2022\vendor\heroyt\tournament-generator\src\TournamentGenerator\Containers\BaseContainer.php on line 122

Heroyt commented 2 years ago

Hi, I'm planning on bringing the library to PHP 8.1, but currently, I'm preoccupied with other work.

The warning you're getting is only due to missing return type hint but should not affect functionality itself. You can add a '@' sign before the function call which will mute the warning.