Test Failed
Pull Request — master (#787)
by Aleksei
14:14 queued 08:27
created
src/Pagination/src/Paginator.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         private int $limit = 25,
17 17
         private int $count = 0,
18 18
         private readonly ?string $parameter = null
19
-    ) {
19
+    ){
20 20
     }
21 21
 
22 22
     /**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function paginate(PaginableInterface $target): PaginatorInterface
72 72
     {
73 73
         $paginator = clone $this;
74
-        if ($target instanceof \Countable && $paginator->count === 0) {
74
+        if ($target instanceof \Countable && $paginator->count === 0){
75 75
             $paginator->setCount($target->count());
76 76
         }
77 77
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
     public function countDisplayed(): int
95 95
     {
96
-        if ($this->getPage() === $this->countPages) {
96
+        if ($this->getPage() === $this->countPages){
97 97
             return $this->count - $this->getOffset();
98 98
         }
99 99
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
     public function nextPage(): ?int
109 109
     {
110
-        if ($this->getPage() !== $this->countPages) {
110
+        if ($this->getPage() !== $this->countPages){
111 111
             return $this->getPage() + 1;
112 112
         }
113 113
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     public function previousPage(): ?int
118 118
     {
119
-        if ($this->getPage() > 1) {
119
+        if ($this->getPage() > 1){
120 120
             return $this->getPage() - 1;
121 121
         }
122 122
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     private function setCount(int $count): self
130 130
     {
131 131
         $this->count = \max($count, 0);
132
-        $this->countPages = $this->count > 0 ? (int) \ceil($this->count / $this->limit) : 1;
132
+        $this->countPages = $this->count > 0 ? (int)\ceil($this->count / $this->limit) : 1;
133 133
 
134 134
         return $this;
135 135
     }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,8 @@  discard block
 block discarded – undo
71 71
     public function paginate(PaginableInterface $target): PaginatorInterface
72 72
     {
73 73
         $paginator = clone $this;
74
-        if ($target instanceof \Countable && $paginator->count === 0) {
74
+        if ($target instanceof \Countable && $paginator->count === 0)
75
+        {
75 76
             $paginator->setCount($target->count());
76 77
         }
77 78
 
@@ -93,7 +94,8 @@  discard block
 block discarded – undo
93 94
 
94 95
     public function countDisplayed(): int
95 96
     {
96
-        if ($this->getPage() === $this->countPages) {
97
+        if ($this->getPage() === $this->countPages)
98
+        {
97 99
             return $this->count - $this->getOffset();
98 100
         }
99 101
 
@@ -107,7 +109,8 @@  discard block
 block discarded – undo
107 109
 
108 110
     public function nextPage(): ?int
109 111
     {
110
-        if ($this->getPage() !== $this->countPages) {
112
+        if ($this->getPage() !== $this->countPages)
113
+        {
111 114
             return $this->getPage() + 1;
112 115
         }
113 116
 
@@ -116,7 +119,8 @@  discard block
 block discarded – undo
116 119
 
117 120
     public function previousPage(): ?int
118 121
     {
119
-        if ($this->getPage() > 1) {
122
+        if ($this->getPage() > 1)
123
+        {
120 124
             return $this->getPage() - 1;
121 125
         }
122 126
 
Please login to merge, or discard this patch.
src/Boot/tests/MemoryTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@  discard block
 block discarded – undo
14 14
     {
15 15
         $core = TestCore::create([
16 16
             'root'  => __DIR__,
17
-            'cache' => __DIR__ . '/cache'
17
+            'cache' => __DIR__.'/cache'
18 18
         ])->run();
19 19
 
20 20
         /** @var MemoryInterface $memory */
21 21
         $memory = $core->getContainer()->get(MemoryInterface::class);
22 22
 
23 23
         $memory->saveData('test', 'data');
