Passed
Push — master ( 20c7aa...f5603a )
by Thomas Mauro
02:58
created
src/Token/TokenSetVerifier.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     ): void {
46 46
         $idToken = $tokenSet->getIdToken();
47 47
 
48
-        if (! $idToken) {
48
+        if (!$idToken) {
49 49
             throw new InvalidArgumentException('No id_token in token set');
50 50
         }
51 51
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $header = \json_decode(base64url_decode(\explode('.', $idToken)[0] ?? '{}'), true);
57 57
         $payload = \json_decode(base64url_decode(\explode('.', $idToken)[1] ?? '{}'), true);
58 58
 
59
-        if (! \is_array($payload)) {
59
+        if (!\is_array($payload)) {
60 60
             throw new InvalidArgumentException('Unable to decode token payload');
61 61
         }
62 62
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             if (\array_key_exists('s_hash', $payload)) {
77 77
                 $state = $authSession ? $authSession->getState() : null;
78 78
 
79
-                if (! $state) {
79
+                if (!$state) {
80 80
                     throw new InvalidArgumentException('Cannot verify s_hash, "state" not provided');
81 81
                 }
82 82
 
Please login to merge, or discard this patch.
src/Token/ResponseTokenVerifier.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $metadata = $client->getMetadata();
56 56
         $expectedAlg = $metadata->getAuthorizationSignedResponseAlg();
57 57
 
58
-        if (! $expectedAlg) {
58
+        if (!$expectedAlg) {
59 59
             throw new RuntimeException('No authorization_signed_response_alg defined');
60 60
         }
61 61
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
         $payload = \json_decode(base64url_decode(\explode('.', $token)[1] ?? '{}'), true);
69 69
 
70
-        if (! \is_array($payload)) {
70
+        if (!\is_array($payload)) {
71 71
             throw new InvalidArgumentException('Unable to decode token payload');
72 72
         }
73 73
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         if (0 === \strpos($expectedAlg, 'HS')) {
103 103
             $clientSecret = $metadata->getClientSecret();
104 104
 
105
-            if (! $clientSecret) {
105
+            if (!$clientSecret) {
106 106
                 throw new RuntimeException('Unable to verify token without client_secret');
107 107
             }
108 108
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $jwks = $client->getIssuer()->getJwks();
112 112
         }
113 113
 
114
-        if (! $jwsVerifier->verifyWithKeySet($jws, $jwks, 0)) {
114
+        if (!$jwsVerifier->verifyWithKeySet($jws, $jwks, 0)) {
115 115
             throw new InvalidArgumentException('Failed to validate JWT signature');
116 116
         }
117 117
 
Please login to merge, or discard this patch.
src/Middleware/SessionCookieMiddleware.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
36 36
     {
37
-        if (! \class_exists(Cookies::class)) {
37
+        if (!\class_exists(Cookies::class)) {
38 38
             throw new LogicException('To use the SessionCookieMiddleware you should install dflydev/fig-cookies package');
39 39
         }
40 40
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $cookieValue = $sessionCookie ? $sessionCookie->getValue() : null;
45 45
         $data = $cookieValue ? \json_decode($cookieValue, true) : [];
46 46
 
47
-        if (! \is_array($data)) {
47
+        if (!\is_array($data)) {
48 48
             $data = [];
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/Middleware/CallbackMiddleware.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@
 block discarded – undo
45 45
         $client = $this->client ?: $request->getAttribute(ClientInterface::class);
46 46
         $authSession = $request->getAttribute(AuthSessionInterface::class);
47 47
 
48
-        if (! $client instanceof ClientInterface) {
48
+        if (!$client instanceof ClientInterface) {
49 49
             throw new LogicException('No OpenID client provided');
50 50
         }
51 51
 
52
-        if ($authSession && ! $client instanceof AuthSessionInterface) {
52
+        if ($authSession && !$client instanceof AuthSessionInterface) {
53 53
             throw new LogicException('Invalid auth session provided in attribute ' . AuthSessionInterface::class);
54 54
         }
55 55
 
Please login to merge, or discard this patch.
src/functions/base64url_decode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
     $decoded = \base64_decode(\str_pad(\strtr($data, '-_', '+/'), \strlen($data) % 4, '='));
12 12
 
13
-    if (! $decoded) {
13
+    if (!$decoded) {
14 14
         throw new RuntimeException('Unable to base64url_decode');
15 15
     }
16 16
 
Please login to merge, or discard this patch.
src/functions/check_server_response.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  */
14 14
 function check_server_response(ResponseInterface $response, ?int $expectedCode = null): void
15 15
 {
16
-    if (! $expectedCode && $response->getStatusCode() >= 400) {
16
+    if (!$expectedCode && $response->getStatusCode() >= 400) {
17 17
         throw OAuth2Exception::fromResponse($response);
18 18
     }
19 19
 
Please login to merge, or discard this patch.
src/AuthMethod/PrivateKeyJwt.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
 
62 62
         $jwk = $this->jwk ?: $client->getJWKS()->selectKey('sig');
63 63
 
64
-        if (! $jwk) {
64
+        if (!$jwk) {
65 65
             throw new RuntimeException('Unable to get a client signature jwk');
66 66
         }
67 67
 
Please login to merge, or discard this patch.
src/ClaimChecker/AuthTimeChecker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     public function checkClaim($value): void
30 30
     {
31
-        if (! \is_int($value)) {
31
+        if (!\is_int($value)) {
32 32
             throw new InvalidClaimException('"auth_time" must be an integer.', self::CLAIM_NAME, $value);
33 33
         }
34 34
 
Please login to merge, or discard this patch.
src/Token/TokenDecrypter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $expectedAlg = $metadata->get($use . '_encrypted_response_alg');
40 40
         $expectedEnc = $metadata->get($use . '_encrypted_response_enc');
41 41
 
42
-        if (! $expectedAlg) {
42
+        if (!$expectedAlg) {
43 43
             return $token;
44 44
         }
45 45
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             throw new RuntimeException(\sprintf('Unexpected JWE enc received, expected %s, got: %s', $expectedEnc, $header['enc'] ?? ''));
54 54
         }
55 55
 
56
-        if (! \class_exists(JWELoader::class)) {
56
+        if (!\class_exists(JWELoader::class)) {
57 57
             throw new LogicException('In order to decrypt JWT you should install web-token/jwt-encryption package');
58 58
         }
59 59
 
Please login to merge, or discard this patch.