@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $usernameField = $this->credentialFields[IdentifierInterface::CREDENTIAL_USERNAME]; |
| 162 | 162 | $passwordField = $this->credentialFields[IdentifierInterface::CREDENTIAL_PASSWORD]; |
| 163 | 163 | |
| 164 | - return $data[$usernameField] . $data[$passwordField]; |
|
| 164 | + return $data[$usernameField].$data[$passwordField]; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | $usernameField = $this->credentialFields[IdentifierInterface::CREDENTIAL_USERNAME]; |
| 181 | 181 | |
| 182 | - return (string)json_encode([$data[$usernameField], $hash], JSON_THROW_ON_ERROR); |
|
| 182 | + return (string) json_encode([$data[$usernameField], $hash], JSON_THROW_ON_ERROR); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | protected function getDigestFromApacheHeaders(?string $digest) |
| 202 | 202 | { |
| 203 | 203 | if (empty($digest) && function_exists('apache_request_headers')) { |
| 204 | - $headers = (array)apache_request_headers(); |
|
| 204 | + $headers = (array) apache_request_headers(); |
|
| 205 | 205 | if (!empty($headers['Authorization']) && strpos($headers['Authorization'], 'Digest ') === 0) { |
| 206 | 206 | $digest = substr($headers['Authorization'], 7); |
| 207 | 207 | } |
@@ -248,9 +248,9 @@ discard block |
||
| 248 | 248 | public function generateResponseHash(array $digest, string $password, string $method): string |
| 249 | 249 | { |
| 250 | 250 | return md5( |
| 251 | - $password . |
|
| 252 | - ':' . $digest['nonce'] . ':' . $digest['nc'] . ':' . $digest['cnonce'] . ':' . $digest['qop'] . ':' . |
|
| 253 | - md5($method . ':' . $digest['uri']) |
|
| 251 | + $password. |
|
| 252 | + ':'.$digest['nonce'].':'.$digest['nc'].':'.$digest['cnonce'].':'.$digest['qop'].':'. |
|
| 253 | + md5($method.':'.$digest['uri']) |
|
| 254 | 254 | ); |
| 255 | 255 | } |
| 256 | 256 | |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | */ |
| 265 | 265 | public static function generatePasswordHash(string $username, string $password, string $realm): string |
| 266 | 266 | { |
| 267 | - return md5($username . ':' . $realm . ':' . $password); |
|
| 267 | + return md5($username.':'.$realm.':'.$password); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | - return ['WWW-Authenticate' => 'Digest ' . implode(',', $opts)]; |
|
| 303 | + return ['WWW-Authenticate' => 'Digest '.implode(',', $opts)]; |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /** |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | protected function generateNonce(): string |
| 312 | 312 | { |
| 313 | 313 | $expiryTime = microtime(true) + $this->nonceLifetime; |
| 314 | - $signatureValue = hash_hmac('sha1', $expiryTime . ':' . $this->secret, $this->secret); |
|
| 315 | - $nonceValue = $expiryTime . ':' . $signatureValue; |
|
| 314 | + $signatureValue = hash_hmac('sha1', $expiryTime.':'.$this->secret, $this->secret); |
|
| 315 | + $nonceValue = $expiryTime.':'.$signatureValue; |
|
| 316 | 316 | |
| 317 | 317 | return base64_encode($nonceValue); |
| 318 | 318 | } |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | return false; |
| 339 | 339 | } |
| 340 | 340 | $secret = $this->secret; |
| 341 | - $check = hash_hmac('sha1', $expires . ':' . $secret, $secret); |
|
| 341 | + $check = hash_hmac('sha1', $expires.':'.$secret, $secret); |
|
| 342 | 342 | |
| 343 | 343 | return hash_equals($check, $checksum); |
| 344 | 344 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $error = $this->pdo->errorInfo(); |
| 61 | 61 | if ($error[0] !== '00000') { |
| 62 | - throw new PDOException($error[2], (int)$error[0]); |
|
| 62 | + throw new PDOException($error[2], (int) $error[0]); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | if (!$statement instanceof PDOStatement) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | foreach ($conditions as $key => $value) { |
| 81 | 81 | unset($conditions[$key]); |
| 82 | - $conditions[':' . $key] = $value; |
|
| 82 | + $conditions[':'.$key] = $value; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $statement = $this->buildStatement(); |
@@ -9,16 +9,16 @@ discard block |
||
| 9 | 9 | $phiveUrl = 'https://phar.io/releases/phive.phar'; |
| 10 | 10 | $phiveKeyUrl = 'https://phar.io/releases/phive.phar.asc'; |
| 11 | 11 | |
| 12 | -if (!file_exists('.' . $ds . 'phive.phar')) { |
|
| 13 | - echo 'Downloading Phive (' . $phiveUrl . ')...' . PHP_EOL; |
|
| 14 | - file_put_contents('.' . $ds . 'phive.phar', file_get_contents( |
|
| 12 | +if (!file_exists('.'.$ds.'phive.phar')) { |
|
| 13 | + echo 'Downloading Phive ('.$phiveUrl.')...'.PHP_EOL; |
|
| 14 | + file_put_contents('.'.$ds.'phive.phar', file_get_contents( |
|
| 15 | 15 | $phiveUrl |
| 16 | 16 | )); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -if (!file_exists('.' . $ds . 'phive.phar.asc')) { |
|
| 20 | - echo 'Downloading Phive Key (' . $phiveKeyUrl . ')...' . PHP_EOL; |
|
| 21 | - file_put_contents('.' . $ds . 'phive.phar.asc', file_get_contents( |
|
| 19 | +if (!file_exists('.'.$ds.'phive.phar.asc')) { |
|
| 20 | + echo 'Downloading Phive Key ('.$phiveKeyUrl.')...'.PHP_EOL; |
|
| 21 | + file_put_contents('.'.$ds.'phive.phar.asc', file_get_contents( |
|
| 22 | 22 | $phiveUrl |
| 23 | 23 | )); |
| 24 | 24 | } else { |
@@ -41,5 +41,5 @@ discard block |
||
| 41 | 41 | $keys = implode(',', $keys); |
| 42 | 42 | |
| 43 | 43 | $output = ''; |
| 44 | -exec('php .' . $ds . 'phive.phar install --target ./bin --trust-gpg-keys ' . $keys . ' --force-accept-unsigned', $output); |
|
| 44 | +exec('php .'.$ds.'phive.phar install --target ./bin --trust-gpg-keys '.$keys.' --force-accept-unsigned', $output); |
|
| 45 | 45 | echo implode(PHP_EOL, $output); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | return new Result(null, Result::FAILURE_CREDENTIALS_INVALID); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - $result = json_decode((string)json_encode($result), true); |
|
| 158 | + $result = json_decode((string) json_encode($result), true); |
|
| 159 | 159 | |
| 160 | 160 | $key = IdentifierInterface::CREDENTIAL_JWT_SUBJECT; |
| 161 | 161 | if (empty($result[$key])) { |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | { |
| 214 | 214 | return JWT::decode( |
| 215 | 215 | $token, |
| 216 | - new Key((string)$this->secretKey, $this->algorithms[0]) |
|
| 216 | + new Key((string) $this->secretKey, $this->algorithms[0]) |
|
| 217 | 217 | ); |
| 218 | 218 | } |
| 219 | 219 | } |