Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297377

Fix phpdoc return type for RouteProvider::getAllRoutes()

$
0
0

Problem/Motivation

#3158708: RouteProvider::getAllRoutes no longer returns an iterable, breaking BC fixed a BC break introduced in #2917331: Decouple from Symfony CMF that changed the return type for RouteProvider::getAllRoutes().

It used to return an Iterator. Then #2917331 changed it to an array. Then #3158708 changed it back.

However, the PHPDoc comment says:

   * @return \Symfony\Component\Routing\Route[]
   *   An iterator of routes keyed by route name.

I thought [] meant an array, not an Iterator. How do you tell the difference in PHPDoc comments?

Proposed resolution

Properly document RouteProvider::getAllRoutes() that it returns an Iterator, not an array.

Remaining tasks

  • Figure out how to properly document something that returns an Iterator in PHPDoc.
  • Update the docs for RouteProvider::getAllRoutes() accordingly.
  • Reviews / refinements.
  • RTBC.
  • Commit.

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 297377

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>