Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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:
Priority: normal Milestone:
Component: External Libraries Version:
Severity: normal Keywords:
Cc: Focuses:

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)

#1 @costdev
4 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

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!

#2 @SergeyBiryukov
4 years ago

  • Component General → External Libraries
Note: See TracTickets for help on using tickets.