Skip to content

Commit 4280851

Browse files
committed
formatting
1 parent 558257d commit 4280851

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/Illuminate/Routing/AbstractRouteCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function toSymfonyRouteCollection()
184184
}
185185

186186
/**
187-
* Generate a random new route name.
187+
* Get a randomly generated route name.
188188
*
189189
* @return string
190190
*/

src/Illuminate/Routing/CompiledRouteCollection.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ public function add(Route $route)
6666
'action' => $route->getAction() + ['as' => $name],
6767
];
6868

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.
7269
$this->compiled = [];
7370
}
7471

@@ -82,16 +79,15 @@ public function add(Route $route)
8279
*/
8380
public function match(Request $request)
8481
{
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.
8882
if (empty($this->compiled) && $this->attributes) {
8983
$this->recompileRoutes();
9084
}
9185

9286
$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+
);
9591

9692
if ($result = $matcher->matchRequest($request)) {
9793
$route = $this->getByName($result['_route']);

0 commit comments

Comments
 (0)