Passed
Push — master ( a8d522...c97e91 )
by Alexandre
02:40
created
src/OAuth2OLD/OpenID/ResponseTypes/CodeResponseType.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      * @throws OAuthException
42 42
      */
43 43
     public function handle(ServerRequestInterface $request, ResourceOwnerInterface $resourceOwner,
44
-                           RegisteredClient $client, ?array $scope = null, ?array $extendedResponseTypes = null): array
44
+                            RegisteredClient $client, ?array $scope = null, ?array $extendedResponseTypes = null): array
45 45
     {
46 46
         $data = $request->getMethod() === 'GET' ? $request->getQueryParams() : $request->getParsedBody();
47 47
 
Please login to merge, or discard this patch.
src/OAuth2OLD/OpenID/Endpoints/AuthorizationEndpoint.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
 
108 108
         // todo, repository for response mode
109 109
         // https://developer.okta.com/docs/api/resources/oidc#parameter-details
110
-       /*
110
+        /*
111 111
         if (isset($data['response_mode']) && $data['response_mode'] == 'post_message') {
112 112
             return $this->popupResponse(['access_token' => 'a'], $redirectUri);
113 113
         } else {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         /**
39 39
          * @var RegisteredClient $client
40 40
          */
41
-        if($res = $this->verify($request, $result)) {
41
+        if ($res = $this->verify($request, $result)) {
42 42
             return $res;
43 43
         }
44 44
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $result = [];
57 57
 
58 58
         try {
59
-            if(!$resourceOwner->isConsentGivenForClient($client)) {
59
+            if (!$resourceOwner->isConsentGivenForClient($client)) {
60 60
                 throw new OAuthException('access_denied',
61 61
                     'The resource owner server denied the request',
62 62
                     'https://tools.ietf.org/html/rfc6749#section-4.1.1');
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
              * @var ResponseTypeInterface $responseType
69 69
              */
70 70
             foreach ($responseTypes as $responseType) {
71
-                if($responseType->getExtendedResponseTypes()) {
71
+                if ($responseType->getExtendedResponseTypes()) {
72 72
                     $extendedResponseTypes = array_merge($extendedResponseTypes, $responseType->getExtendedResponseTypes());
73 73
                 }
74 74
                 $responseTypeNames[] = $responseType->getResponseType();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
              * @var ResponseTypeInterface $responseType
79 79
              */
80 80
             foreach ($responseTypes as $responseType) {
81
-                if(!in_array($responseType->getResponseType(), $extendedResponseTypes)) {
81
+                if (!in_array($responseType->getResponseType(), $extendedResponseTypes)) {
82 82
                     $extendedResponseTypes = null;
83 83
                     if ($responseType->getExtendedResponseTypes()) {
84 84
                         $extendedResponseTypeNames = array_intersect($responseType->getExtendedResponseTypes(), array_keys($responseTypes));
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 $data['state'] ?? null);
99 99
         }
100 100
 
101
-        if(isset($data['state'])) {
101
+        if (isset($data['state'])) {
102 102
             $result['state'] = $data['state'];
103 103
         }
104 104
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         if (!$scopePolicyManager->checkScope($client, $scope)) {
259 259
             $supportedScopes = implode(', ', $scopePolicyManager->getSupportedScopes($client));
260 260
             throw new OAuthException('invalid_scope',
261
-                'Some of requested scopes are not supported. Scope supported : ' . $supportedScopes,
261
+                'Some of requested scopes are not supported. Scope supported : '.$supportedScopes,
262 262
                 'https://tools.ietf.org/html/rfc6749#section-4.1');
263 263
         }
264 264
 
@@ -417,12 +417,12 @@  discard block
 block discarded – undo
417 417
             $responseType = $this->server->getResponseTypeRepository()->getResponseType($responseTypeName);
418 418
             if (!$responseType) {
419 419
                 throw new OAuthException('invalid_request',
420
-                    'Unknown response_type : ' . $responseTypeName);
420
+                    'Unknown response_type : '.$responseTypeName);
421 421
             }
422 422
 
423 423
             if (!$responseType->isMultiValuedResponseTypeSupported()) {
424 424
                 throw new OAuthException('invalid_request',
425
-                    'Multi-valued response_type not supported with response_type : ' . $responseTypeName);
425
+                    'Multi-valued response_type not supported with response_type : '.$responseTypeName);
426 426
             }
427 427
 
428 428
             $responseTypes[$responseTypeName] = $responseType;
Please login to merge, or discard this patch.
src/OAuth2OLD/OpenID/encours/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         $certsRepository = $this->sqlOauth->getRepository(Cert::class);
47 47
 
48 48
         $actualCerts = $certsRepository->findBy([], ['createdAt' => 'DESC'], 2);
49
-        if(!isset($actualCerts[0])) {
49
+        if (!isset($actualCerts[0])) {
50 50
             list('privKey' => $privKey, 'pubKey' => $pubKey, 'rsa' => $rsa) = $this->generateRSAKeys();
51 51
 
52 52
             $oldCert = new Cert();
Please login to merge, or discard this patch.
src/OAuth2OLD/OpenID/Credentials/IdToken.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
     {
31 31
         $missingClaims = array_diff(self::REQUIRED_CLAIMS, array_keys($claims));
32 32
         if (!empty($missingClaims)) {
33
-            throw new \Exception('Missing claims : ' . implode(', ', $missingClaims));
33
+            throw new \Exception('Missing claims : '.implode(', ', $missingClaims));
34 34
         }
35 35
 
36 36
         $undefinedClaims = array_diff(array_keys($claims), self::DEFINED_CLAIMS);
37 37
         if (!empty($undefinedClaims)) {
38
-            throw new \Exception('Undefined claims : ' . implode(', ', $undefinedClaims));
38
+            throw new \Exception('Undefined claims : '.implode(', ', $undefinedClaims));
39 39
         }
40 40
 
41 41
         // todo check nonce required if present in authentication request
Please login to merge, or discard this patch.
src/OAuth2OLD/OpenID/Models/StandardClaims.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -445,7 +445,7 @@
 block discarded – undo
445 445
     {
446 446
         $getter = 'get'.ucfirst($this->snakeToCamel($offset));
447 447
         $result = $this->{$getter}();
448
-        if(is_object($result)) {
448
+        if (is_object($result)) {
449 449
             return json_encode($result);
450 450
         }
451 451
         return $result;
Please login to merge, or discard this patch.
src/OAuth2OLD/OpenID/Models/AddressClaim.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -142,22 +142,22 @@
 block discarded – undo
142 142
     function jsonSerialize()
143 143
     {
144 144
         $data = [];
145
-        if($this->formatted) {
145
+        if ($this->formatted) {
146 146
             $data['formatted'] = $this->formatted;
147 147
         }
148
-        if($this->streetAddress) {
148
+        if ($this->streetAddress) {
149 149
             $data['street_address'] = $this->streetAddress;
150 150
         }
151
-        if($this->locality) {
151
+        if ($this->locality) {
152 152
             $data['locality'] = $this->locality;
153 153
         }
154
-        if($this->region) {
154
+        if ($this->region) {
155 155
             $data['region'] = $this->region;
156 156
         }
157
-        if($this->postalCode) {
157
+        if ($this->postalCode) {
158 158
             $data['postal_code'] = $this->postalCode;
159 159
         }
160
-        if($this->country) {
160
+        if ($this->country) {
161 161
             $data['country'] = $this->country;
162 162
         }
163 163
         return empty($data) ? '' : json_encode($data);
Please login to merge, or discard this patch.
src/OAuth2OLD/Repositories/GrantTypeRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
         $clientCredentialsGrantType = new ClientCredentialsGrantType($scopePolicyManager, $accessTokenStorage);
76 76
         $resourceOwnerPasswordCredentialsGrantType = new ResourceOwnerPasswordCredentialsGrantType(
77 77
             $resourceOwnerProvider, $scopePolicyManager, $accessTokenStorage, $refreshTokenStorage);
78
-        $refreshTokenGrantType = new RefreshTokenGrantType($configurationRepository , $scopePolicyManager, $accessTokenStorage, $refreshTokenStorage);
78
+        $refreshTokenGrantType = new RefreshTokenGrantType($configurationRepository, $scopePolicyManager, $accessTokenStorage, $refreshTokenStorage);
79 79
         return [
80 80
             $authorizationCodeGrantType->getUri() => $authorizationCodeGrantType,
81 81
             $clientCredentialsGrantType->getUri() => $clientCredentialsGrantType,
Please login to merge, or discard this patch.
src/OAuth2OLD/Repositories/ConfigurationRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function __construct(array $config = [])
41 41
     {
42 42
         if (array_diff(self::MINIMAL_CONFIG, array_keys($config))) {
43
-            throw new \Exception('Missing minimal configuration. Required : ' . implode(', ', self::MINIMAL_CONFIG));
43
+            throw new \Exception('Missing minimal configuration. Required : '.implode(', ', self::MINIMAL_CONFIG));
44 44
         }
45 45
 
46 46
         $this->config = array_merge(self::DEFAULT_CONFIG, $config);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @throws \Exception
53 53
      */
54 54
     public function getConfig(string $name) {
55
-        if(!array_key_exists($name, $this->config)) {
55
+        if (!array_key_exists($name, $this->config)) {
56 56
             throw new \Exception("Unknown config '$name' in ".implode(', ', array_keys($this->config)));
57 57
         }
58 58
         return $this->config[$name];
Please login to merge, or discard this patch.
src/OAuth2OLD/Repositories/StorageRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
     public function __construct(array $storages)
35 35
     {
36 36
         foreach (static::STORAGES_INTERFACES as $name => $interface) {
37
-            if(!isset($storages[$name])) {
37
+            if (!isset($storages[$name])) {
38 38
                 throw new \Exception("Missing storage '$name'");
39 39
             }
40
-            if(!is_a($storages[$name], $interface)) {
40
+            if (!is_a($storages[$name], $interface)) {
41 41
                 throw new \Exception("Storage '$name' must implement '$interface'");
42 42
             }
43 43
             $this->storages[$name] = $storages[$name];
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @throws \Exception
51 51
      */
52 52
     public function getStorage(string $name) {
53
-        if(!isset($this->storages[$name])) {
53
+        if (!isset($this->storages[$name])) {
54 54
             throw new \Exception("Unknown storage '$name'");
55 55
         }
56 56
         return $this->storages[$name];
Please login to merge, or discard this patch.