Skip to content

Commit a7312a5

Browse files
committed
minor #32915 [Routing] Add a warning about the getRouteCollection() method (fabpot)
This PR was merged into the 3.4 branch. Discussion ---------- [Routing] Add a warning about the getRouteCollection() method | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a In #19274, we tried to deprecate `RouterInterface::getRouteCollection()`, but failed at doing so. I propose to add a warning about why one should never use it at runtime as a first step. Commits ------- 8863f0675d [Routing] added a warning about the getRouteCollection() method
2 parents aa2bf3d + a692730 commit a7312a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

RouterInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ interface RouterInterface extends UrlMatcherInterface, UrlGeneratorInterface
2626
/**
2727
* Gets the RouteCollection instance associated with this Router.
2828
*
29+
* WARNING: This method should never be used at runtime as it is SLOW.
30+
* You might use it in a cache warmer though.
31+
*
2932
* @return RouteCollection A RouteCollection instance
3033
*/
3134
public function getRouteCollection();

0 commit comments

Comments
 (0)