summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
Diffstat (limited to 'Http')
-rw-r--r--Http/AccessMap.php3
-rw-r--r--Http/Authentication/DefaultAuthenticationFailureHandler.php2
-rw-r--r--Http/Authentication/DefaultAuthenticationSuccessHandler.php3
-rw-r--r--Http/Authorization/AccessDeniedHandlerInterface.php2
-rw-r--r--Http/EntryPoint/BasicAuthenticationEntryPoint.php4
-rw-r--r--Http/EntryPoint/DigestAuthenticationEntryPoint.php10
-rw-r--r--Http/EntryPoint/FormAuthenticationEntryPoint.php3
-rw-r--r--Http/EntryPoint/RetryAuthenticationEntryPoint.php4
-rw-r--r--Http/Event/InteractiveLoginEvent.php6
-rw-r--r--Http/Event/SwitchUserEvent.php12
-rw-r--r--Http/Firewall.php3
-rw-r--r--Http/Firewall/AbstractPreAuthenticatedListener.php2
-rw-r--r--Http/Firewall/ContextListener.php7
-rw-r--r--Http/Firewall/ExceptionListener.php125
-rw-r--r--Http/Firewall/LogoutListener.php6
-rw-r--r--Http/Firewall/RememberMeListener.php2
-rw-r--r--Http/Firewall/X509AuthenticationListener.php3
-rw-r--r--Http/FirewallMap.php8
-rw-r--r--Http/HttpUtils.php13
-rw-r--r--Http/Logout/DefaultLogoutSuccessHandler.php1
-rw-r--r--Http/RememberMe/AbstractRememberMeServices.php11
-rw-r--r--Http/RememberMe/ResponseListener.php6
-rw-r--r--Http/RememberMe/TokenBasedRememberMeServices.php4
23 files changed, 151 insertions, 89 deletions
diff --git a/Http/AccessMap.php b/Http/AccessMap.php
index de78e15..051a8c2 100644
--- a/Http/AccessMap.php
+++ b/Http/AccessMap.php
@@ -36,6 +36,9 @@ class AccessMap implements AccessMapInterface
$this->map[] = array($requestMatcher, $roles, $channel);
}
+ /**
+ * {@inheritDoc}
+ */
public function getPatterns(Request $request)
{
foreach ($this->map as $elements) {
diff --git a/Http/Authentication/DefaultAuthenticationFailureHandler.php b/Http/Authentication/DefaultAuthenticationFailureHandler.php
index 64f84f0..70dcd1e 100644
--- a/Http/Authentication/DefaultAuthenticationFailureHandler.php
+++ b/Http/Authentication/DefaultAuthenticationFailureHandler.php
@@ -64,7 +64,7 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle
{
if ($failureUrl = $request->get($this->options['failure_path_parameter'], null, true)) {
$this->options['failure_path'] = $failureUrl;
- }
+ }
if (null === $this->options['failure_path']) {
$this->options['failure_path'] = $this->options['login_path'];
diff --git a/Http/Authentication/DefaultAuthenticationSuccessHandler.php b/Http/Authentication/DefaultAuthenticationSuccessHandler.php
index dd7a7d5..0c084b9 100644
--- a/Http/Authentication/DefaultAuthenticationSuccessHandler.php
+++ b/Http/Authentication/DefaultAuthenticationSuccessHandler.php
@@ -18,9 +18,6 @@ use Symfony\Component\Security\Http\HttpUtils;
/**
* Class with the default authentication success handling logic.
*
- * Can be optionally be extended from by the developer to alter the behaviour
- * while keeping the default behaviour.
- *
* @author Fabien Potencier <fabien@symfony.com>
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
* @author Alexander <iam.asm89@gmail.com>
diff --git a/Http/Authorization/AccessDeniedHandlerInterface.php b/Http/Authorization/AccessDeniedHandlerInterface.php
index 5f60fd6..a5ea9db 100644
--- a/Http/Authorization/AccessDeniedHandlerInterface.php
+++ b/Http/Authorization/AccessDeniedHandlerInterface.php
@@ -12,8 +12,8 @@
namespace Symfony\Component\Security\Http\Authorization;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Security\Core\Exception\AccessDeniedException;
/**
* This is used by the ExceptionListener to translate an AccessDeniedException
diff --git a/Http/EntryPoint/BasicAuthenticationEntryPoint.php b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
index 44ece5e..2dc3d11 100644
--- a/Http/EntryPoint/BasicAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Http\EntryPoint;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
-use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
@@ -30,6 +29,9 @@ class BasicAuthenticationEntryPoint implements AuthenticationEntryPointInterface
$this->realmName = $realmName;
}
+ /**
+ * {@inheritdoc}
+ */
public function start(Request $request, AuthenticationException $authException = null)
{
$response = new Response();
diff --git a/Http/EntryPoint/DigestAuthenticationEntryPoint.php b/Http/EntryPoint/DigestAuthenticationEntryPoint.php
index 1131b58..71a6313 100644
--- a/Http/EntryPoint/DigestAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/DigestAuthenticationEntryPoint.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Http\EntryPoint;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
-use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\Security\Core\Exception\NonceExpiredException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
@@ -38,6 +37,9 @@ class DigestAuthenticationEntryPoint implements AuthenticationEntryPointInterfac
$this->logger = $logger;
}
+ /**
+ * {@inheritdoc}
+ */
public function start(Request $request, AuthenticationException $authException = null)
{
$expiryTime = microtime(true) + $this->nonceValiditySeconds * 1000;
@@ -62,11 +64,17 @@ class DigestAuthenticationEntryPoint implements AuthenticationEntryPointInterfac
return $response;
}
+ /**
+ * @return string
+ */
public function getKey()
{
return $this->key;
}
+ /**
+ * @return string
+ */
public function getRealmName()
{
return $this->realmName;
diff --git a/Http/EntryPoint/FormAuthenticationEntryPoint.php b/Http/EntryPoint/FormAuthenticationEntryPoint.php
index 3eaae82..b78f0a9 100644
--- a/Http/EntryPoint/FormAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php
@@ -13,7 +13,6 @@ namespace Symfony\Component\Security\Http\EntryPoint;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
-use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\Security\Http\HttpUtils;
use Symfony\Component\HttpKernel\HttpKernelInterface;
@@ -30,7 +29,7 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface
private $httpUtils;
/**
- * Constructor
+ * Constructor.
*
* @param HttpKernelInterface $kernel
* @param HttpUtils $httpUtils An HttpUtils instance
diff --git a/Http/EntryPoint/RetryAuthenticationEntryPoint.php b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
index 532601a..d1a0a28 100644
--- a/Http/EntryPoint/RetryAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Http\EntryPoint;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
-use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
@@ -34,6 +33,9 @@ class RetryAuthenticationEntryPoint implements AuthenticationEntryPointInterface
$this->httpsPort = $httpsPort;
}
+ /**
+ * {@inheritdoc}
+ */
public function start(Request $request, AuthenticationException $authException = null)
{
$scheme = $request->isSecure() ? 'http' : 'https';
diff --git a/Http/Event/InteractiveLoginEvent.php b/Http/Event/InteractiveLoginEvent.php
index 2225d92..575352c 100644
--- a/Http/Event/InteractiveLoginEvent.php
+++ b/Http/Event/InteractiveLoginEvent.php
@@ -15,10 +15,14 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+/**
+ * InteractiveLoginEvent
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
class InteractiveLoginEvent extends Event
{
private $request;
-
private $authenticationToken;
/**
diff --git a/Http/Event/SwitchUserEvent.php b/Http/Event/SwitchUserEvent.php
index 4a7dcaf..a553154 100644
--- a/Http/Event/SwitchUserEvent.php
+++ b/Http/Event/SwitchUserEvent.php
@@ -15,10 +15,14 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\EventDispatcher\Event;
+/**
+ * SwitchUserEvent
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
class SwitchUserEvent extends Event
{
private $request;
-
private $targetUser;
public function __construct(Request $request, UserInterface $targetUser)
@@ -27,11 +31,17 @@ class SwitchUserEvent extends Event
$this->targetUser = $targetUser;
}
+ /**
+ * @return Request
+ */
public function getRequest()
{
return $this->request;
}
+ /**
+ * @return UserInterface
+ */
public function getTargetUser()
{
return $this->targetUser;
diff --git a/Http/Firewall.php b/Http/Firewall.php
index 31c1da5..4f1cf30 100644
--- a/Http/Firewall.php
+++ b/Http/Firewall.php
@@ -71,6 +71,9 @@ class Firewall implements EventSubscriberInterface
}
}
+ /**
+ * {@inheritDoc}
+ */
public static function getSubscribedEvents()
{
return array(KernelEvents::REQUEST => array('onKernelRequest', 8));
diff --git a/Http/Firewall/AbstractPreAuthenticatedListener.php b/Http/Firewall/AbstractPreAuthenticatedListener.php
index fdc2e8c..94ae901 100644
--- a/Http/Firewall/AbstractPreAuthenticatedListener.php
+++ b/Http/Firewall/AbstractPreAuthenticatedListener.php
@@ -97,7 +97,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface
/**
* Clears a PreAuthenticatedToken for this provider (if present)
- *
+ *
* @param AuthenticationException $exception
*/
private function clearToken(AuthenticationException $exception)
diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php
index 81ccbdc..60ab3df 100644
--- a/Http/Firewall/ContextListener.php
+++ b/Http/Firewall/ContextListener.php
@@ -156,10 +156,11 @@ class ContextListener implements ListenerInterface
foreach ($this->userProviders as $provider) {
try {
- $token->setUser($provider->refreshUser($user));
+ $refreshedUser = $provider->refreshUser($user);
+ $token->setUser($refreshedUser);
if (null !== $this->logger) {
- $this->logger->debug(sprintf('Username "%s" was reloaded from user provider.', $user->getUsername()));
+ $this->logger->debug(sprintf('Username "%s" was reloaded from user provider.', $refreshedUser->getUsername()));
}
return $token;
@@ -167,7 +168,7 @@ class ContextListener implements ListenerInterface
// let's try the next user provider
} catch (UsernameNotFoundException $notFound) {
if (null !== $this->logger) {
- $this->logger->warning(sprintf('Username "%s" could not be found.', $user->getUsername()));
+ $this->logger->warning(sprintf('Username "%s" could not be found.', $notFound->getUsername()));
}
return null;
diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php
index abbb460..e7e2989 100644
--- a/Http/Firewall/ExceptionListener.php
+++ b/Http/Firewall/ExceptionListener.php
@@ -81,86 +81,92 @@ class ExceptionListener
$event->getDispatcher()->removeListener(KernelEvents::EXCEPTION, array($this, 'onKernelException'));
$exception = $event->getException();
- $request = $event->getRequest();
+ do {
+ if ($exception instanceof AuthenticationException) {
+ return $this->handleAuthenticationException($event, $exception);
+ } elseif ($exception instanceof AccessDeniedException) {
+ return $this->handleAccessDeniedException($event, $exception);
+ } elseif ($exception instanceof LogoutException) {
+ return $this->handleLogoutException($event, $exception);
+ }
+ } while (null !== $exception = $exception->getPrevious());
+ }
+
+ private function handleAuthenticationException(GetResponseForExceptionEvent $event, AuthenticationException $exception)
+ {
+ if (null !== $this->logger) {
+ $this->logger->info(sprintf('Authentication exception occurred; redirecting to authentication entry point (%s)', $exception->getMessage()));
+ }
- // determine the actual cause for the exception
- while (null !== $previous = $exception->getPrevious()) {
- $exception = $previous;
+ try {
+ $event->setResponse($this->startAuthentication($event->getRequest(), $exception));
+ } catch (\Exception $e) {
+ $event->setException($e);
}
+ }
- if ($exception instanceof AuthenticationException) {
+ private function handleAccessDeniedException(GetResponseForExceptionEvent $event, AccessDeniedException $exception)
+ {
+ $event->setException(new AccessDeniedHttpException($exception->getMessage(), $exception));
+
+ $token = $this->context->getToken();
+ if (!$this->authenticationTrustResolver->isFullFledged($token)) {
if (null !== $this->logger) {
- $this->logger->info(sprintf('Authentication exception occurred; redirecting to authentication entry point (%s)', $exception->getMessage()));
+ $this->logger->debug(sprintf('Access is denied (user is not fully authenticated) by "%s" at line %s; redirecting to authentication entry point', $exception->getFile(), $exception->getLine()));
}
try {
- $response = $this->startAuthentication($request, $exception);
+ $insufficientAuthenticationException = new InsufficientAuthenticationException('Full authentication is required to access this resource.', 0, $exception);
+ $insufficientAuthenticationException->setToken($token);
+
+ $event->setResponse($this->startAuthentication($event->getRequest(), $insufficientAuthenticationException));
} catch (\Exception $e) {
$event->setException($e);
-
- return;
}
- } elseif ($exception instanceof AccessDeniedException) {
- $event->setException(new AccessDeniedHttpException($exception->getMessage(), $exception));
- $token = $this->context->getToken();
- if (!$this->authenticationTrustResolver->isFullFledged($token)) {
- if (null !== $this->logger) {
- $this->logger->debug(sprintf('Access is denied (user is not fully authenticated) by "%s" at line %s; redirecting to authentication entry point', $exception->getFile(), $exception->getLine()));
- }
+ return;
+ }
+
+ if (null !== $this->logger) {
+ $this->logger->debug(sprintf('Access is denied (and user is neither anonymous, nor remember-me) by "%s" at line %s', $exception->getFile(), $exception->getLine()));
+ }
- try {
- $insufficientAuthenticationException = new InsufficientAuthenticationException('Full authentication is required to access this resource.', 0, $exception);
- $insufficientAuthenticationException->setToken($token);
- $response = $this->startAuthentication($request, $insufficientAuthenticationException);
- } catch (\Exception $e) {
- $event->setException($e);
+ try {
+ if (null !== $this->accessDeniedHandler) {
+ $response = $this->accessDeniedHandler->handle($event->getRequest(), $exception);
- return;
- }
- } else {
- if (null !== $this->logger) {
- $this->logger->debug(sprintf('Access is denied (and user is neither anonymous, nor remember-me) by "%s" at line %s', $exception->getFile(), $exception->getLine()));
+ if ($response instanceof Response) {
+ $event->setResponse($response);
}
+ } elseif (null !== $this->errorPage) {
+ $subRequest = $this->httpUtils->createRequest($event->getRequest(), $this->errorPage);
+ $subRequest->attributes->set(SecurityContextInterface::ACCESS_DENIED_ERROR, $exception);
- try {
- if (null !== $this->accessDeniedHandler) {
- $response = $this->accessDeniedHandler->handle($request, $exception);
-
- if (!$response instanceof Response) {
- return;
- }
- } elseif (null !== $this->errorPage) {
- $subRequest = $this->httpUtils->createRequest($request, $this->errorPage);
- $subRequest->attributes->set(SecurityContextInterface::ACCESS_DENIED_ERROR, $exception);
-
- $response = $event->getKernel()->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
- } else {
- return;
- }
- } catch (\Exception $e) {
- if (null !== $this->logger) {
- $this->logger->error(sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $e->getMessage()));
- }
-
- $event->setException(new \RuntimeException('Exception thrown when handling an exception.', 0, $e));
-
- return;
- }
+ $event->setResponse($event->getKernel()->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true));
}
- } elseif ($exception instanceof LogoutException) {
+ } catch (\Exception $e) {
if (null !== $this->logger) {
- $this->logger->info(sprintf('Logout exception occurred; wrapping with AccessDeniedHttpException (%s)', $exception->getMessage()));
+ $this->logger->error(sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $e->getMessage()));
}
- return;
- } else {
- return;
+ $event->setException(new \RuntimeException('Exception thrown when handling an exception.', 0, $e));
}
+ }
- $event->setResponse($response);
+ private function handleLogoutException(GetResponseForExceptionEvent $event, LogoutException $exception)
+ {
+ if (null !== $this->logger) {
+ $this->logger->info(sprintf('Logout exception occurred; wrapping with AccessDeniedHttpException (%s)', $exception->getMessage()));
+ }
}
+ /**
+ * @param Request $request
+ * @param AuthenticationException $authException
+ *
+ * @return Response
+ * @throws AuthenticationException
+ */
private function startAuthentication(Request $request, AuthenticationException $authException)
{
if (null === $this->authenticationEntryPoint) {
@@ -181,9 +187,12 @@ class ExceptionListener
return $this->authenticationEntryPoint->start($request, $authException);
}
+ /**
+ * @param Request $request
+ */
protected function setTargetPath(Request $request)
{
- // session isn't required when using http basic authentication mechanism for example
+ // session isn't required when using HTTP basic authentication mechanism for example
if ($request->hasSession() && $request->isMethodSafe()) {
$request->getSession()->set('_security.'.$this->providerKey.'.target_path', $request->getUri());
}
diff --git a/Http/Firewall/LogoutListener.php b/Http/Firewall/LogoutListener.php
index 653c644..7dc9503 100644
--- a/Http/Firewall/LogoutListener.php
+++ b/Http/Firewall/LogoutListener.php
@@ -20,7 +20,6 @@ use Symfony\Component\Security\Core\Exception\LogoutException;
use Symfony\Component\Security\Http\HttpUtils;
use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface;
-use Symfony\Component\Security\Core\Exception\InvalidCsrfTokenException;
/**
* LogoutListener logout users.
@@ -37,7 +36,7 @@ class LogoutListener implements ListenerInterface
private $csrfProvider;
/**
- * Constructor
+ * Constructor.
*
* @param SecurityContextInterface $securityContext
* @param HttpUtils $httpUtils An HttpUtilsInterface instance
@@ -77,9 +76,8 @@ class LogoutListener implements ListenerInterface
*
* @param GetResponseEvent $event A GetResponseEvent instance
*
- * @throws InvalidCsrfTokenException if the CSRF token is invalid
+ * @throws LogoutException if the CSRF token is invalid
* @throws \RuntimeException if the LogoutSuccessHandlerInterface instance does not return a response
- * @throws LogoutException
*/
public function handle(GetResponseEvent $event)
{
diff --git a/Http/Firewall/RememberMeListener.php b/Http/Firewall/RememberMeListener.php
index 5a856e2..6ca3842 100644
--- a/Http/Firewall/RememberMeListener.php
+++ b/Http/Firewall/RememberMeListener.php
@@ -35,7 +35,7 @@ class RememberMeListener implements ListenerInterface
private $dispatcher;
/**
- * Constructor
+ * Constructor.
*
* @param SecurityContextInterface $securityContext
* @param RememberMeServicesInterface $rememberMeServices
diff --git a/Http/Firewall/X509AuthenticationListener.php b/Http/Firewall/X509AuthenticationListener.php
index 0b5a6ae..5aabf75 100644
--- a/Http/Firewall/X509AuthenticationListener.php
+++ b/Http/Firewall/X509AuthenticationListener.php
@@ -36,6 +36,9 @@ class X509AuthenticationListener extends AbstractPreAuthenticatedListener
$this->credentialKey = $credentialKey;
}
+ /**
+ * {@inheritdoc}
+ */
protected function getPreAuthenticatedData(Request $request)
{
if (!$request->server->has($this->userKey)) {
diff --git a/Http/FirewallMap.php b/Http/FirewallMap.php
index dfc0984..0554bed 100644
--- a/Http/FirewallMap.php
+++ b/Http/FirewallMap.php
@@ -25,11 +25,19 @@ class FirewallMap implements FirewallMapInterface
{
private $map = array();
+ /**
+ * @param RequestMatcherInterface $requestMatcher
+ * @param array $listeners
+ * @param ExceptionListener $exceptionListener
+ */
public function add(RequestMatcherInterface $requestMatcher = null, array $listeners = array(), ExceptionListener $exceptionListener = null)
{
$this->map[] = array($requestMatcher, $listeners, $exceptionListener);
}
+ /**
+ * {@inheritDoc}
+ */
public function getListeners(Request $request)
{
foreach ($this->map as $elements) {
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php
index c3ff865..0c8b21b 100644
--- a/Http/HttpUtils.php
+++ b/Http/HttpUtils.php
@@ -20,7 +20,6 @@ use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
-use Symfony\Component\HttpFoundation\Response;
/**
* Encapsulates the logic needed to create sub-requests, redirect the user, and match URLs.
@@ -36,7 +35,9 @@ class HttpUtils
* Constructor.
*
* @param UrlGeneratorInterface $urlGenerator A UrlGeneratorInterface instance
- * @param UrlMatcherInterface|RequestMatcherInterface $urlMatcher The Url or Request matcher
+ * @param UrlMatcherInterface|RequestMatcherInterface $urlMatcher The URL or Request matcher
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(UrlGeneratorInterface $urlGenerator = null, $urlMatcher = null)
{
@@ -54,7 +55,7 @@ class HttpUtils
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
* @param integer $status The status code
*
- * @return Response A RedirectResponse instance
+ * @return RedirectResponse A RedirectResponse instance
*/
public function createRedirectResponse(Request $request, $path, $status = 302)
{
@@ -123,9 +124,11 @@ class HttpUtils
* Generates a URI, based on the given path or absolute URL.
*
* @param Request $request A Request instance
- * @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
+ * @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
*
* @return string An absolute URL
+ *
+ * @throws \LogicException
*/
public function generateUri($request, $path)
{
@@ -143,7 +146,7 @@ class HttpUtils
$url = $this->urlGenerator->generate($path, $request->attributes->all(), UrlGeneratorInterface::ABSOLUTE_URL);
- // unnecessary query string parameters must be removed from url
+ // unnecessary query string parameters must be removed from URL
// (ie. query parameters that are presents in $attributes)
// fortunately, they all are, so we have to remove entire query string
$position = strpos($url, '?');
diff --git a/Http/Logout/DefaultLogoutSuccessHandler.php b/Http/Logout/DefaultLogoutSuccessHandler.php
index e06cb6d..70f15cf 100644
--- a/Http/Logout/DefaultLogoutSuccessHandler.php
+++ b/Http/Logout/DefaultLogoutSuccessHandler.php
@@ -13,7 +13,6 @@ namespace Symfony\Component\Security\Http\Logout;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\HttpUtils;
-use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface;
/**
* Default logout success handler will redirect users to a configured path.
diff --git a/Http/RememberMe/AbstractRememberMeServices.php b/Http/RememberMe/AbstractRememberMeServices.php
index ae61dd7..740d3d6 100644
--- a/Http/RememberMe/AbstractRememberMeServices.php
+++ b/Http/RememberMe/AbstractRememberMeServices.php
@@ -40,7 +40,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
private $userProviders;
/**
- * Constructor
+ * Constructor.
*
* @param array $userProviders
* @param string $key
@@ -80,6 +80,9 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
return $this->options['remember_me_parameter'];
}
+ /**
+ * @return string
+ */
public function getKey()
{
return $this->key;
@@ -94,6 +97,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
* @return TokenInterface|null
*
* @throws CookieTheftException
+ * @throws \RuntimeException
*/
final public function autoLogin(Request $request)
{
@@ -219,6 +223,9 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
*/
abstract protected function processAutoLoginCookie(array $cookieParts, Request $request);
+ /**
+ * @param Request $request
+ */
protected function onLoginFail(Request $request)
{
}
@@ -284,7 +291,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
}
/**
- * Checks whether remember-me capabilities where requested
+ * Checks whether remember-me capabilities were requested
*
* @param Request $request
*
diff --git a/Http/RememberMe/ResponseListener.php b/Http/RememberMe/ResponseListener.php
index 03c71c7..6087587 100644
--- a/Http/RememberMe/ResponseListener.php
+++ b/Http/RememberMe/ResponseListener.php
@@ -22,6 +22,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
*/
class ResponseListener implements EventSubscriberInterface
{
+ /**
+ * @param FilterResponseEvent $event
+ */
public function onKernelResponse(FilterResponseEvent $event)
{
$request = $event->getRequest();
@@ -32,6 +35,9 @@ class ResponseListener implements EventSubscriberInterface
}
}
+ /**
+ * {@inheritDoc}
+ */
public static function getSubscribedEvents()
{
return array(KernelEvents::RESPONSE => 'onKernelResponse');
diff --git a/Http/RememberMe/TokenBasedRememberMeServices.php b/Http/RememberMe/TokenBasedRememberMeServices.php
index 5a66fe4..df0ea1b 100644
--- a/Http/RememberMe/TokenBasedRememberMeServices.php
+++ b/Http/RememberMe/TokenBasedRememberMeServices.php
@@ -116,7 +116,7 @@ class TokenBasedRememberMeServices extends AbstractRememberMeServices
*
* @param string $class
* @param string $username The username
- * @param integer $expires The unixtime when the cookie expires
+ * @param integer $expires The Unix timestamp when the cookie expires
* @param string $password The encoded password
*
* @throws \RuntimeException if username contains invalid chars
@@ -138,7 +138,7 @@ class TokenBasedRememberMeServices extends AbstractRememberMeServices
*
* @param string $class
* @param string $username The username
- * @param integer $expires The unixtime when the cookie expires
+ * @param integer $expires The Unix timestamp when the cookie expires
* @param string $password The encoded password
*
* @throws \RuntimeException when the private key is empty