Skip to content

Commit 4e112f4

Browse files
committed
Move parameter code inside if statement
1 parent ef5c4bd commit 4e112f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/LocalizedUrlGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public function generateFromRequest($locale = null, $parameters = null, $absolut
4949
$urlBuilder = UrlBuilder::make(Request::fullUrl());
5050
$locale = $locale ?: $this->detectLocale($urlBuilder);
5151

52-
// $parameters can be an array, a function or it can contain model instances!
53-
// Normalize the parameters so we end up with an array of key => value pairs.
54-
$parameters = $this->prepareParameters($locale, $parameters ?: $this->getRouteParameters());
55-
5652
if ( ! $this->is404()) {
53+
// $parameters can be an array, a function or it can contain model instances!
54+
// Normalize the parameters so we end up with an array of key => value pairs.
55+
$parameters = $this->prepareParameters($locale, $parameters ?: $this->getRouteParameters());
56+
5757
$urlBuilder->setPath($this->route->uri());
5858

5959
list($slugs, $query) = $this->extractQueryParameters($urlBuilder->getPath(), $parameters);

0 commit comments

Comments
 (0)