@@ -115,7 +115,7 @@ |
||
115 | 115 | */ |
116 | 116 | protected function stripTokenPrefix(string $token, string $prefix): string |
117 | 117 | { |
118 | - return str_ireplace($prefix . ' ', '', $token); |
|
118 | + return str_ireplace($prefix.' ', '', $token); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -233,9 +233,9 @@ discard block |
||
233 | 233 | public function generateResponseHash($digest, $password, $method): string |
234 | 234 | { |
235 | 235 | return md5( |
236 | - $password . |
|
237 | - ':' . $digest['nonce'] . ':' . $digest['nc'] . ':' . $digest['cnonce'] . ':' . $digest['qop'] . ':' . |
|
238 | - md5($method . ':' . $digest['uri']) |
|
236 | + $password. |
|
237 | + ':'.$digest['nonce'].':'.$digest['nc'].':'.$digest['cnonce'].':'.$digest['qop'].':'. |
|
238 | + md5($method.':'.$digest['uri']) |
|
239 | 239 | ); |
240 | 240 | } |
241 | 241 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | public static function generatePasswordHash(string $username, string $password, string $realm): string |
251 | 251 | { |
252 | - return md5($username . ':' . $realm . ':' . $password); |
|
252 | + return md5($username.':'.$realm.':'.$password); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | } |
287 | 287 | |
288 | - return ['WWW-Authenticate' => 'Digest ' . implode(',', $opts)]; |
|
288 | + return ['WWW-Authenticate' => 'Digest '.implode(',', $opts)]; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -296,8 +296,8 @@ discard block |
||
296 | 296 | protected function generateNonce(): string |
297 | 297 | { |
298 | 298 | $expiryTime = microtime(true) + $this->nonceLifetime; |
299 | - $signatureValue = hash_hmac('sha1', $expiryTime . ':' . $this->secret, $this->secret); |
|
300 | - $nonceValue = $expiryTime . ':' . $signatureValue; |
|
299 | + $signatureValue = hash_hmac('sha1', $expiryTime.':'.$this->secret, $this->secret); |
|
300 | + $nonceValue = $expiryTime.':'.$signatureValue; |
|
301 | 301 | |
302 | 302 | return base64_encode($nonceValue); |
303 | 303 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | return false; |
324 | 324 | } |
325 | 325 | $secret = $this->secret; |
326 | - $check = hash_hmac('sha1', $expires . ':' . $secret, $secret); |
|
326 | + $check = hash_hmac('sha1', $expires.':'.$secret, $secret); |
|
327 | 327 | |
328 | 328 | return hash_equals($check, $checksum); |
329 | 329 | } |
@@ -170,7 +170,7 @@ |
||
170 | 170 | { |
171 | 171 | set_error_handler( |
172 | 172 | function ($errorNumber, $errorText) { |
173 | - throw new ErrorException($errorText); |
|
173 | + throw new ErrorException($errorText); |
|
174 | 174 | }, |
175 | 175 | E_ALL |
176 | 176 | ); |
@@ -169,7 +169,7 @@ |
||
169 | 169 | protected function setErrorHandler() |
170 | 170 | { |
171 | 171 | set_error_handler( |
172 | - function ($errorNumber, $errorText) { |
|
172 | + function($errorNumber, $errorText) { |
|
173 | 173 | throw new ErrorException($errorText); |
174 | 174 | }, |
175 | 175 | E_ALL |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | $hasher = $this->passwordHasher; |
157 | 157 | $hashedPassword = $data[$passwordField]; |
158 | - if (!$hasher->check((string)$password, $hashedPassword)) { |
|
158 | + if (!$hasher->check((string) $password, $hashedPassword)) { |
|
159 | 159 | return false; |
160 | 160 | } |
161 | 161 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | { |
185 | 185 | $fields = $this->credentialFields[self::CREDENTIAL_USERNAME]; |
186 | 186 | |
187 | - foreach ((array)$fields as $field) { |
|
187 | + foreach ((array) $fields as $field) { |
|
188 | 188 | $conditions = [ |
189 | 189 | $field => $identifier, |
190 | 190 | ]; |
@@ -61,7 +61,7 @@ |
||
61 | 61 | protected function getUrlFromRequest(UriInterface $uri): string |
62 | 62 | { |
63 | 63 | if ($this->checkFullUrl) { |
64 | - return (string)$uri; |
|
64 | + return (string) $uri; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $uri->getPath(); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $requestUrl = $this->getUrlFromRequest($request->getUri()); |
51 | 51 | |
52 | - return (bool)preg_match($regex, $requestUrl); |
|
52 | + return (bool) preg_match($regex, $requestUrl); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | protected function getUrlFromRequest(UriInterface $uri): string |
62 | 62 | { |
63 | 63 | if ($this->checkFullUrl) { |
64 | - return (string)$uri; |
|
64 | + return (string) $uri; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $uri->getPath(); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function testFindDefault(): void |
32 | 32 | { |
33 | - $function = function ($data) { |
|
33 | + $function = function($data) { |
|
34 | 34 | if (isset($data['username']) && $data['username'] === 'mariano') { |
35 | 35 | return new ArrayObject([ |
36 | 36 | 'id' => 1, |
@@ -73,7 +73,7 @@ |
||
73 | 73 | ->method('getAuthenticationService') |
74 | 74 | ->willReturn($service); |
75 | 75 | |
76 | - $requestHandler = $this |
|
76 | + $requestHandler = $this |
|
77 | 77 | ->getMockBuilder(RequestHandlerInterface::class) |
78 | 78 | ->getMock(); |
79 | 79 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | { |
51 | 51 | foreach ($conditions as $key => $value) { |
52 | 52 | unset($conditions[$key]); |
53 | - $conditions[':' . $key] = $value; |
|
53 | + $conditions[':'.$key] = $value; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | $this->statement->execute($conditions); |