@@ -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 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | protected function getDigestFromApacheHeaders(?string $digest) |
| 203 | 203 | { |
| 204 | 204 | if (empty($digest) && function_exists('apache_request_headers')) { |
| 205 | - $headers = (array)apache_request_headers(); |
|
| 205 | + $headers = (array) apache_request_headers(); |
|
| 206 | 206 | if (!empty($headers['Authorization']) && strpos($headers['Authorization'], 'Digest ') === 0) { |
| 207 | 207 | $digest = substr($headers['Authorization'], 7); |
| 208 | 208 | } |
@@ -249,9 +249,9 @@ discard block |
||
| 249 | 249 | public function generateResponseHash(array $digest, string $password, string $method): string |
| 250 | 250 | { |
| 251 | 251 | return md5( |
| 252 | - $password . |
|
| 253 | - ':' . $digest['nonce'] . ':' . $digest['nc'] . ':' . $digest['cnonce'] . ':' . $digest['qop'] . ':' . |
|
| 254 | - md5($method . ':' . $digest['uri']) |
|
| 252 | + $password. |
|
| 253 | + ':'.$digest['nonce'].':'.$digest['nc'].':'.$digest['cnonce'].':'.$digest['qop'].':'. |
|
| 254 | + md5($method.':'.$digest['uri']) |
|
| 255 | 255 | ); |
| 256 | 256 | } |
| 257 | 257 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | public static function generatePasswordHash(string $username, string $password, string $realm): string |
| 267 | 267 | { |
| 268 | - return md5($username . ':' . $realm . ':' . $password); |
|
| 268 | + return md5($username.':'.$realm.':'.$password); |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | /** |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | $formattedOptions[] = $this->formatOptions($key, $value); |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - return ['WWW-Authenticate' => 'Digest ' . implode(',', $formattedOptions)]; |
|
| 318 | + return ['WWW-Authenticate' => 'Digest '.implode(',', $formattedOptions)]; |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
@@ -326,8 +326,8 @@ discard block |
||
| 326 | 326 | protected function generateNonce(): string |
| 327 | 327 | { |
| 328 | 328 | $expiryTime = microtime(true) + $this->nonceLifetime; |
| 329 | - $signatureValue = hash_hmac('sha1', $expiryTime . ':' . $this->secret, $this->secret); |
|
| 330 | - $nonceValue = $expiryTime . ':' . $signatureValue; |
|
| 329 | + $signatureValue = hash_hmac('sha1', $expiryTime.':'.$this->secret, $this->secret); |
|
| 330 | + $nonceValue = $expiryTime.':'.$signatureValue; |
|
| 331 | 331 | |
| 332 | 332 | return base64_encode($nonceValue); |
| 333 | 333 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | return false; |
| 354 | 354 | } |
| 355 | 355 | $secret = $this->secret; |
| 356 | - $check = hash_hmac('sha1', $expires . ':' . $secret, $secret); |
|
| 356 | + $check = hash_hmac('sha1', $expires.':'.$secret, $secret); |
|
| 357 | 357 | |
| 358 | 358 | return hash_equals($check, $checksum); |
| 359 | 359 | } |