Problem/Motivation

Method "Symfony\Component\Routing\RouteCollection::getIterator()" will return "\ArrayIterator" as of its next major version. Doing the same in child class "Drupal\Core\Routing\LazyRouteCollection" will be required when upgrading.

Steps to reproduce

Proposed resolution

Add the "ArrayIterator" return type hint.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#6 3232893-6.patch558 bytesdaffie
#2 3232893-2.patch530 bytesdaffie

Comments

daffie created an issue. See original summary.

daffie’s picture

Status: Active » Needs review
StatusFileSize
new530 bytes

I could not find any instances where the method was overridden in contrib. See: http://grep.xnddx.ru/search?text=LazyRouteCollection&filename=.

daffie’s picture

In contrib is the method getIterator() overridden a lot, only none are related to the class Drupal\Core\Routing\LazyRouteCollection. See: http://grep.xnddx.ru/search?text=public%20function%20getIterator%28%29&f....

longwave’s picture

Status: Needs review » Reviewed & tested by the community
longwave’s picture

Status: Reviewed & tested by the community » Needs work

Patch no longer applies.

daffie’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new558 bytes

Rerolled.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed bc46c77 and pushed to 9.3.x. Thanks!

  • alexpott committed bc46c77 on 9.3.x
    Issue #3232893 by daffie: [Symfony 6] Add "ArrayIterator" type hint to...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.