#57972 closed defect (bug) (duplicate)
PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /wp-includes/Requests/Utility/CaseInsensitiveDictionary.php
Reported by: | codelyfe | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | External Libraries | Keywords: | |
Focuses: | Cc: |
Description
Here is the fix:
public function getIterator(): iterable { // Add 'iterable' to the return type return new \ArrayIterator($this->data); } #[\ReturnTypeWillChange] // Add the #[\ReturnTypeWillChange] attribute before the method declaration
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hi @codelyfe, welcome to Trac and thanks for opening this ticket!
This has been resolved as part of the upgrade of Requests (#54504) included in WordPress 6.2.
I'll close this ticket as a duplicate of #54504. Thanks a lot for this report! Hope you'll join in testing WordPress 6.2 RC3 and, after March 28th, WordPress 6.2!