summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
Diffstat (limited to 'Http')
-rw-r--r--Http/AccessMap.php3
-rw-r--r--Http/Authentication/AuthenticationFailureHandlerInterface.php1
-rw-r--r--Http/Authentication/AuthenticationSuccessHandlerInterface.php1
-rw-r--r--Http/Authentication/DefaultAuthenticationFailureHandler.php2
-rw-r--r--Http/Authorization/AccessDeniedHandlerInterface.php1
-rw-r--r--Http/EntryPoint/AuthenticationEntryPointInterface.php1
-rw-r--r--Http/EntryPoint/BasicAuthenticationEntryPoint.php3
-rw-r--r--Http/EntryPoint/DigestAuthenticationEntryPoint.php9
-rw-r--r--Http/EntryPoint/FormAuthenticationEntryPoint.php2
-rw-r--r--Http/EntryPoint/RetryAuthenticationEntryPoint.php3
-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/AccessListener.php5
-rw-r--r--Http/Firewall/ContextListener.php7
-rw-r--r--Http/Firewall/ExceptionListener.php125
-rw-r--r--Http/Firewall/LogoutListener.php5
-rw-r--r--Http/Firewall/RememberMeListener.php2
-rw-r--r--Http/Firewall/X509AuthenticationListener.php3
-rw-r--r--Http/FirewallMap.php8
-rw-r--r--Http/FirewallMapInterface.php2
-rw-r--r--Http/HttpUtils.php12
-rw-r--r--Http/Logout/LogoutSuccessHandlerInterface.php1
-rw-r--r--Http/RememberMe/AbstractRememberMeServices.php11
-rw-r--r--Http/RememberMe/ResponseListener.php6
-rw-r--r--Http/RememberMe/TokenBasedRememberMeServices.php4
27 files changed, 157 insertions, 83 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/AuthenticationFailureHandlerInterface.php b/Http/Authentication/AuthenticationFailureHandlerInterface.php
index 8dbd29a..e2d375e 100644
--- a/Http/Authentication/AuthenticationFailureHandlerInterface.php
+++ b/Http/Authentication/AuthenticationFailureHandlerInterface.php
@@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Http\Authentication;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
/**
* Interface for custom authentication failure handlers.
diff --git a/Http/Authentication/AuthenticationSuccessHandlerInterface.php b/Http/Authentication/AuthenticationSuccessHandlerInterface.php
index 5c08e73..9ec64b4 100644
--- a/Http/Authentication/AuthenticationSuccessHandlerInterface.php
+++ b/Http/Authentication/AuthenticationSuccessHandlerInterface.php
@@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Http\Authentication;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
/**
* Interface for a custom authentication success handler
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/Authorization/AccessDeniedHandlerInterface.php b/Http/Authorization/AccessDeniedHandlerInterface.php
index a10a5d0..a5ea9db 100644
--- a/Http/Authorization/AccessDeniedHandlerInterface.php
+++ b/Http/Authorization/AccessDeniedHandlerInterface.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Security\Http\Authorization;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
/**
diff --git a/Http/EntryPoint/AuthenticationEntryPointInterface.php b/Http/EntryPoint/AuthenticationEntryPointInterface.php
index d190fc7..0d7595d 100644
--- a/Http/EntryPoint/AuthenticationEntryPointInterface.php
+++ b/Http/EntryPoint/AuthenticationEntryPointInterface.php
@@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Http\EntryPoint;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
/**
* AuthenticationEntryPointInterface is the interface used to start the
diff --git a/Http/EntryPoint/BasicAuthenticationEntryPoint.php b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
index 44ece5e..e03de7d 100644
--- a/Http/EntryPoint/BasicAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
@@ -30,6 +30,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..4029d79 100644
--- a/Http/EntryPoint/DigestAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/DigestAuthenticationEntryPoint.php
@@ -38,6 +38,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 +65,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..45a7ea9 100644
--- a/Http/EntryPoint/FormAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php
@@ -30,7 +30,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..091e0ee 100644
--- a/Http/EntryPoint/RetryAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
@@ -34,6 +34,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/AccessListener.php b/Http/Firewall/AccessListener.php
index c3894ef..9349012 100644
--- a/Http/Firewall/AccessListener.php
+++ b/Http/Firewall/AccessListener.php
@@ -15,7 +15,6 @@ use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Http\AccessMapInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
-use Psr\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
@@ -31,15 +30,13 @@ class AccessListener implements ListenerInterface
private $accessDecisionManager;
private $map;
private $authManager;
- private $logger;
- public function __construct(SecurityContextInterface $context, AccessDecisionManagerInterface $accessDecisionManager, AccessMapInterface $map, AuthenticationManagerInterface $authManager, LoggerInterface $logger = null)
+ public function __construct(SecurityContextInterface $context, AccessDecisionManagerInterface $accessDecisionManager, AccessMapInterface $map, AuthenticationManagerInterface $authManager)
{
$this->context = $context;
$this->accessDecisionManager = $accessDecisionManager;
$this->map = $map;
$this->authManager = $authManager;
- $this->logger = $logger;
}
/**
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 ca2f439..7dc9503 100644
--- a/Http/Firewall/LogoutListener.php
+++ b/Http/Firewall/LogoutListener.php
@@ -36,7 +36,7 @@ class LogoutListener implements ListenerInterface
private $csrfProvider;
/**
- * Constructor
+ * Constructor.
*
* @param SecurityContextInterface $securityContext
* @param HttpUtils $httpUtils An HttpUtilsInterface instance
@@ -76,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/FirewallMapInterface.php b/Http/FirewallMapInterface.php
index 336125f..1627ab5 100644
--- a/Http/FirewallMapInterface.php
+++ b/Http/FirewallMapInterface.php
@@ -24,7 +24,7 @@ interface FirewallMapInterface
* Returns the authentication listeners, and the exception listener to use
* for the given request.
*
- * If there are no authentication listeners, the first inner are must be
+ * If there are no authentication listeners, the first inner array must be
* empty.
*
* If there is no exception listener, the second element of the outer array
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php
index 0453520..0c8b21b 100644
--- a/Http/HttpUtils.php
+++ b/Http/HttpUtils.php
@@ -35,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)
{
@@ -53,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)
{
@@ -122,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)
{
@@ -142,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/LogoutSuccessHandlerInterface.php b/Http/Logout/LogoutSuccessHandlerInterface.php
index 61642a8..4246fa4 100644
--- a/Http/Logout/LogoutSuccessHandlerInterface.php
+++ b/Http/Logout/LogoutSuccessHandlerInterface.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Security\Http\Logout;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
/**
* LogoutSuccesshandlerInterface.
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