24
-        $this->assertFileExists(__DIR__ . '/cache/test.php');
24
+        $this->assertFileExists(__DIR__.'/cache/test.php');
25 25
         $this->assertSame('data', $memory->loadData('test'));
26 26
 
27
-        unlink(__DIR__ . '/cache/test.php');
27
+        unlink(__DIR__.'/cache/test.php');
28 28
         $this->assertNull($memory->loadData('test'));
29 29
     }
30 30
 
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $core = TestCore::create([
34 34
             'root'  => __DIR__,
35
-            'cache' => __DIR__ . '/cache'
35
+            'cache' => __DIR__.'/cache'
36 36
         ])->run();
37 37
 
38 38
         /** @var MemoryInterface $memory */
39 39
         $memory = $core->getContainer()->get(MemoryInterface::class);
40 40
 
41
-        file_put_contents(__DIR__ . '/cache/test.php', '<?php broken');
41
+        file_put_contents(__DIR__.'/cache/test.php', '<?php broken');
42 42
         $this->assertNull($memory->loadData('test'));
43 43
 
44
-        unlink(__DIR__ . '/cache/test.php');
44
+        unlink(__DIR__.'/cache/test.php');
45 45
         $this->assertNull($memory->loadData('test'));
46 46
     }
47 47
 }
Please login to merge, or discard this patch.
src/Boot/tests/BootloadManager/BootloadersTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
26 26
             SampleBootWithMethodBoot::class,
27 27
             SampleBoot::class,
