After switching to PHP8.1, I am now getting a slew of deprecation errors, like this one:
Deprecated: Return type of flight\util\Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /<REDACTED>/vendor/mikecao/flight/flight/util/Collection.php on line 170
For the end-user, this is easy enough to work around by using the following command before requiring the library:
The fastest, least friendly way to address this would be to update composer.json to indicate that PHP compatibility is limited to >8.
The fastest, friendliest way to address this would be to slap a temporary warning in the readme, with the suggestion to use error_reporting(error_reporting() & ~E_DEPRECATED); temporarily.
Perhaps there's a way to specify a recommended PHP version range, and then to conditionally warn a user about the relevant deprecation issue?
OR, maybe the codebase alterations are trivial?
EDIT: PR #439 is relevant.
EDIT2:
Another relevant exception:
During inheritance of ArrayAccess: Uncaught ErrorException: Return type of flight\util\Collection::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /users/ramos/www/worth-the-weight/vendor/mikecao/flight/flight/util/Collection.php:106
Hello!
After switching to PHP8.1, I am now getting a slew of deprecation errors, like this one:
For the end-user, this is easy enough to work around by using the following command before requiring the library:
The fastest, least friendly way to address this would be to update composer.json to indicate that PHP compatibility is limited to >8.
The fastest, friendliest way to address this would be to slap a temporary warning in the readme, with the suggestion to use
error_reporting(error_reporting() & ~E_DEPRECATED);
temporarily.Perhaps there's a way to specify a recommended PHP version range, and then to conditionally warn a user about the relevant deprecation issue?
OR, maybe the codebase alterations are trivial?
EDIT: PR #439 is relevant.
EDIT2:
Another relevant exception: