@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $core = $this->httpCore([CsrfMiddleware::class]); |
| 54 | 54 | $core->setHandler( |
| 55 | - static function ($r) { |
|
| 55 | + static function ($r){ |
|
| 56 | 56 | return $r->getAttribute(CsrfMiddleware::ATTRIBUTE); |
| 57 | 57 | } |
| 58 | 58 | ); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $core = $this->httpCore([CsrfMiddleware::class]); |
| 84 | 84 | $core->setHandler( |
| 85 | - static function () { |
|
| 85 | + static function (){ |
|
| 86 | 86 | return 'all good'; |
| 87 | 87 | } |
| 88 | 88 | ); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | $core = $this->httpCore([CsrfMiddleware::class, CsrfFirewall::class]); |
| 96 | 96 | $core->setHandler( |
| 97 | - static function () { |
|
| 97 | + static function (){ |
|
| 98 | 98 | return 'all good'; |
| 99 | 99 | } |
| 100 | 100 | ); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $this->expectException(\LogicException::class); |
| 109 | 109 | $core = $this->httpCore([CsrfFirewall::class]); |
| 110 | 110 | $core->setHandler( |
| 111 | - static function () { |
|
| 111 | + static function (){ |
|
| 112 | 112 | return 'all good'; |
| 113 | 113 | } |
| 114 | 114 | ); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $core = $this->httpCore([CsrfMiddleware::class, CsrfFirewall::class]); |
| 122 | 122 | $core->setHandler( |
| 123 | - static function () { |
|
| 123 | + static function (){ |
|
| 124 | 124 | return 'all good'; |
| 125 | 125 | } |
| 126 | 126 | ); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | { |
| 154 | 154 | $core = $this->httpCore([CsrfMiddleware::class, CsrfFirewall::class]); |
| 155 | 155 | $core->setHandler( |
| 156 | - static function () { |
|
| 156 | + static function (){ |
|
| 157 | 157 | return 'all good'; |
| 158 | 158 | } |
| 159 | 159 | ); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | { |
| 187 | 187 | $core = $this->httpCore([CsrfMiddleware::class, StrictCsrfFirewall::class]); |
| 188 | 188 | $core->setHandler( |
| 189 | - static function () { |
|
| 189 | + static function (){ |
|
| 190 | 190 | return 'all good'; |
| 191 | 191 | } |
| 192 | 192 | ); |
@@ -277,10 +277,10 @@ discard block |
||
| 277 | 277 | { |
| 278 | 278 | $result = []; |
| 279 | 279 | |
| 280 | - foreach ($response->getHeaders() as $header) { |
|
| 281 | - foreach ($header as $headerLine) { |
|
| 280 | + foreach ($response->getHeaders() as $header){ |
|
| 281 | + foreach ($header as $headerLine){ |
|
| 282 | 282 | $chunk = explode(';', $headerLine); |
| 283 | - if (!count($chunk) || mb_strpos($chunk[0], '=') === false) { |
|
| 283 | + if (!count($chunk) || mb_strpos($chunk[0], '=') === false){ |
|
| 284 | 284 | continue; |
| 285 | 285 | } |
| 286 | 286 | |
@@ -52,7 +52,8 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $core = $this->httpCore([CsrfMiddleware::class]); |
| 54 | 54 | $core->setHandler( |
| 55 | - static function ($r) { |
|
| 55 | + static function ($r) |
|
| 56 | + { |
|
| 56 | 57 | return $r->getAttribute(CsrfMiddleware::ATTRIBUTE); |
| 57 | 58 | } |
| 58 | 59 | ); |
@@ -82,7 +83,8 @@ discard block |
||
| 82 | 83 | |
| 83 | 84 | $core = $this->httpCore([CsrfMiddleware::class]); |
| 84 | 85 | $core->setHandler( |
| 85 | - static function () { |
|
| 86 | + static function () |
|
| 87 | + { |
|
| 86 | 88 | return 'all good'; |
| 87 | 89 | } |
| 88 | 90 | ); |
@@ -94,7 +96,8 @@ discard block |
||
| 94 | 96 | { |
| 95 | 97 | $core = $this->httpCore([CsrfMiddleware::class, CsrfFirewall::class]); |
| 96 | 98 | $core->setHandler( |
| 97 | - static function () { |
|
| 99 | + static function () |
|
| 100 | + { |
|
| 98 | 101 | return 'all good'; |
| 99 | 102 | } |
| 100 | 103 | ); |
@@ -108,7 +111,8 @@ discard block |
||
| 108 | 111 | $this->expectException(\LogicException::class); |
| 109 | 112 | $core = $this->httpCore([CsrfFirewall::class]); |
| 110 | 113 | $core->setHandler( |
| 111 | - static function () { |
|
| 114 | + static function () |
|
| 115 | + { |
|
| 112 | 116 | return 'all good'; |
| 113 | 117 | } |
| 114 | 118 | ); |
@@ -120,7 +124,8 @@ discard block |
||
| 120 | 124 | { |
| 121 | 125 | $core = $this->httpCore([CsrfMiddleware::class, CsrfFirewall::class]); |
| 122 | 126 | $core->setHandler( |
| 123 | - static function () { |
|
| 127 | + static function () |
|
| 128 | + { |
|
| 124 | 129 | return 'all good'; |
| 125 | 130 | } |
| 126 | 131 | ); |
@@ -153,7 +158,8 @@ discard block |
||
| 153 | 158 | { |
| 154 | 159 | $core = $this->httpCore([CsrfMiddleware::class, CsrfFirewall::class]); |
| 155 | 160 | $core->setHandler( |
| 156 | - static function () { |
|
| 161 | + static function () |
|
| 162 | + { |
|
| 157 | 163 | return 'all good'; |
| 158 | 164 | } |
| 159 | 165 | ); |
@@ -186,7 +192,8 @@ discard block |
||
| 186 | 192 | { |
| 187 | 193 | $core = $this->httpCore([CsrfMiddleware::class, StrictCsrfFirewall::class]); |
| 188 | 194 | $core->setHandler( |
| 189 | - static function () { |
|
| 195 | + static function () |
|
| 196 | + { |
|
| 190 | 197 | return 'all good'; |
| 191 | 198 | } |
| 192 | 199 | ); |
@@ -277,10 +284,13 @@ discard block |
||
| 277 | 284 | { |
| 278 | 285 | $result = []; |
| 279 | 286 | |
| 280 | - foreach ($response->getHeaders() as $header) { |
|
| 281 | - foreach ($header as $headerLine) { |
|
| 287 | + foreach ($response->getHeaders() as $header) |
|
| 288 | + { |
|
| 289 | + foreach ($header as $headerLine) |
|
| 290 | + { |
|
| 282 | 291 | $chunk = explode(';', $headerLine); |
| 283 | - if (!count($chunk) || mb_strpos($chunk[0], '=') === false) { |
|
| 292 | + if (!count($chunk) || mb_strpos($chunk[0], '=') === false) |
|
| 293 | + { |
|
| 284 | 294 | continue; |
| 285 | 295 | } |
| 286 | 296 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | string $clientFilename = null, |
| 27 | 27 | string $clientMediaType = null |
| 28 | 28 | ): UploadedFileInterface { |
| 29 | - if ($size === null) { |
|
| 29 | + if ($size === null){ |
|
| 30 | 30 | $size = $stream->getSize(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -26,7 +26,8 @@ |
||
| 26 | 26 | string $clientFilename = null, |
| 27 | 27 | string $clientMediaType = null |
| 28 | 28 | ): UploadedFileInterface { |
| 29 | - if ($size === null) { |
|
| 29 | + if ($size === null) |
|
| 30 | + { |
|
| 30 | 31 | $size = $stream->getSize(); |
| 31 | 32 | } |
| 32 | 33 | |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $http->setHandler( |
| 46 | 46 | static function (ServerRequestInterface $request, ResponseInterface $response): void { |
| 47 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
| 47 | + if ($request->getAttribute('authContext')->getToken() === null){ |
|
| 48 | 48 | echo 'no token'; |
| 49 | - } else { |
|
| 49 | + }else{ |
|
| 50 | 50 | echo $request->getAttribute('authContext')->getToken()->getID(); |
| 51 | 51 | echo ':'; |
| 52 | 52 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | $http->setHandler( |
| 78 | 78 | static function (ServerRequestInterface $request, ResponseInterface $response): void { |
| 79 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
| 79 | + if ($request->getAttribute('authContext')->getToken() === null){ |
|
| 80 | 80 | echo 'no token'; |
| 81 | - } else { |
|
| 81 | + }else{ |
|
| 82 | 82 | echo $request->getAttribute('authContext')->getToken()->getID(); |
| 83 | 83 | echo ':'; |
| 84 | 84 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | ); |
| 192 | 192 | |
| 193 | 193 | self::assertSame( |
| 194 | - 'Expires=' . gmdate(DATE_COOKIE, time() + 3600), |
|
| 194 | + 'Expires='.gmdate(DATE_COOKIE, time() + 3600), |
|
| 195 | 195 | $cookie[1] |
| 196 | 196 | ); |
| 197 | 197 | |
@@ -43,9 +43,12 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $http->setHandler( |
| 45 | 45 | static function (ServerRequestInterface $request, ResponseInterface $response): void { |
| 46 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
| 46 | + if ($request->getAttribute('authContext')->getToken() === null) |
|
| 47 | + { |
|
| 47 | 48 | echo 'no token'; |
| 48 | - } else { |
|
| 49 | + } |
|
| 50 | + else |
|
| 51 | + { |
|
| 49 | 52 | echo $request->getAttribute('authContext')->getToken()->getID(); |
| 50 | 53 | echo ':'; |
| 51 | 54 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -67,9 +70,12 @@ discard block |
||
| 67 | 70 | |
| 68 | 71 | $http->setHandler( |
| 69 | 72 | static function (ServerRequestInterface $request, ResponseInterface $response): void { |
| 70 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
| 73 | + if ($request->getAttribute('authContext')->getToken() === null) |
|
| 74 | + { |
|
| 71 | 75 | echo 'no token'; |
| 72 | - } else { |
|
| 76 | + } |
|
| 77 | + else |
|
| 78 | + { |
|
| 73 | 79 | echo $request->getAttribute('authContext')->getToken()->getID(); |
| 74 | 80 | echo ':'; |
| 75 | 81 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | public function getActor(TokenInterface $token): ?object |
| 20 | 20 | { |
| 21 | - if ($token->getPayload()['ok']) { |
|
| 21 | + if ($token->getPayload()['ok']){ |
|
| 22 | 22 | return new \stdClass(); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -18,7 +18,8 @@ |
||
| 18 | 18 | { |
| 19 | 19 | public function getActor(TokenInterface $token): ?object |
| 20 | 20 | { |
| 21 | - if ($token->getPayload()['ok']) { |
|
| 21 | + if ($token->getPayload()['ok']) |
|
| 22 | + { |
|
| 22 | 23 | return new \stdClass(); |
| 23 | 24 | } |
| 24 | 25 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | public function getActor(TokenInterface $token): ?object |
| 20 | 20 | { |
| 21 | - if ($token->getID() === 'ok') { |
|
| 21 | + if ($token->getID() === 'ok'){ |
|
| 22 | 22 | return new \stdClass(); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -18,7 +18,8 @@ |
||
| 18 | 18 | { |
| 19 | 19 | public function getActor(TokenInterface $token): ?object |
| 20 | 20 | { |
| 21 | - if ($token->getID() === 'ok') { |
|
| 21 | + if ($token->getID() === 'ok') |
|
| 22 | + { |
|
| 22 | 23 | return new \stdClass(); |
| 23 | 24 | } |
| 24 | 25 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | public function load(string $id): ?TokenInterface |
| 20 | 20 | { |
| 21 | - if ($id === 'bad') { |
|
| 21 | + if ($id === 'bad'){ |
|
| 22 | 22 | return null; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -18,7 +18,8 @@ |
||
| 18 | 18 | { |
| 19 | 19 | public function load(string $id): ?TokenInterface |
| 20 | 20 | { |
| 21 | - if ($id === 'bad') { |
|
| 21 | + if ($id === 'bad') |
|
| 22 | + { |
|
| 22 | 23 | return null; |
| 23 | 24 | } |
| 24 | 25 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | protected function someFunction() |
| 20 | 20 | { |
| 21 | 21 | $result = $this->sampleMethod('hello world'); |
| 22 | - print_r(self::sampleMethod($result . 'plus')); |
|
| 22 | + print_r(self::sampleMethod($result.'plus')); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function testInstance() |
@@ -22,17 +22,17 @@ |
||
| 22 | 22 | $this->assertContains(TestTrait::class, $reflection->getTraits()); |
| 23 | 23 | $this->assertContains(TestInterface::class, $reflection->getInterfaces()); |
| 24 | 24 | |
| 25 | - $this->assertSame([__NAMESPACE__ . '\hello'], $reflection->getFunctions()); |
|
| 25 | + $this->assertSame([__NAMESPACE__.'\hello'], $reflection->getFunctions()); |
|
| 26 | 26 | |
| 27 | 27 | $functionA = null; |
| 28 | 28 | $functionB = null; |
| 29 | 29 | |
| 30 | - foreach ($reflection->getInvocations() as $invocation) { |
|
| 31 | - if ($invocation->getName() == 'test_function_a') { |
|
| 30 | + foreach ($reflection->getInvocations() as $invocation){ |
|
| 31 | + if ($invocation->getName() == 'test_function_a'){ |
|
| 32 | 32 | $functionA = $invocation; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if ($invocation->getName() == 'test_function_b') { |
|
| 35 | + if ($invocation->getName() == 'test_function_b'){ |
|
| 36 | 36 | $functionB = $invocation; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -27,12 +27,15 @@ |
||
| 27 | 27 | $functionA = null; |
| 28 | 28 | $functionB = null; |
| 29 | 29 | |
| 30 | - foreach ($reflection->getInvocations() as $invocation) { |
|
| 31 | - if ($invocation->getName() == 'test_function_a') { |
|
| 30 | + foreach ($reflection->getInvocations() as $invocation) |
|
| 31 | + { |
|
| 32 | + if ($invocation->getName() == 'test_function_a') |
|
| 33 | + { |
|
| 32 | 34 | $functionA = $invocation; |
| 33 | 35 | } |
| 34 | 36 | |
| 35 | - if ($invocation->getName() == 'test_function_b') { |
|
| 37 | + if ($invocation->getName() == 'test_function_b') |
|
| 38 | + { |
|
| 36 | 39 | $functionB = $invocation; |
| 37 | 40 | } |
| 38 | 41 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | $container = new Container(); |
| 78 | 78 | $container->bind(TranslatorConfig::class, new TranslatorConfig([ |
| 79 | 79 | 'locale' => 'en', |
| 80 | - 'directory' => __DIR__ . '/fixtures/locales/', |
|
| 80 | + 'directory' => __DIR__.'/fixtures/locales/', |
|
| 81 | 81 | 'loaders' => [ |
| 82 | 82 | 'php' => PhpFileLoader::class, |
| 83 | 83 | 'po' => PoFileLoader::class, |