Skip to content

Commit

Permalink
Fixing doc comments & other stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Sep 13, 2015
1 parent 93521d3 commit 611087e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Contracts/LocalizationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function setBaseUrl($url);
/**
* Set current route name.
*
* @param string $routeName
* @param false|string $routeName
*/
public function setRouteName($routeName);

Expand Down
6 changes: 4 additions & 2 deletions src/Localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,13 @@ public function setBaseUrl($url)
/**
* Set current route name.
*
* @param string $routeName
* @param false|string $routeName
*/
public function setRouteName($routeName)
{
$this->routeName = $routeName;
if (is_string($routeName)) {
$this->routeName = $routeName;
}
}

/* ------------------------------------------------------------------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions src/Middleware/LocaleCookieRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ public function handle(Request $request, Closure $next )
)
) {
app('session')->reflash();
$redirection = localization()->getLocalizedURL($locale);

return new RedirectResponse($redirection, 302, [
'Vary' => 'Accept-Language'
]);
if (is_string($redirection = localization()->getLocalizedURL($locale))) {
return new RedirectResponse($redirection, 302, [
'Vary' => 'Accept-Language'
]);
}
}

return $next($request);
Expand Down
9 changes: 5 additions & 4 deletions src/Middleware/LocaleSessionRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ public function handle(Request $request, Closure $next)
)
) {
app('session')->reflash();
$redirection = localization()->getLocalizedURL($locale);

return new RedirectResponse($redirection, 302, [
'Vary' => 'Accept-Language'
]);
if (is_string($redirection = localization()->getLocalizedURL($locale))) {
return new RedirectResponse($redirection, 302, [
'Vary' => 'Accept-Language'
]);
}
}

return $next($request);
Expand Down

0 comments on commit 611087e

Please sign in to comment.