@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | protected function getData(ServerRequestInterface $request): ?array |
| 51 | 51 | { |
| 52 | - $body = (array)$request->getParsedBody(); |
|
| 52 | + $body = (array) $request->getParsedBody(); |
|
| 53 | 53 | |
| 54 | 54 | $data = []; |
| 55 | 55 | foreach ($this->credentialFields as $key => $field) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $errors = [ |
| 80 | 80 | sprintf( |
| 81 | 81 | 'Login URL `%s` did not match `%s`.', |
| 82 | - (string)$request->getUri(), |
|
| 82 | + (string) $request->getUri(), |
|
| 83 | 83 | implode('` or `', $this->loginUrls) |
| 84 | 84 | ) |
| 85 | 85 | ]; |
@@ -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 | /** |
@@ -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(); |
@@ -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 |
@@ -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); |
@@ -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 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $fields = $this->credentialFields[self::CREDENTIAL_USERNAME]; |
| 186 | 186 | |
| 187 | 187 | $conditions = []; |
| 188 | - foreach ((array)$fields as $field) { |
|
| 188 | + foreach ((array) $fields as $field) { |
|
| 189 | 189 | $conditions[$field] = $identifier; |
| 190 | 190 | } |
| 191 | 191 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public function write(ServerRequestInterface $request, ResponseInterface $response, $data): ResponseInterface |
| 79 | 79 | { |
| 80 | - $_SESSION[$this->key] = (array)$data; |
|
| 80 | + $_SESSION[$this->key] = (array) $data; |
|
| 81 | 81 | |
| 82 | 82 | return $response; |
| 83 | 83 | } |
@@ -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 | /** |