File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ public function toSymfonyRouteCollection()
184
184
}
185
185
186
186
/**
187
- * Generate a random new route name.
187
+ * Get a randomly generated route name.
188
188
*
189
189
* @return string
190
190
*/
Original file line number Diff line number Diff line change @@ -66,9 +66,6 @@ public function add(Route $route)
66
66
'action ' => $ route ->getAction () + ['as ' => $ name ],
67
67
];
68
68
69
- // Because we don't want to recompile the routes every time a new one
70
- // is added, we simply clear the array and let the recompiling be
71
- // done as soon as we need to perform the matching manually.
72
69
$ this ->compiled = [];
73
70
}
74
71
@@ -82,16 +79,15 @@ public function add(Route $route)
82
79
*/
83
80
public function match (Request $ request )
84
81
{
85
- // If the compiled routes array is empty but we have routes set on the attributes array
86
- // we'll attempt to recompile the routes first. Because compiled routes will always
87
- // be set on the first request, this won't affect initial request performance.
88
82
if (empty ($ this ->compiled ) && $ this ->attributes ) {
89
83
$ this ->recompileRoutes ();
90
84
}
91
85
92
86
$ route = null ;
93
- $ context = (new RequestContext ())->fromRequest ($ request );
94
- $ matcher = new CompiledUrlMatcher ($ this ->compiled , $ context );
87
+
88
+ $ matcher = new CompiledUrlMatcher (
89
+ $ this ->compiled , (new RequestContext ())->fromRequest ($ request )
90
+ );
95
91
96
92
if ($ result = $ matcher ->matchRequest ($ request )) {
97
93
$ route = $ this ->getByName ($ result ['_route ' ]);
You can’t perform that action at this time.
0 commit comments