Test Failed
Pull Request — master (#1137)
by f
05:31
created
src/Cookies/tests/CookieTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -127,9 +127,9 @@
 block discarded – undo
127 127
         $cookie = new Cookie('', '', 0, '', '', $secure, false, $sameSite);
128 128
         $this->assertSame($expected, $cookie->getSameSite());
129 129
 
130
-        if ($expected === null) {
130
+        if ($expected === null){
131 131
             $this->assertStringNotContainsString('SameSite=', $cookie->createHeader());
132
-        } else {
132
+        }else{
133 133
             $this->assertStringContainsString("SameSite=$expected", $cookie->createHeader());
134 134
         }
135 135
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -127,9 +127,12 @@
 block discarded – undo
127 127
         $cookie = new Cookie('', '', 0, '', '', $secure, false, $sameSite);
128 128
         $this->assertSame($expected, $cookie->getSameSite());
129 129
 
130
-        if ($expected === null) {
130
+        if ($expected === null)
131
+        {
131 132
             $this->assertStringNotContainsString('SameSite=', $cookie->createHeader());
132
-        } else {
133
+        }
134
+        else
135
+        {
133 136
             $this->assertStringContainsString("SameSite=$expected", $cookie->createHeader());
134 137
         }
135 138
     }
Please login to merge, or discard this patch.
src/AuthHttp/src/Transport/CookieTransport.php 2 patches
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,7 +85,8 @@  discard block
 block discarded – undo
85 85
     ): Response {
86 86
         /** @var CookieQueue $cookieQueue */
87 87
         $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE);
88
-        if ($cookieQueue === null) {
88
+        if ($cookieQueue === null)
89
+        {
89 90
             return $response->withAddedHeader(
90 91
                 'Set-Cookie',
91 92
                 Cookie::create(
@@ -101,9 +102,12 @@  discard block
 block discarded – undo
101 102
             );
102 103
         }
103 104
 
104
-        if ($tokenID === null) {
105
+        if ($tokenID === null)
106
+        {
105 107
             $cookieQueue->delete($this->cookie);
106
-        } else {
108
+        }
109
+        else
110
+        {
107 111
             $cookieQueue->set(
108 112
                 $this->cookie,
109 113
                 $tokenID,
@@ -134,7 +138,8 @@  discard block
 block discarded – undo
134 138
      */
135 139
     private function getLifetime(\DateTimeInterface $expiresAt = null): ?int
136 140
     {
137
-        if ($expiresAt === null) {
141
+        if ($expiresAt === null)
142
+        {
138 143
             return null;
139 144
         }
140 145
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         private readonly bool $secure = false,
23 23
         private readonly bool $httpOnly = true,
24 24
         private readonly ?string $sameSite = null
25
-    ) {
25
+    ){
26 26
     }
27 27
 
28 28
     public function fetchToken(Request $request): ?string
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     ): Response {
40 40
         /** @var CookieQueue $cookieQueue */
41 41
         $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE);
42
-        if ($cookieQueue === null) {
42
+        if ($cookieQueue === null){
43 43
             return $response->withAddedHeader(
44 44
                 'Set-Cookie',
45 45
                 Cookie::create(
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
             );
56 56
         }
57 57
 
58
-        if ($tokenID === null) {
58
+        if ($tokenID === null){
59 59
             $cookieQueue->delete($this->cookie);
60
-        } else {
60
+        }else{
61 61
             $cookieQueue->set(
62 62
                 $this->cookie,
63 63
                 $tokenID,
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     private function getLifetime(\DateTimeInterface $expiresAt = null): ?int
86 86
     {
87
-        if ($expiresAt === null) {
87
+        if ($expiresAt === null){
88 88
             return null;
89 89
         }
90 90
 
Please login to merge, or discard this patch.
src/AuthHttp/tests/Diactoros/UploadedFileFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/AuthHttp/tests/CookieTransportTest.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,9 +43,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
src/Auth/tests/Stub/TestAuthProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/AuthHttp/tests/Stub/TestAuthHttpProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/AuthHttp/tests/Stub/TestAuthHttpStorage.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Tokenizer/tests/ReflectionFileTest.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,12 +27,15 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@  discard block
 block discarded – undo
16 16
         $this->assertContains(TestTrait::class, $reflection->getTraits());
17 17
         $this->assertContains(TestInterface::class, $reflection->getInterfaces());
18 18
 
19
-        $this->assertSame([__NAMESPACE__ . '\hello'], $reflection->getFunctions());
19
+        $this->assertSame([__NAMESPACE__.'\hello'], $reflection->getFunctions());
20 20
 
21 21
         $functionA = null;
22 22
         $functionB = null;
23 23
 
24
-        foreach ($reflection->getInvocations() as $invocation) {
25
-            if ($invocation->getName() == 'test_function_a') {
24
+        foreach ($reflection->getInvocations() as $invocation){
25
+            if ($invocation->getName() == 'test_function_a'){
26 26
                 $functionA = $invocation;
27 27
             }
28 28
 
29
-            if ($invocation->getName() == 'test_function_b') {
29
+            if ($invocation->getName() == 'test_function_b'){
30 30
                 $functionB = $invocation;
31 31
             }
32 32
         }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
     public function testReflectionFileWithNamedParameters(): void
55 55
     {
56
-        $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassWithNamedParameter.php');
56
+        $reflection = new ReflectionFile(__DIR__.'/Classes/ClassWithNamedParameter.php');
57 57
 
58 58
         $this->assertSame([
59 59
             \Spiral\Tests\Tokenizer\Classes\ClassWithNamedParameter::class,
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function testReflectionFileAnonymousClass(): void
64 64
     {
65
-        $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassWithAnonymousClass.php');
65
+        $reflection = new ReflectionFile(__DIR__.'/Classes/ClassWithAnonymousClass.php');
66 66
 
67 67
         $this->assertSame([
68 68
             \Spiral\Tests\Tokenizer\Classes\ClassWithAnonymousClass::class,
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
     public function testReflectionFileWithHeredoc(): void
73 73
     {
74
-        $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassWithHeredoc.php');
74
+        $reflection = new ReflectionFile(__DIR__.'/Classes/ClassWithHeredoc.php');
75 75
 
76 76
         $this->assertSame([
77 77
             'Spiral\Tests\Tokenizer\Classes\ClassWithHeredoc',
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     public function testReflectionEnum(): void
82 82
     {
83
-        $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassD.php');
83
+        $reflection = new ReflectionFile(__DIR__.'/Classes/ClassD.php');
84 84
 
85 85
         $this->assertSame([
86 86
             \Spiral\Tests\Tokenizer\Classes\ClassD::class,
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
     public function testReflectionTypedEnum(): void
91 91
     {
92
-        $reflection = new ReflectionFile(__DIR__ . '/Classes/ClassE.php');
92
+        $reflection = new ReflectionFile(__DIR__.'/Classes/ClassE.php');
93 93
 
94 94
         $this->assertSame([
95 95
             \Spiral\Tests\Tokenizer\Classes\ClassE::class,
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
     public function testReflectionInterface(): void
100 100
     {
101
-        $reflection = new ReflectionFile(__DIR__ . '/Interfaces/InterfaceA.php');
101
+        $reflection = new ReflectionFile(__DIR__.'/Interfaces/InterfaceA.php');
102 102
 
103 103
         $this->assertSame([
104 104
             \Spiral\Tests\Tokenizer\Interfaces\InterfaceA::class,
Please login to merge, or discard this patch.
src/Translator/tests/TranslatorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.