Skip to content

Commit

Permalink
PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
SocalNick committed Sep 7, 2014
1 parent 5d9394b commit 209853a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ScnSocialAuth/Controller/RedirectCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class RedirectCallback
private $options;

/**
* @param Application $application
* @param Application $application
* @param RouteInterface $router
* @param ModuleOptions $options
* @param ModuleOptions $options
*/
public function __construct(Application $application, RouteInterface $router, ModuleOptions $options)
{
Expand All @@ -55,6 +55,7 @@ public function __invoke()
$response = $this->application->getResponse();
$response->getHeaders()->addHeaderLine('Location', $redirect);
$response->setStatusCode(302);

return $response;
}

Expand Down Expand Up @@ -90,15 +91,16 @@ private function routeExists($route)
} catch (Exception\RuntimeException $e) {
return false;
}

return true;
}

/**
* Returns the url to redirect to based on current route.
* If $redirect is set and the option to use redirect is set to true, it will return the $redirect url.
*
* @param string $currentRoute
* @param bool $redirect
* @param string $currentRoute
* @param bool $redirect
* @return mixed
*/
private function getRedirect($currentRoute, $redirect = false)
Expand All @@ -115,11 +117,13 @@ private function getRedirect($currentRoute, $redirect = false)
case 'scn-social-auth-user/authenticate/provider':
case 'scn-social-auth-user/add-provider/provider':
$route = ($redirect) ?: $this->options->getLoginRedirectRoute();

return $this->router->assemble(array(), array('name' => $route));
break;
case 'zfcuser/logout':
case 'scn-social-auth-user/logout':
$route = ($redirect) ?: $this->options->getLogoutRedirectRoute();

return $this->router->assemble(array(), array('name' => $route));
break;
default:
Expand Down

0 comments on commit 209853a

Please sign in to comment.