From 4346a86068781f4acdeb574d7e2af08b77b58ea7 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 30 May 2015 13:52:26 +0200 Subject: CS --- .../ApiBundle/Security/Authentication/Provider/WsseProvider.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Wallabag/ApiBundle/Security/Authentication/Provider') diff --git a/src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php b/src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php index 8e49167a..db73ae2a 100644 --- a/src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php +++ b/src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php @@ -1,4 +1,5 @@ userProvider->loadUserByUsername($token->getUsername()); if (!$user) { - throw new AuthenticationException("Bad credentials. Did you forgot your username?"); + throw new AuthenticationException('Bad credentials. Did you forgot your username?'); } if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) { @@ -46,12 +47,12 @@ class WsseProvider implements AuthenticationProviderInterface { // Check created time is not in the future if (strtotime($created) > time()) { - throw new AuthenticationException("Back to the future..."); + throw new AuthenticationException('Back to the future...'); } // Expire timestamp after 5 minutes if (time() - strtotime($created) > 300) { - throw new AuthenticationException("Too late for this timestamp... Watch your watch."); + throw new AuthenticationException('Too late for this timestamp... Watch your watch.'); } // Validate nonce is unique within 5 minutes @@ -65,7 +66,7 @@ class WsseProvider implements AuthenticationProviderInterface $expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true)); if ($digest !== $expected) { - throw new AuthenticationException("Bad credentials ! Digest is not as expected."); + throw new AuthenticationException('Bad credentials ! Digest is not as expected.'); } return $digest === $expected; -- cgit v1.2.3