GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — master ( 500279...2f8c13 )
by
unknown
02:35
created
src/autoload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
  * @param $className
17 17
  */
18 18
 spl_autoload_register(
19
-    function ($className) {
19
+    function($className) {
20 20
         if (strpos($className, 'O2System\Security\\') === false) {
21 21
             return;
22 22
         }
Please login to merge, or discard this patch.
src/Authentication/Http.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -188,20 +188,20 @@  discard block
 block discarded – undo
188 188
 
189 189
                 if ($authorization = input()->server('HTTP_AUTHORIZATION')) {
190 190
                     $authentication = unserialize(base64_decode($authorization));
191
-                    if ($this->login($authentication[ 'username' ], $authentication[ 'password' ])) {
191
+                    if ($this->login($authentication['username'], $authentication['password'])) {
192 192
                         return true;
193 193
                     }
194 194
                 } else {
195 195
                     $authentication = $this->parseBasic();
196 196
                 }
197 197
 
198
-                if ($this->login($authentication[ 'username' ], $authentication[ 'password' ])) {
198
+                if ($this->login($authentication['username'], $authentication['password'])) {
199 199
 
200 200
                     header('Authorization: Basic ' . base64_encode(serialize($authentication)));
201 201
 
202 202
                     return true;
203 203
                 } else {
204
-                    unset($_SERVER[ 'PHP_AUTH_USER' ], $_SERVER[ 'PHP_AUTH_PW' ]);
204
+                    unset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
205 205
                     $this->protect();
206 206
                 }
207 207
 
@@ -214,37 +214,37 @@  discard block
 block discarded – undo
214 214
                 }
215 215
 
216 216
                 if (isset($authentication) AND
217
-                    false !== ($password = $this->login($authentication[ 'username' ]))
217
+                    false !== ($password = $this->login($authentication['username']))
218 218
                 ) {
219
-                    $A1 = md5($authentication[ 'username' ] . ':' . $this->realm . ':' . $password);
220
-                    $A2 = md5($_SERVER[ 'REQUEST_METHOD' ] . ':' . $authentication[ 'uri' ]);
219
+                    $A1 = md5($authentication['username'] . ':' . $this->realm . ':' . $password);
220
+                    $A2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $authentication['uri']);
221 221
                     $response = md5(
222 222
                         $A1
223 223
                         . ':'
224
-                        . $authentication[ 'nonce' ]
224
+                        . $authentication['nonce']
225 225
                         . ':'
226
-                        . $authentication[ 'nc' ]
226
+                        . $authentication['nc']
227 227
                         . ':'
228
-                        . $authentication[ 'cnonce' ]
228
+                        . $authentication['cnonce']
229 229
                         . ':'
230
-                        . $authentication[ 'qop' ]
230
+                        . $authentication['qop']
231 231
                         . ':'
232 232
                         . $A2
233 233
                     );
234 234
 
235
-                    if ($authentication[ 'response' ] === $response) {
235
+                    if ($authentication['response'] === $response) {
236 236
                         header(
237 237
                             sprintf(
238 238
                                 'Authorization: Digest username="%s", realm="%s", nonce="%s", uri="%s", qop=%s, nc=%s, cnonce="%s", response="%s", opaque="%s"',
239
-                                $authentication[ 'username' ],
239
+                                $authentication['username'],
240 240
                                 $this->realm,
241
-                                $authentication[ 'nonce' ],
242
-                                $authentication[ 'uri' ],
243
-                                $authentication[ 'qop' ],
244
-                                $authentication[ 'nc' ],
245
-                                $authentication[ 'cnonce' ],
241
+                                $authentication['nonce'],
242
+                                $authentication['uri'],
243
+                                $authentication['qop'],
244
+                                $authentication['nc'],
245
+                                $authentication['cnonce'],
246 246
                                 $response,
247
-                                $authentication[ 'opaque' ]
247
+                                $authentication['opaque']
248 248
                             )
249 249
                         );
250 250
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                     }
253 253
                 }
254 254
 
255
-                unset($_SERVER[ 'PHP_AUTH_DIGEST' ], $_SERVER[ 'HTTP_AUTHORIZATION' ]);
255
+                unset($_SERVER['PHP_AUTH_DIGEST'], $_SERVER['HTTP_AUTHORIZATION']);
256 256
                 $this->protect();
257 257
 
258 258
                 break;
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
                         return call_user_func_array($this->validation, func_get_args());
284 284
                     } else {
285 285
                         if (array_key_exists($username, $this->users)) {
286
-                            if ($this->users[ $username ] === $password) {
286
+                            if ($this->users[$username] === $password) {
287 287
                                 return true;
288 288
                             }
289 289
                         }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                         return call_user_func_array($this->validation, func_get_args());
297 297
                     } else {
298 298
                         if (array_key_exists($username, $this->users)) {
299
-                            return $this->users[ $username ];
299
+                            return $this->users[$username];
300 300
                         }
301 301
                     }
302 302
                 }
@@ -373,14 +373,14 @@  discard block
 block discarded – undo
373 373
         foreach ($parts as $part) {
374 374
             $elements = explode('=', $part);
375 375
             $elements = array_map(
376
-                function ($element) {
376
+                function($element) {
377 377
                     return trim(str_replace('"', '', $element));
378 378
 
379 379
                 },
380 380
                 $elements
381 381
             );
382 382
 
383
-            $data[ $elements[ 0 ] ] = $elements[ 1 ];
383
+            $data[$elements[0]] = $elements[1];
384 384
         }
385 385
 
386 386
         return empty($data)
Please login to merge, or discard this patch.
src/Encryptions/Algorithm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,6 +67,6 @@
 block discarded – undo
67 67
      */
68 68
     public static function map($algorithm)
69 69
     {
70
-        return static::$supported[ $algorithm ];
70
+        return static::$supported[$algorithm];
71 71
     }
72 72
 }
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
src/Encryptions/Cookie.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 
60 60
         if (class_exists('\O2System\Framework', false) or class_exists('\O2System\Reactor', false)) {
61 61
             $this->options = config()->getItem('cookie')->getArrayCopy();
62
-            $this->options[ 'expire' ] = time() + $this->options[ 'lifetime' ];
63
-            unset($this->options[ 'lifetime' ]);
62
+            $this->options['expire'] = time() + $this->options['lifetime'];
63
+            unset($this->options['lifetime']);
64 64
         }
65 65
 
66
-        $this->options[ 'domain' ] = empty($this->options[ 'domain' ])
67
-            ? isset($_SERVER[ 'HTTP_HOST' ])
68
-                ? $_SERVER[ 'HTTP_HOST' ]
69
-                : $_SERVER[ 'SERVER_NAME' ]
70
-            : $this->options[ 'domain' ];
66
+        $this->options['domain'] = empty($this->options['domain'])
67
+            ? isset($_SERVER['HTTP_HOST'])
68
+                ? $_SERVER['HTTP_HOST']
69
+                : $_SERVER['SERVER_NAME']
70
+            : $this->options['domain'];
71 71
     }
72 72
 
73 73
     // ------------------------------------------------------------------------
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         foreach ($options as $key => $value) {
87 87
             if (array_key_exists($key, $this->options)) {
88
-                $this->options[ $key ] = $value;
88
+                $this->options[$key] = $value;
89 89
             }
90 90
         }
91 91
 
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
             ? serialize($value)
111 111
             : $value;
112 112
 
113
-        $name = isset($this->options[ 'prefix' ])
114
-            ? $this->options[ 'prefix' ] . $name
113
+        $name = isset($this->options['prefix'])
114
+            ? $this->options['prefix'] . $name
115 115
             : $name;
116 116
 
117 117
         $value = $this->crypt->encrypt($value);
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
         return setcookie(
120 120
             $name,
121 121
             $value,
122
-            $this->options[ 'expire' ],
123
-            $this->options[ 'path' ],
124
-            '.' . ltrim($this->options[ 'domain' ], '.'),
122
+            $this->options['expire'],
123
+            $this->options['path'],
124
+            '.' . ltrim($this->options['domain'], '.'),
125 125
             false,
126 126
             false
127 127
         );
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function decrypt($name)
142 142
     {
143
-        $name = isset($this->options[ 'prefix' ])
144
-            ? $this->options[ 'prefix' ] . $name
143
+        $name = isset($this->options['prefix'])
144
+            ? $this->options['prefix'] . $name
145 145
             : $name;
146 146
 
147 147
         if ($value = input()->cookie($name)) {
Please login to merge, or discard this patch.
src/Authentication/User.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
     {
64 64
         if (password_needs_rehash(
65 65
             $password,
66
-            $this->config[ 'password' ][ 'algorithm' ],
67
-            $this->config[ 'password' ][ 'options' ]
66
+            $this->config['password']['algorithm'],
67
+            $this->config['password']['options']
68 68
         )) {
69 69
             return $this->passwordHash($password);
70 70
         }
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
     {
77 77
         return password_hash(
78 78
             $password,
79
-            $this->config[ 'password' ][ 'algorithm' ],
80
-            $this->config[ 'password' ][ 'options' ]
79
+            $this->config['password']['algorithm'],
80
+            $this->config['password']['options']
81 81
         );
82 82
     }
83 83
 
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function attempt()
90 90
     {
91
-        $_SESSION[ 'userAttempts' ] = $this->getAttempts() + 1;
91
+        $_SESSION['userAttempts'] = $this->getAttempts() + 1;
92 92
     }
93 93
 
94 94
     public function getAttempts()
95 95
     {
96 96
         $currentAttempts = 0;
97
-        if (isset($_SESSION[ 'userAttempts' ])) {
98
-            $currentAttempts = (int)$_SESSION[ 'userAttempts' ];
97
+        if (isset($_SESSION['userAttempts'])) {
98
+            $currentAttempts = (int)$_SESSION['userAttempts'];
99 99
         }
100 100
 
101 101
         return (int)$currentAttempts;
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 
104 104
     public function login(array $account)
105 105
     {
106
-        $_SESSION[ 'account' ] = $account;
107
-        unset($_SESSION[ 'userAttempts' ]);
106
+        $_SESSION['account'] = $account;
107
+        unset($_SESSION['userAttempts']);
108 108
     }
109 109
 
110 110
     public function signOn(array $account)
@@ -132,12 +132,12 @@  discard block
 block discarded – undo
132 132
 
133 133
     public function loggedIn()
134 134
     {
135
-        if (isset($_SESSION[ 'account' ])) {
135
+        if (isset($_SESSION['account'])) {
136 136
             return true;
137 137
         } elseif ($this->signedOn()) {
138 138
             $cacheItemPool = $this->getCacheItemPool();
139 139
             $item = $cacheItemPool->getItem('sso-' . input()->cookie('ssid'));
140
-            $_SESSION[ 'account' ] = $item->get();
140
+            $_SESSION['account'] = $item->get();
141 141
 
142 142
             return true;
143 143
         }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     public function logout()
160 160
     {
161 161
         $this->signOff();
162
-        unset($_SESSION[ 'account' ]);
162
+        unset($_SESSION['account']);
163 163
     }
164 164
 
165 165
     public function signOff()
Please login to merge, or discard this patch.
src/Authentication/Oauth/Consumer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
         $tokenParts = array_map('trim', $tokenParts);
120 120
 
121 121
         return [
122
-            'oauth_consumer_key'    => $tokenParts[ 1 ],
123
-            'oauth_consumer_secret' => $tokenParts[ 0 ],
122
+            'oauth_consumer_key'    => $tokenParts[1],
123
+            'oauth_consumer_secret' => $tokenParts[0],
124 124
         ];
125 125
     }
126 126
 
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
             'oauth_consumer_key'     => $this->key,
202 202
         ];
203 203
 
204
-        $parameters[ 'oauth_signature' ] = $oauth->generateSignature($httpMethod, $callbackUrl, $parameters);
205
-        $parameters[ 'oauth_version' ] = $this->version;
204
+        $parameters['oauth_signature'] = $oauth->generateSignature($httpMethod, $callbackUrl, $parameters);
205
+        $parameters['oauth_version'] = $this->version;
206 206
 
207 207
         $parts = [];
208 208
         foreach ($parameters as $key => $value) {
Please login to merge, or discard this patch.
src/Authentication/Oauth/Client/Credential.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
      */
32 32
     public function getSecretCode(Oauth\Client\Account $client, array $options = [])
33 33
     {
34
-        $scope = $this->config[ 'scope' ];
35
-        if (isset($options[ 'scope' ])) {
36
-            if (is_array($options[ 'scope' ])) {
37
-                $scope = array_merge($scope, $options[ 'scope' ]);
34
+        $scope = $this->config['scope'];
35
+        if (isset($options['scope'])) {
36
+            if (is_array($options['scope'])) {
37
+                $scope = array_merge($scope, $options['scope']);
38 38
             }
39 39
         }
40 40
 
Please login to merge, or discard this patch.
src/Authentication/Oauth/User/Authorization.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -107,19 +107,19 @@  discard block
 block discarded – undo
107 107
             $privateKey = $client->offsetGet('private_key');
108 108
         }
109 109
 
110
-        $scope = $this->config[ 'token' ][ 'scope' ];
111
-        if (isset($options[ 'scope' ])) {
112
-            if (is_array($options[ 'scope' ])) {
113
-                $scope = array_merge($scope, $options[ 'scope' ]);
110
+        $scope = $this->config['token']['scope'];
111
+        if (isset($options['scope'])) {
112
+            if (is_array($options['scope'])) {
113
+                $scope = array_merge($scope, $options['scope']);
114 114
             }
115 115
         }
116 116
 
117
-        if (isset($options[ 'lifetime' ])) {
118
-            $this->config[ 'token' ][ 'lifetime' ] = $options[ 'lifetime' ];
117
+        if (isset($options['lifetime'])) {
118
+            $this->config['token']['lifetime'] = $options['lifetime'];
119 119
         }
120 120
 
121
-        if (isset($options[ 'refresh_lifetime' ])) {
122
-            $this->config[ 'token' ][ 'refresh_lifetime' ] = $options[ 'refresh_lifetime' ];
121
+        if (isset($options['refresh_lifetime'])) {
122
+            $this->config['token']['refresh_lifetime'] = $options['refresh_lifetime'];
123 123
         }
124 124
 
125 125
         $payload = $this->createPayload($client, $scope);
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 
130 130
         return [
131 131
             "access_token" => $accessToken,
132
-            "expires_in"   => $this->config[ 'token' ][ 'lifetime' ],
133
-            "token_type"   => $this->config[ 'token' ][ 'type' ],
134
-            "scope"        => $payload[ 'scope' ],
132
+            "expires_in"   => $this->config['token']['lifetime'],
133
+            "token_type"   => $this->config['token']['type'],
134
+            "scope"        => $payload['scope'],
135 135
         ];
136 136
     }
137 137
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     protected function createPayload(Oauth\Client\Account $client, array $scope = [])
150 150
     {
151 151
         // token to encrypt
152
-        $expires = time() + $this->config[ 'token' ][ 'lifetime' ];
152
+        $expires = time() + $this->config['token']['lifetime'];
153 153
 
154 154
         $id = Token::generate(40, Token::ALPHAHASH_STRING);
155 155
         $payload = [
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             // the internal id of the token
158 158
             'jti'        => $id,
159 159
             // a unique token identifier for the token (JWT ID)
160
-            'iss'        => $this->config[ 'issuer' ],
160
+            'iss'        => $this->config['issuer'],
161 161
             // the id of the server who issued the token (Issuer)
162 162
             'aud'        => $client->id,
163 163
             // the id of the client who requested the token (Audience)
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             // the id of the user for which the token was released (Subject)
166 166
             'exp'        => $expires,
167 167
             'iat'        => time(),
168
-            'token_type' => $this->config[ 'token' ][ 'type' ],
168
+            'token_type' => $this->config['token']['type'],
169 169
             'scope'      => empty($scope) ? null : implode(' ', $scope),
170 170
         ];
171 171
 
Please login to merge, or discard this patch.
src/Authentication/Oauth/Provider.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -91,51 +91,51 @@  discard block
 block discarded – undo
91 91
             $httpAuthorization = explode(' ', $httpAuthorization);
92 92
             $httpAuthorization = array_map('trim', $httpAuthorization);
93 93
 
94
-            switch (strtoupper($httpAuthorization[ 0 ])) {
94
+            switch (strtoupper($httpAuthorization[0])) {
95 95
                 default:
96 96
                 case 'OAUTH':
97 97
                     array_shift($httpAuthorization);
98
-                    $httpAuthorization = array_map(function ($string) {
98
+                    $httpAuthorization = array_map(function($string) {
99 99
                         $string = str_replace(['"', ','], '', $string);
100 100
                         $string = explode('=', $string);
101 101
 
102 102
                         return [
103
-                            'key'   => str_replace('oauth_', '', $string[ 0 ]),
104
-                            'value' => $string[ 1 ],
103
+                            'key'   => str_replace('oauth_', '', $string[0]),
104
+                            'value' => $string[1],
105 105
                         ];
106 106
                     }, $httpAuthorization);
107 107
 
108 108
                     $oauthParams = [];
109 109
                     foreach ($httpAuthorization as $param) {
110
-                        $oauthParams[ $param[ 'key' ] ] = $param[ 'value' ];
110
+                        $oauthParams[$param['key']] = $param['value'];
111 111
                     }
112 112
 
113
-                    $this->oauth->signature_method = $oauthParams[ 'signature_method' ];
114
-                    $this->oauth->nonce = $oauthParams[ 'nonce' ];
115
-                    $this->oauth->timestamp = $oauthParams[ 'timestamp' ];
116
-                    $this->oauth->consumer_key = $oauthParams[ 'consumer_key' ];
117
-                    $this->oauth->version = $oauthParams[ 'version' ];
113
+                    $this->oauth->signature_method = $oauthParams['signature_method'];
114
+                    $this->oauth->nonce = $oauthParams['nonce'];
115
+                    $this->oauth->timestamp = $oauthParams['timestamp'];
116
+                    $this->oauth->consumer_key = $oauthParams['consumer_key'];
117
+                    $this->oauth->version = $oauthParams['version'];
118 118
 
119
-                    if (isset($oauthParams[ 'callback' ])) {
120
-                        $this->oauth->callback = urldecode($oauthParams[ 'callback' ]);
119
+                    if (isset($oauthParams['callback'])) {
120
+                        $this->oauth->callback = urldecode($oauthParams['callback']);
121 121
                     }
122 122
 
123
-                    if (isset($oauthParams[ 'signature' ])) {
124
-                        $this->oauth->signature = $oauthParams[ 'signature' ];
123
+                    if (isset($oauthParams['signature'])) {
124
+                        $this->oauth->signature = $oauthParams['signature'];
125 125
                     }
126 126
 
127 127
                     $this->oauth->callconsumerHandler();
128 128
                     break;
129 129
                 case 'BASIC':
130 130
                 case 'BEARER':
131
-                    $this->oauth->bearer = $httpAuthorization[ 1 ];
131
+                    $this->oauth->bearer = $httpAuthorization[1];
132 132
                     $bearer = base64_decode($this->oauth->bearer);
133 133
                     $bearer = explode(':', $bearer);
134 134
                     $bearer = array_map('trim', $bearer);
135 135
 
136 136
                     if (count($bearer) == 2) {
137
-                        $this->oauth->consumer_key = $bearer[ 0 ];
138
-                        $this->oauth->consumer_secret = $bearer[ 1 ];
137
+                        $this->oauth->consumer_key = $bearer[0];
138
+                        $this->oauth->consumer_secret = $bearer[1];
139 139
 
140 140
                         $this->oauth->callconsumerHandler();
141 141
                     }
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
             $verifier = array_map('trim', $verifier);
150 150
 
151 151
             if (count($verifier) == 2) {
152
-                $this->oauth->token = $verifier[ 0 ];
153
-                $this->oauth->token_secret = $verifier[ 1 ];
152
+                $this->oauth->token = $verifier[0];
153
+                $this->oauth->token_secret = $verifier[1];
154 154
             }
155 155
         }
156 156
 
@@ -195,16 +195,16 @@  discard block
 block discarded – undo
195 195
         if ( ! empty($this->token)) {
196 196
             if ($this->model->insertTokenNonce([
197 197
                 'id_consumer_token' => $this->token->id,
198
-                'nonce'             => $token[ 'nonce' ] = Oauth::generateNonce(),
199
-                'timestamp'         => $token[ 'timestamp' ] = date('Y-m-d H:m:s'),
200
-                'expires'           => $token[ 'expires' ] = time() + 3600,
198
+                'nonce'             => $token['nonce'] = Oauth::generateNonce(),
199
+                'timestamp'         => $token['timestamp'] = date('Y-m-d H:m:s'),
200
+                'expires'           => $token['expires'] = time() + 3600,
201 201
             ])) {
202 202
                 return new DataStructures\Token([
203 203
                     'key'       => $this->token->key,
204 204
                     'secret'    => $this->token->secret,
205
-                    'nonce'     => $token[ 'nonce' ],
206
-                    'timestamp' => $token[ 'timestamp' ],
207
-                    'expires'   => $token[ 'expires' ],
205
+                    'nonce'     => $token['nonce'],
206
+                    'timestamp' => $token['timestamp'],
207
+                    'expires'   => $token['expires'],
208 208
                     'verifier'  => (new Token($this->token->key, $this->token->secret))->getVerifier(),
209 209
                 ]);
210 210
             }
@@ -212,17 +212,17 @@  discard block
 block discarded – undo
212 212
 
213 213
         $token = $this->generateToken('ACCESS');
214 214
         $token = new DataStructures\Token([
215
-            'id'       => $token[ 'id' ],
216
-            'key'      => $token[ 'key' ],
217
-            'secret'   => $token[ 'secret' ],
218
-            'verifier' => (new Token($token[ 'key' ], $token[ 'secret' ]))->getVerifier(),
215
+            'id'       => $token['id'],
216
+            'key'      => $token['key'],
217
+            'secret'   => $token['secret'],
218
+            'verifier' => (new Token($token['key'], $token['secret']))->getVerifier(),
219 219
         ]);
220 220
 
221 221
         if ($this->model->insertTokenNonce([
222
-            'id_consumer_token' => $token[ 'id' ],
223
-            'nonce'             => $token[ 'nonce' ] = Oauth::generateNonce(),
224
-            'timestamp'         => $token[ 'timestamp' ] = date('Y-m-d H:m:s'),
225
-            'expires'           => $token[ 'expires' ] = time() + 3600,
222
+            'id_consumer_token' => $token['id'],
223
+            'nonce'             => $token['nonce'] = Oauth::generateNonce(),
224
+            'timestamp'         => $token['timestamp'] = date('Y-m-d H:m:s'),
225
+            'expires'           => $token['expires'] = time() + 3600,
226 226
         ])) {
227 227
             return $token;
228 228
         }
@@ -279,15 +279,15 @@  discard block
 block discarded – undo
279 279
 
280 280
             if ($this->model->insertToken([
281 281
                 'id_consumer' => $this->consumer->id,
282
-                'key'         => $token[ 'key' ],
283
-                'secret'      => $token[ 'secret' ],
282
+                'key'         => $token['key'],
283
+                'secret'      => $token['secret'],
284 284
                 'type'        => $type,
285 285
                 'callback'    => $callback,
286 286
             ])) {
287
-                $token[ 'id' ] = $this->model->db->getLastInsertId();
287
+                $token['id'] = $this->model->db->getLastInsertId();
288 288
 
289 289
                 if ($this->model->insertTokenNonce([
290
-                    'id_consumer_token' => $token[ 'id' ],
290
+                    'id_consumer_token' => $token['id'],
291 291
                     'nonce'             => $nonce,
292 292
                     'timestamp'         => date('Y-m-d H:m:s'),
293 293
                     'expires'           => time() + 3600,
Please login to merge, or discard this patch.