moosh icon indicating copy to clipboard operation
moosh copied to clipboard

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

Open uhunkler opened this issue 1 year ago • 2 comments

  • moosh version: 1.15
  • moodle version: 4.1
    • database:
  • php version: 8.1
  • operating system: 8.1-bullseye

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.

uhunkler avatar Sep 18 '23 09:09 uhunkler

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

haietza avatar Oct 18 '23 13:10 haietza

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)

blink38 avatar Jun 20 '24 11:06 blink38