| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 | $this->request = ServerRequestFactory::fromGlobals( | 
| 75 | 75 | ['REQUEST_URI' => '/'] | 
| 76 | 76 | ); | 
| 77 | -        $this->request = $this->request->withAddedHeader('Authorization', 'Bearer ' . $this->token); | |
| 77 | +        $this->request = $this->request->withAddedHeader('Authorization', 'Bearer '.$this->token); | |
| 78 | 78 | |
| 79 | 79 | $authenticator = (new JwtAuthenticator($this->identifiers, 'secretKey')); | 
| 80 | 80 | |
| @@ -254,6 +254,6 @@ discard block | ||
| 254 | 254 | ]; | 
| 255 | 255 | |
| 256 | 256 | $result = $authenticator->getPayload(); | 
| 257 | - $this->assertEquals($expected, (array)$result); | |
| 257 | + $this->assertEquals($expected, (array) $result); | |
| 258 | 258 | } | 
| 259 | 259 | } | 
| @@ -187,7 +187,7 @@ discard block | ||
| 187 | 187 | $data = [ | 
| 188 | 188 | 'username' => 'digest', | 
| 189 | 189 | 'uri' => '/dir/index.html', | 
| 190 | - 'nonce' => base64_encode(time() . ':lol:lol'), | |
| 190 | + 'nonce' => base64_encode(time().':lol:lol'), | |
| 191 | 191 | 'nc' => 1, | 
| 192 | 192 | 'cnonce' => '123', | 
| 193 | 193 | 'qop' => 'auth', | 
| @@ -476,8 +476,8 @@ discard block | ||
| 476 | 476 |      { | 
| 477 | 477 | $time = $time ?: microtime(true); | 
| 478 | 478 | $expiryTime = $time + $expires; | 
| 479 | -        $signatureValue = hash_hmac('sha1', $expiryTime . ':' . $secret, $secret); | |
| 480 | - $nonceValue = $expiryTime . ':' . $signatureValue; | |
| 479 | +        $signatureValue = hash_hmac('sha1', $expiryTime.':'.$secret, $secret); | |
| 480 | + $nonceValue = $expiryTime.':'.$signatureValue; | |
| 481 | 481 | |
| 482 | 482 | return base64_encode($nonceValue); | 
| 483 | 483 | } | 
| @@ -77,7 +77,7 @@ discard block | ||
| 77 | 77 | $storage = $this->createMock(StorageInterface::class); | 
| 78 | 78 | $storage | 
| 79 | 79 |              ->method('read') | 
| 80 | - ->willReturn(["robert","$2y$10$2sqDmq10vv7cbIsnRymfhe0Hii.eabOK0x1WVWSn8pL1csV6NnwV2"]); | |
| 80 | + ->willReturn(["robert", "$2y$10$2sqDmq10vv7cbIsnRymfhe0Hii.eabOK0x1WVWSn8pL1csV6NnwV2"]); | |
| 81 | 81 | $authenticator = $this->createAuthenticator($storage); | 
| 82 | 82 | |
| 83 | 83 | $request = ServerRequestFactory::fromGlobals( | 
| @@ -101,7 +101,7 @@ discard block | ||
| 101 | 101 | $storage = $this->createMock(StorageInterface::class); | 
| 102 | 102 | $storage | 
| 103 | 103 |              ->method('read') | 
| 104 | - ->willReturn(["unknown","$2y$10$2sqDmq10vv7cbIsnRymfhe0Hii.eabOK0x1WVWSn8pL1csV6NnwV2"]); | |
| 104 | + ->willReturn(["unknown", "$2y$10$2sqDmq10vv7cbIsnRymfhe0Hii.eabOK0x1WVWSn8pL1csV6NnwV2"]); | |
| 105 | 105 | $authenticator = $this->createAuthenticator($storage); | 
| 106 | 106 | |
| 107 | 107 | $request = ServerRequestFactory::fromGlobals( | 
| @@ -149,7 +149,7 @@ discard block | ||
| 149 | 149 | $storage = $this->createMock(StorageInterface::class); | 
| 150 | 150 | $storage | 
| 151 | 151 |              ->method('read') | 
| 152 | - ->willReturn(["robert","$2y$10$1bE1SgasKoz9WmEvUfuZLeYa6pQgxUIJ5LAoS/asdasdsadasd"]); | |
| 152 | + ->willReturn(["robert", "$2y$10$1bE1SgasKoz9WmEvUfuZLeYa6pQgxUIJ5LAoS/asdasdsadasd"]); | |
| 153 | 153 | $authenticator = $this->createAuthenticator($storage); | 
| 154 | 154 | |
| 155 | 155 | $request = ServerRequestFactory::fromGlobals( | 
| @@ -38,7 +38,7 @@ discard block | ||
| 38 | 38 | */ | 
| 39 | 39 | public function testIdentify(): void | 
| 40 | 40 |      { | 
| 41 | -        $callback = function ($data) { | |
| 41 | +        $callback = function($data) { | |
| 42 | 42 |              if (isset($data['username']) && $data['username'] === 'florian') { | 
| 43 | 43 | return new ArrayObject($data); | 
| 44 | 44 | } | 
| @@ -65,7 +65,7 @@ discard block | ||
| 65 | 65 | */ | 
| 66 | 66 | public function testValidCallable(): void | 
| 67 | 67 |      { | 
| 68 | -        $identifier = new CallbackIdentifier(function () { | |
| 68 | +        $identifier = new CallbackIdentifier(function() { | |
| 69 | 69 | return new ArrayObject(); | 
| 70 | 70 | }); | 
| 71 | 71 | $result = $identifier->identify([]); | 
| @@ -85,7 +85,7 @@ discard block | ||
| 85 | 85 | */ | 
| 86 | 86 | public function testInvalidReturnValue(): void | 
| 87 | 87 |      { | 
| 88 | -        $identifier = new CallbackIdentifier(function ($data) { | |
| 88 | +        $identifier = new CallbackIdentifier(function($data) { | |
| 89 | 89 | return 'no'; | 
| 90 | 90 | }); | 
| 91 | 91 | $identifier->identify([]); | 
| @@ -32,8 +32,8 @@ discard block | ||
| 32 | 32 | public function testIdentify() | 
| 33 | 33 |      { | 
| 34 | 34 | $host = 'ldap.example.com'; | 
| 35 | -        $bind = function ($username) { | |
| 36 | - return 'cn=' . $username . ',dc=example,dc=com'; | |
| 35 | +        $bind = function($username) { | |
| 36 | + return 'cn='.$username.',dc=example,dc=com'; | |
| 37 | 37 | }; | 
| 38 | 38 | $options = [ | 
| 39 | 39 | 'foo' => 3 | 
| @@ -72,7 +72,7 @@ discard block | ||
| 72 | 72 | ->willReturn(false); | 
| 73 | 73 | |
| 74 | 74 | $host = 'ldap.example.com'; | 
| 75 | -        $bind = function () { | |
| 75 | +        $bind = function() { | |
| 76 | 76 | return 'dc=example,dc=com'; | 
| 77 | 77 | }; | 
| 78 | 78 | $identifier = new LdapIdentifier($ldap, $host, $bind); | 
| @@ -100,7 +100,7 @@ discard block | ||
| 100 | 100 | $identifier = new LdapIdentifier( | 
| 101 | 101 | new ExtensionAdapter(), | 
| 102 | 102 | 'ldap.example.com', | 
| 103 | -            function () { | |
| 103 | +            function() { | |
| 104 | 104 | return 'dc=example,dc=com'; | 
| 105 | 105 | } | 
| 106 | 106 | ); | 
| @@ -122,7 +122,7 @@ discard block | ||
| 122 | 122 |              ->willReturn('This is another error.'); | 
| 123 | 123 | |
| 124 | 124 | $host = 'ldap.example.com'; | 
| 125 | -        $bind = function () { | |
| 125 | +        $bind = function() { | |
| 126 | 126 | return 'dc=example,dc=com'; | 
| 127 | 127 | }; | 
| 128 | 128 | $identifier = new LdapIdentifier($ldap, $host, $bind); | 
| @@ -22,7 +22,7 @@ | ||
| 22 | 22 | $where[] = "$field = '$value'"; | 
| 23 | 23 | } | 
| 24 | 24 | |
| 25 | -        $sql = 'SELECT * FROM users WHERE ' . implode(' AND ', $where); | |
| 25 | +        $sql = 'SELECT * FROM users WHERE '.implode(' AND ', $where); | |
| 26 | 26 | |
| 27 | 27 | $result = $this->pdo->query($sql)->fetch(); | 
| 28 | 28 | |
| @@ -26,7 +26,7 @@ | ||
| 26 | 26 | */ | 
| 27 | 27 | protected function getFile(string $name): string | 
| 28 | 28 |      { | 
| 29 | - return dirname(dirname(__FILE__)) . '/data_set/' . $name; | |
| 29 | + return dirname(dirname(__FILE__)).'/data_set/'.$name; | |
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | 32 | /** | 
| @@ -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 | ]; | 
| @@ -160,7 +160,7 @@ discard block | ||
| 160 | 160 | $usernameField = $this->credentialFields[IdentifierInterface::CREDENTIAL_USERNAME]; | 
| 161 | 161 | $passwordField = $this->credentialFields[IdentifierInterface::CREDENTIAL_PASSWORD]; | 
| 162 | 162 | |
| 163 | - return $data[$usernameField] . $data[$passwordField]; | |
| 163 | + return $data[$usernameField].$data[$passwordField]; | |
| 164 | 164 | } | 
| 165 | 165 | |
| 166 | 166 | /** | 
| @@ -178,7 +178,7 @@ discard block | ||
| 178 | 178 | |
| 179 | 179 | $usernameField = $this->credentialFields[IdentifierInterface::CREDENTIAL_USERNAME]; | 
| 180 | 180 | |
| 181 | - return (string)json_encode([$data[$usernameField], $hash]); | |
| 181 | + return (string) json_encode([$data[$usernameField], $hash]); | |
| 182 | 182 | } | 
| 183 | 183 | |
| 184 | 184 | /** |