tmuras / moosh

Moosh
GNU General Public License v3.0
229 stars 175 forks source link

Several deprecated issues are shown related to GetOptionKit after I updated to PHP 8.1. #448

Closed uhunkler closed 2 weeks ago

uhunkler commented 12 months ago

Several deprecated issues are shown related to GetOptionKit after I updated to PHP 8.1.

Deprecated: Return type of GetOptionKit\OptionCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/moosh/vendor/corneltek/getoptionkit/src/OptionCollection.php on line 203

etc.

haietza commented 11 months ago

We are seeing the same deprecation warnings on PHP 8.1.

In addition, we are also seeing:

PHP Deprecated: Return type of GetOptionKit\OptionCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/share/moosh/vendor/corneltek/getoptionkit/src/OptionCollection.php on line 198

PHP Deprecated: Return type of GetOptionKit\OptionResult::offsetExists($name) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/share/moosh/vendor/corneltek/getoptionkit/src/OptionResult.php on line 114

PHP Deprecated: Return type of GetOptionKit\OptionResult::offsetGet($name) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the # [\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/share/moosh/vendor/corneltek/getoptionkit/src/OptionResult.php on line 119

PHP Deprecated: Return type of GetOptionKit\OptionResult::offsetSet($name, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/share/moosh/vendor/corneltek/getoptionkit/src/OptionResult.php on line 109

PHP Deprecated: Return type of GetOptionKit\OptionResult::offsetUnset($name) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/local/share/moosh/vendor/corneltek/getoptionkit/src/OptionResult.php on line 124

PHP Deprecated: ucfirst(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/share/moosh/vendor/corneltek/getoptionkit/src/Option.php on line 264

blink38 commented 2 months ago

I managed to make these deprecations disappear using more recent version of getoptionkit

in composer.json :

"corneltek/getoptionkit": "dev-master#aab2728de80175217cab0d7a4d078c3eb907e2c0",

(my merge request : https://github.com/tmuras/moosh/pull/481)