28 28
         ], [
29
-            static function(Container $container, SampleBoot $boot) {
29
+            static function (Container $container, SampleBoot $boot){
30 30
                 $container->bind('efg', $boot);
31 31
             }
32 32
         ], [
33
-            static function(Container $container, SampleBoot $boot) {
33
+            static function (Container $container, SampleBoot $boot){
34 34
                 $container->bind('ghi', $boot);
35 35
             }
36 36
         ]);
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,11 +26,13 @@
 block discarded – undo
26 26
             SampleBootWithMethodBoot::class,
27 27
             SampleBoot::class,
28 28
         ], [
29
-            static function(Container $container, SampleBoot $boot) {
29
+            static function(Container $container, SampleBoot $boot)
30
+            {
30 31
                 $container->bind('efg', $boot);
31 32
             }
32 33
         ], [
33
-            static function(Container $container, SampleBoot $boot) {
34
+            static function(Container $container, SampleBoot $boot)
35
+            {
34 36
                 $container->bind('ghi', $boot);
35 37
             }
36 38
         ]);
Please login to merge, or discard this patch.
src/Boot/tests/Environment/DebugModeTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@
 block discarded – undo
33 33
 
34 34
         $this->assertSame($expected, $enum);
35 35
 
36
-        if ($enum === DebugMode::Enabled) {
36
+        if ($enum === DebugMode::Enabled){
37 37
             $this->assertTrue($enum->isEnabled());
38
-        } else {
38
+        }else{
39 39
             $this->assertFalse($enum->isEnabled());
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,9 +33,12 @@
 block discarded – undo
33 33
 
34 34
         $this->assertSame($expected, $enum);
35 35
 
36
-        if ($enum === DebugMode::Enabled) {
36
+        if ($enum === DebugMode::Enabled)
37
+        {
37 38
             $this->assertTrue($enum->isEnabled());
38
-        } else {
39
+        }
40
+        else
41
+        {
39 42
             $this->assertFalse($enum->isEnabled());
40 43
         }
41 44
     }
Please login to merge, or discard this patch.
src/Boot/tests/FunctionsTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     {
19 19
         $core = TestCore::create([
20 20
             'root'   => __DIR__,
21
-            'config' => __DIR__ . '/config',
21
+            'config' => __DIR__.'/config',
22 22
         ])->run();
23 23
 
24 24
         /** @var ContainerInterface $c */
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $core = TestCore::create([
35 35
             'root'   => __DIR__,
36
-            'config' => __DIR__ . '/config',
36
+            'config' => __DIR__.'/config',
37 37
         ])->run(new Environment([
38 38
             'key' => '(true)',
39 39
         ]));
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $core = TestCore::create([
52 52
             'root'   => __DIR__,
53
-            'config' => __DIR__ . '/config',
53
+            'config' => __DIR__.'/config',
54 54
         ])->run();
55 55
 
56 56
         /** @var ContainerInterface $c */
57 57
         $c = $core->getContainer();
58 58
 
59 59
         ContainerScope::runScope($c, function (): void {
60
-            $this->assertDir(__DIR__ . '/config', directory('config'));
60
+            $this->assertDir(__DIR__.'/config', directory('config'));
61 61
         });
62 62
     }
63 63
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
         $core = TestCore::create([
76 76
             'root'   => __DIR__,
77
-            'config' => __DIR__ . '/config',
77
+            'config' => __DIR__.'/config',
78 78
         ])->run();
79 79
 
80 80
         /** @var ContainerInterface $c */
@@ -102,6 +102,6 @@  discard block
 block discarded – undo
102 102
     private function assertDir($path, $value): void
103 103
     {
104 104
         $path = str_replace(['\\', '//'], '/', $path);
105
-        $this->assertSame(rtrim($path, '/') . '/', $value);
105
+        $this->assertSame(rtrim($path, '/').'/', $value);
106 106
     }
107 107
 }
Please login to merge, or discard this patch.
src/Boot/tests/Fixtures/ConfigBootloader.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,22 +18,27 @@  discard block
 block discarded – undo
18 18
 
19 19
     public function init(Container $container, AbstractKernel $kernel): void
20 20
     {
21
-        $kernel->booting(static function (AbstractKernel $kernel) use ($container) {
21
+        $kernel->booting(static function (AbstractKernel $kernel) use ($container)
22
+        {
22 23
             $container->bind('hij', 'foo');
23 24
 
24
-            $kernel->booting(static function () use ($container) {
25
+            $kernel->booting(static function () use ($container)
26
+            {
25 27
                 $container->bind('ijk', 'foo');
26 28
             });
27 29
         });
28 30
 
29
-        $kernel->booted(function (AbstractKernel $kernel) use ($container) {
31
+        $kernel->booted(function (AbstractKernel $kernel) use ($container)
32
+        {
30 33
             $container->bind('jkl', 'foo');
31 34
 
32
-            $kernel->booting(function () use ($container) {
35
+            $kernel->booting(function () use ($container)
36
+            {
33 37
                 $container->bind('klm', 'foo');
34 38
             });
35 39
 
36
-            $kernel->booted(function () use ($container) {
40
+            $kernel->booted(function () use ($container)
41
+            {
37 42
                 $container->bind('lmn', 'foo');
38 43
             });
39 44
         });
@@ -44,11 +49,13 @@  discard block
 block discarded – undo
44 49
     public function boot(ConfigurationBootloader $configuration, AbstractKernel $kernel, Container $container): void
45 50
     {
46 51
         // won't be executed
47
-        $kernel->booting(function (AbstractKernel $kernel) use ($container) {
52
+        $kernel->booting(function (AbstractKernel $kernel) use ($container)
53
+        {
48 54
             $container->bind('ghi', 'foo');
49 55
         });
50 56
 
51
-        $kernel->booted(function (AbstractKernel $kernel) use ($container) {
57
+        $kernel->booted(function (AbstractKernel $kernel) use ($container)
58
+        {
52 59
             $container->bind('mno', 'foo');
53 60
         });
54 61
 
Please login to merge, or discard this patch.
src/Boot/tests/EnvironmentTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
      * @return EnvironmentInterface
89 89
      * @throws \Throwable
90 90
      */
91
-    protected function getEnv(array $env, bool $overwite= true): EnvironmentInterface
91
+    protected function getEnv(array $env, bool $overwite = true): EnvironmentInterface
92 92
     {
93 93
         $core = TestCore::create(['root' => __DIR__])->run(new Environment($env, $overwite));
94 94
 
Please login to merge, or discard this patch.
src/Boot/tests/Injector/EnumInjectorTest.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@
 block discarded – undo
34 34
 
35 35
     public function testCreateInjectionNotForClass(): void
36 36
     {
37
-        $class = new #[ProvideFrom(method: 'test')] class {
37
+        $class = new #[ProvideFrom(method: 'test')] class
38
+        {
38 39
         };
39 40
 
40 41
         $ref = new \ReflectionClass($class);
Please login to merge, or discard this patch.
src/Boot/tests/KernelTest.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             'root' => __DIR__,
43 43
         ])->run();
44 44
 
45
-        $d = new class() implements DispatcherInterface {
45
+        $d = new class() implements DispatcherInterface{
46 46
             public $fired = false;
47 47
 
48 48
             public function canServe(): bool
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             'root' => __DIR__,
72 72
         ])->run();
73 73
 
74
-        $d = new class() implements DispatcherInterface {
74
+        $d = new class() implements DispatcherInterface{
75 75
             public function canServe(): bool
76 76
             {
77 77
                 return true;
@@ -109,19 +109,19 @@  discard block
 block discarded – undo
109 109
             'root' => __DIR__,
110 110
         ]);
111 111
 
112
-        $kernel->booting(static function (TestCore $core) {
112
+        $kernel->booting(static function (TestCore $core){
113 113
             $core->getContainer()->bind('abc', 'foo');
114 114
         });
115 115
 
116
-        $kernel->booting(static function (TestCore $core) {
116
+        $kernel->booting(static function (TestCore $core){
117 117
             $core->getContainer()->bind('bcd', 'foo');
118 118
         });
119 119
 
120
-        $kernel->booted( static function (TestCore $core) {
120
+        $kernel->booted(static function (TestCore $core){
121 121
             $core->getContainer()->bind('cde', 'foo');
122 122
         });
123 123
 
124
-        $kernel->booted( static function (TestCore $core) {
124
+        $kernel->booted(static function (TestCore $core){
125 125
             $core->getContainer()->bind('def', 'foo');
126 126
         });
127 127
 
@@ -154,19 +154,19 @@  discard block
 block discarded – undo
154 154
             'root' => __DIR__,
155 155
         ]);
156 156
 
157
-        $kernel->appBooting(static function (TestCore $core) {
157
+        $kernel->appBooting(static function (TestCore $core){
158 158
             $core->getContainer()->bind('abc', 'foo');
159 159
         });
160 160
 
161
-        $kernel->appBooting(static function (TestCore $core) {
161
+        $kernel->appBooting(static function (TestCore $core){
162 162
             $core->getContainer()->bind('bcd', 'foo');
163 163
         });
164 164
 
165
-        $kernel->appBooted( static function (TestCore $core) {
165
+        $kernel->appBooted(static function (TestCore $core){
166 166
             $core->getContainer()->bind('cde', 'foo');
167 167
         });
168 168
 
169
-        $kernel->appBooted( static function (TestCore $core) {
169
+        $kernel->appBooted(static function (TestCore $core){
170 170
             $core->getContainer()->bind('def', 'foo');
171 171
         });
172 172
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
     public function testEventsShouldBeDispatched(): void
197 197
     {
198
-        $testDispatcher = new class implements DispatcherInterface {
198
+        $testDispatcher = new class implements DispatcherInterface{
199 199
             public function canServe(): bool
200 200
             {
201 201
                 return true;
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             }
207 207
         };
208 208
         $container = new Container();
209
-        $kernel = TestCore::create(directories: ['root' => __DIR__,], container: $container)
209
+        $kernel = TestCore::create(directories: ['root' => __DIR__, ], container: $container)
210 210
             ->addDispatcher($testDispatcher);
211 211
 
212 212
         $dispatcher = $this->createMock(EventDispatcherInterface::class);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     public function testDispatcherNotFoundEventShouldBeDispatched(): void
228 228
     {
229 229
         $container = new Container();
230
-        $kernel = TestCore::create(directories: ['root' => __DIR__,], container: $container);
230
+        $kernel = TestCore::create(directories: ['root' => __DIR__, ], container: $container);
231 231
 
232 232
         $dispatcher = $this->createMock(EventDispatcherInterface::class);
233 233
         $dispatcher
Please login to merge, or discard this patch.
Braces   +22 added lines, -11 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@  discard block
 block discarded – undo
42 42
             'root' => __DIR__,
43 43
         ])->run();
44 44
 
45
-        $d = new class() implements DispatcherInterface {
45
+        $d = new class() implements DispatcherInterface
46
+        {
46 47
             public $fired = false;
47 48
 
48 49
             public function canServe(): bool
@@ -71,7 +72,8 @@  discard block
 block discarded – undo
71 72
             'root' => __DIR__,
72 73
         ])->run();
73 74
 
74
-        $d = new class() implements DispatcherInterface {
75
+        $d = new class() implements DispatcherInterface
76
+        {
75 77
             public function canServe(): bool
76 78
             {
77 79
                 return true;
@@ -109,19 +111,23 @@  discard block
 block discarded – undo
109 111
             'root' => __DIR__,
110 112
         ]);
111 113
 
112
-        $kernel->booting(static function (TestCore $core) {
114
+        $kernel->booting(static function (TestCore $core)
115
+        {
113 116
             $core->getContainer()->bind('abc', 'foo');
114 117
         });
115 118
 
116
-        $kernel->booting(static function (TestCore $core) {
119
+        $kernel->booting(static function (TestCore $core)
120
+        {
117 121
             $core->getContainer()->bind('bcd', 'foo');
118 122
         });
119 123
 
120
-        $kernel->booted( static function (TestCore $core) {
124
+        $kernel->booted( static function (TestCore $core)
125
+        {
121 126
             $core->getContainer()->bind('cde', 'foo');
122 127
         });
123 128
 
124
-        $kernel->booted( static function (TestCore $core) {
129
+        $kernel->booted( static function (TestCore $core)
130
+        {
125 131
             $core->getContainer()->bind('def', 'foo');
126 132
         });
127 133
 
@@ -154,19 +160,23 @@  discard block
 block discarded – undo
154 160
             'root' => __DIR__,
155 161
         ]);
156 162
 
157
-        $kernel->appBooting(static function (TestCore $core) {
163
+        $kernel->appBooting(static function (TestCore $core)
164
+        {
158 165
             $core->getContainer()->bind('abc', 'foo');
159 166
         });
160 167
 
161
-        $kernel->appBooting(static function (TestCore $core) {
168
+        $kernel->appBooting(static function (TestCore $core)
169
+        {
162 170
             $core->getContainer()->bind('bcd', 'foo');
163 171
         });
164 172
 
165
-        $kernel->appBooted( static function (TestCore $core) {
173
+        $kernel->appBooted( static function (TestCore $core)
174
+        {
166 175
             $core->getContainer()->bind('cde', 'foo');
167 176
         });
168 177
 
169
-        $kernel->appBooted( static function (TestCore $core) {
178
+        $kernel->appBooted( static function (TestCore $core)
179
+        {
170 180
             $core->getContainer()->bind('def', 'foo');
171 181
         });
172 182
 
@@ -195,7 +205,8 @@  discard block
 block discarded – undo
195 205
 
196 206
     public function testEventsShouldBeDispatched(): void
197 207
     {
198
-        $testDispatcher = new class implements DispatcherInterface {
208
+        $testDispatcher = new class implements DispatcherInterface
209
+        {
199 210
             public function canServe(): bool
200 211
             {
201 212
                 return true;
Please login to merge, or discard this patch.