Passed
Pull Request — master (#451)
by Kirill
09:09 queued 24s
created
src/Scaffolder/tests/Command/Database/EntityTest.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
     public function testScaffold(): void
34 34
     {
35 35
         $line = __LINE__;
36
-        $className = self::CLASS_NAME . $line;
36
+        $className = self::CLASS_NAME.$line;
37 37
         $this->console()->run('create:entity', [
38
-            'name'    => 'sample' . $line,
38
+            'name'    => 'sample'.$line,
39 39
             '--field' => [
40 40
                 'id:primary',
41 41
                 'value:int'
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function testAccessibility(int $line, ?string $accessibility, string $modifier): void
107 107
     {
108
-        $className = self::CLASS_NAME . $line;
108
+        $className = self::CLASS_NAME.$line;
109 109
         $input = [
110
-            'name'    => 'sample' . $line,
110
+            'name'    => 'sample'.$line,
111 111
             '--field' => [
112 112
                 'id:primary',
113 113
             ],
114 114
         ];
115
-        if (!empty($accessibility)) {
115
+        if (!empty($accessibility)){
116 116
             $input['--accessibility'] = $accessibility;
117 117
         }
118 118
 
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function testAccessors(int $line, ?string $accessibility, bool $hasAccessors): void
155 155
     {
156
-        $className = self::CLASS_NAME . $line;
156
+        $className = self::CLASS_NAME.$line;
157 157
         $input = [
158
-            'name'    => 'sample' . $line,
158
+            'name'    => 'sample'.$line,
159 159
             '--field' => [
160 160
                 'id:primary',
161 161
                 'name:string',
162 162
             ],
163 163
         ];
164
-        if (!empty($accessibility)) {
164
+        if (!empty($accessibility)){
165 165
             $input['--accessibility'] = $accessibility;
166 166
         }
167 167
 
@@ -173,16 +173,16 @@  discard block
 block discarded – undo
173 173
         $reflection = new ReflectionClass($className);
174 174
 
175 175
         $methods = [];
176
-        foreach ($reflection->getMethods() as $method) {
176
+        foreach ($reflection->getMethods() as $method){
177 177
             $methods[] = $method->getName();
178 178
         }
179 179
 
180
-        if ($hasAccessors) {
180
+        if ($hasAccessors){
181 181
             $this->assertContains('getId', $methods);
182 182
             $this->assertContains('getName', $methods);
183 183
             $this->assertContains('setId', $methods);
184 184
             $this->assertContains('setName', $methods);
185
-        } else {
185
+        }else{
186 186
             $this->assertNotContains('getId', $methods);
187 187
             $this->assertNotContains('setId', $methods);
188 188
             $this->assertNotContains('setId', $methods);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         clearstatcache();
227 227
         $this->assertEquals($exists, class_exists($repositoryClassName));
228 228
 
229
-        if ($exists) {
229
+        if ($exists){
230 230
             $reflection = new ReflectionClass($className);
231 231
             $source = $this->files()->read($reflection->getFileName());
232 232
 
@@ -243,14 +243,14 @@  discard block
 block discarded – undo
243 243
         $line2 = __LINE__;
244 244
         $line3 = __LINE__;
245 245
 
246
-        $repositoryClassName1 = trimPostfix(self::REPOSITORY_CLASS_NAME, 'repository') . $line1 . 'Repository';
247
-        $repositoryClassName2 = trimPostfix(self::REPOSITORY_CLASS_NAME, 'repository') . $line2 . 'Repository';
248
-        $repositoryClassName3 = trimPostfix(self::REPOSITORY_CLASS_NAME, 'repository') . $line3 . 'Repository';
246
+        $repositoryClassName1 = trimPostfix(self::REPOSITORY_CLASS_NAME, 'repository').$line1.'Repository';
247
+        $repositoryClassName2 = trimPostfix(self::REPOSITORY_CLASS_NAME, 'repository').$line2.'Repository';
248
+        $repositoryClassName3 = trimPostfix(self::REPOSITORY_CLASS_NAME, 'repository').$line3.'Repository';
249 249
 
250 250
         return [
251
-            [self::CLASS_NAME . $line1, 'sample' . $line1, $repositoryClassName1, 'sample', true],
252
-            [self::CLASS_NAME . $line2, 'sample' . $line2, $repositoryClassName2, 'repository', true],
253
-            [self::CLASS_NAME . $line3, 'sample' . $line3, $repositoryClassName3, '', false],
251
+            [self::CLASS_NAME.$line1, 'sample'.$line1, $repositoryClassName1, 'sample', true],
252
+            [self::CLASS_NAME.$line2, 'sample'.$line2, $repositoryClassName2, 'repository', true],
253
+            [self::CLASS_NAME.$line3, 'sample'.$line3, $repositoryClassName3, '', false],
254 254
         ];
255 255
     }
256 256
 
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
     public function testAnnotated(): void
262 262
     {
263 263
         $line = __LINE__;
264
-        $className = self::CLASS_NAME . $line;
264
+        $className = self::CLASS_NAME.$line;
265 265
         $this->console()->run('create:entity', [
266
-            'name'       => 'sample' . $line,
266
+            'name'       => 'sample'.$line,
267 267
             '--field'    => [
268 268
                 'id:primary',
269 269
                 'myValue:?int'
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
      */
301 301
     public function testAnnotatedInflection(int $line, string $inflection, string $needle): void
302 302
     {
303
-        $className = self::CLASS_NAME . $line;
303
+        $className = self::CLASS_NAME.$line;
304 304
         $this->console()->run('create:entity', [
305
-            'name'         => 'sample' . $line,
305
+            'name'         => 'sample'.$line,
306 306
             '--field'      => [
307 307
                 'id:primary',
308 308
                 'myValue:int',
@@ -330,10 +330,10 @@  discard block
 block discarded – undo
330 330
     public function inflectionDataProvider(): array
331 331
     {
332 332
         return [
333
-            [__LINE__ + random_int(101, 200), 'tableize', 'my_value'],
334
-            [__LINE__ + random_int(101, 200), 't', 'my_value'],
335
-            [__LINE__ + random_int(201, 300), 'camelize', 'myAnotherValue'],
336
-            [__LINE__ + random_int(201, 300), 'c', 'myAnotherValue'],
333
+            [__LINE__ +random_int(101, 200), 'tableize', 'my_value'],
334
+            [__LINE__ +random_int(101, 200), 't', 'my_value'],
335
+            [__LINE__ +random_int(201, 300), 'camelize', 'myAnotherValue'],
336
+            [__LINE__ +random_int(201, 300), 'c', 'myAnotherValue'],
337 337
         ];
338 338
     }
339 339
 }
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,7 +112,8 @@  discard block
 block discarded – undo
112 112
                 'id:primary',
113 113
             ],
114 114
         ];
115
-        if (!empty($accessibility)) {
115
+        if (!empty($accessibility))
116
+        {
116 117
             $input['--accessibility'] = $accessibility;
117 118
         }
118 119
 
@@ -161,7 +162,8 @@  discard block
 block discarded – undo
161 162
                 'name:string',
162 163
             ],
163 164
         ];
164
-        if (!empty($accessibility)) {
165
+        if (!empty($accessibility))
166
+        {
165 167
             $input['--accessibility'] = $accessibility;
166 168
         }
167 169
 
@@ -173,16 +175,20 @@  discard block
 block discarded – undo
173 175
         $reflection = new ReflectionClass($className);
174 176
 
175 177
         $methods = [];
176
-        foreach ($reflection->getMethods() as $method) {
178
+        foreach ($reflection->getMethods() as $method)
179
+        {
177 180
             $methods[] = $method->getName();
178 181
         }
179 182
 
180
-        if ($hasAccessors) {
183
+        if ($hasAccessors)
184
+        {
181 185
             $this->assertContains('getId', $methods);
182 186
             $this->assertContains('getName', $methods);
183 187
             $this->assertContains('setId', $methods);
184 188
             $this->assertContains('setName', $methods);
185
-        } else {
189
+        }
190
+        else
191
+        {
186 192
             $this->assertNotContains('getId', $methods);
187 193
             $this->assertNotContains('setId', $methods);
188 194
             $this->assertNotContains('setId', $methods);
@@ -226,7 +232,8 @@  discard block
 block discarded – undo
226 232
         clearstatcache();
227 233
         $this->assertEquals($exists, class_exists($repositoryClassName));
228 234
 
229
-        if ($exists) {
235
+        if ($exists)
236
+        {
230 237
             $reflection = new ReflectionClass($className);
231 238
             $source = $this->files()->read($reflection->getFileName());
232 239
 
Please login to merge, or discard this patch.
src/Scaffolder/tests/Command/AbstractCommandTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@
 block discarded – undo
24 24
      */
25 25
     protected function deleteDeclaration(string $class): void
26 26
     {
27
-        if (class_exists($class)) {
28
-            try {
27
+        if (class_exists($class)){
28
+            try{
29 29
                 $reflection = new ReflectionClass($class);
30 30
                 $this->files()->delete($reflection->getFileName());
31
-            } catch (Throwable $exception) {
31
+            }catch (Throwable $exception){
32 32
             }
33 33
         }
34 34
     }
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,11 +24,15 @@
 block discarded – undo
24 24
      */
25 25
     protected function deleteDeclaration(string $class): void
26 26
     {
27
-        if (class_exists($class)) {
28
-            try {
27
+        if (class_exists($class))
28
+        {
29
+            try
30
+            {
29 31
                 $reflection = new ReflectionClass($class);
30 32
                 $this->files()->delete($reflection->getFileName());
31
-            } catch (Throwable $exception) {
33
+            }
34
+            catch (Throwable $exception)
35
+            {
32 36
             }
33 37
         }
34 38
     }
Please login to merge, or discard this patch.
src/Scaffolder/tests/App/TestApp.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,18 +61,18 @@
 block discarded – undo
61 61
      */
62 62
     protected function mapDirectories(array $directories): array
63 63
     {
64
-        if (!isset($directories['root'])) {
64
+        if (!isset($directories['root'])){
65 65
             throw new Boot\Exception\BootException('Missing required directory `root`.');
66 66
         }
67 67
 
68
-        if (!isset($directories['app'])) {
69
-            $directories['app'] = $directories['root'] . '/';
68
+        if (!isset($directories['app'])){
69
+            $directories['app'] = $directories['root'].'/';
70 70
         }
71 71
 
72 72
         return array_merge([
73
-            'vendor'  => $directories['root'] . '/vendor/',
74
-            'runtime' => $directories['root'] . '/runtime/',
75
-            'config'  => $directories['app'] . '/config/'
73
+            'vendor'  => $directories['root'].'/vendor/',
74
+            'runtime' => $directories['root'].'/runtime/',
75
+            'config'  => $directories['app'].'/config/'
76 76
         ], $directories);
77 77
     }
78 78
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,11 +61,13 @@
 block discarded – undo
61 61
      */
62 62
     protected function mapDirectories(array $directories): array
63 63
     {
64
-        if (!isset($directories['root'])) {
64
+        if (!isset($directories['root']))
65
+        {
65 66
             throw new Boot\Exception\BootException('Missing required directory `root`.');
66 67
         }
67 68
 
68
-        if (!isset($directories['app'])) {
69
+        if (!isset($directories['app']))
70
+        {
69 71
             $directories['app'] = $directories['root'] . '/';
70 72
         }
71 73
 
Please login to merge, or discard this patch.
src/Scaffolder/tests/App/config/migration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 declare(strict_types=1);
15 15
 
16 16
 return [
17
-    'directory' => directory('app') . 'migrations/',
17
+    'directory' => directory('app').'migrations/',
18 18
     'database'  => 'runtime',
19 19
     'table'     => 'migrations',
20 20
     'safe'      => env('SPIRAL_ENV') === 'develop'
Please login to merge, or discard this patch.
src/Scaffolder/tests/App/config/database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     'connections' => [
34 34
         'runtime' => [
35 35
             'driver'     => SQLiteDriver::class,
36
-            'connection' => 'sqlite:' . directory('runtime') . 'runtime.db',
36
+            'connection' => 'sqlite:'.directory('runtime').'runtime.db',
37 37
             'profiling'  => env('DEBUG', false),
38 38
             'username'   => 'sqlite',
39 39
             'password'   => '',
Please login to merge, or discard this patch.
src/Scaffolder/tests/EntityPHP74Test.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
     public function testFromEntity(): void
27 27
     {
28 28
         $line = __LINE__;
29
-        $className = __NAMESPACE__ . "\\App\\Request\\Sample{$line}Request";
29
+        $className = __NAMESPACE__."\\App\\Request\\Sample{$line}Request";
30 30
         $output = $this->console()->run('create:filter', [
31
-            'name'     => 'sample' . $line,
31
+            'name'     => 'sample'.$line,
32 32
             '--entity' => SourceEntity74::class
33 33
         ]);
34 34
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
         $reflection = new ReflectionClass($className);
41 41
 
42
-        try {
42
+        try{
43 43
             $schema = $reflection->getConstant('SCHEMA');
44 44
             $this->assertSame('data:typedBool', $schema['typedBool']);
45 45
             $this->assertSame('data:noTypeString', $schema['noTypeString']);
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             $this->assertSame(['notEmpty', 'string'], $validates['obj']);
54 54
             $this->assertSame(['notEmpty', 'integer'], $validates['intFromPhpDoc']);
55 55
             $this->assertSame(['notEmpty', 'float'], $validates['noTypeWithFloatDefault']);
56
-        } finally {
56
+        }finally{
57 57
             $this->deleteDeclaration($className);
58 58
         }
59 59
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
         $reflection = new ReflectionClass($className);
41 41
 
42
-        try {
42
+        try
43
+        {
43 44
             $schema = $reflection->getConstant('SCHEMA');
44 45
             $this->assertSame('data:typedBool', $schema['typedBool']);
45 46
             $this->assertSame('data:noTypeString', $schema['noTypeString']);
@@ -53,7 +54,9 @@  discard block
 block discarded – undo
53 54
             $this->assertSame(['notEmpty', 'string'], $validates['obj']);
54 55
             $this->assertSame(['notEmpty', 'integer'], $validates['intFromPhpDoc']);
55 56
             $this->assertSame(['notEmpty', 'float'], $validates['noTypeWithFloatDefault']);
56
-        } finally {
57
+        }
58
+        finally
59
+        {
57 60
             $this->deleteDeclaration($className);
58 61
         }
59 62
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function testFromEntity(): void
27 27
     {
28 28
         $line = __LINE__;
29
-        $className = __NAMESPACE__ . "\\App\\Request\\Sample{$line}Request";
29
+        $className = __NAMESPACE__ . "\\App\\Request\\Sample{$line}request";
30 30
         $output = $this->console()->run('create:filter', [
31 31
             'name'     => 'sample' . $line,
32 32
             '--entity' => SourceEntity74::class
Please login to merge, or discard this patch.
src/DataGrid/src/Input/ArrayInput.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
         $input = clone $this;
39 39
 
40 40
         $namespace = trim($namespace);
41
-        if ($namespace === '') {
41
+        if ($namespace === ''){
42 42
             return $input;
43 43
         }
44 44
 
45 45
         $input->data = [];
46 46
 
47 47
         $data = $this->getValue($namespace, []);
48
-        if (is_array($data)) {
48
+        if (is_array($data)){
49 49
             $input->data = $data;
50 50
         }
51 51
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function getValue(string $option, $default = null)
59 59
     {
60
-        if (!$this->hasValue($option)) {
60
+        if (!$this->hasValue($option)){
61 61
             return $default;
62 62
         }
63 63
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,14 +38,16 @@  discard block
 block discarded – undo
38 38
         $input = clone $this;
39 39
 
40 40
         $namespace = trim($namespace);
41
-        if ($namespace === '') {
41
+        if ($namespace === '')
42
+        {
42 43
             return $input;
43 44
         }
44 45
 
45 46
         $input->data = [];
46 47
 
47 48
         $data = $this->getValue($namespace, []);
48
-        if (is_array($data)) {
49
+        if (is_array($data))
50
+        {
49 51
             $input->data = $data;
50 52
         }
51 53
 
@@ -57,7 +59,8 @@  discard block
 block discarded – undo
57 59
      */
58 60
     public function getValue(string $option, $default = null)
59 61
     {
60
-        if (!$this->hasValue($option)) {
62
+        if (!$this->hasValue($option))
63
+        {
61 64
             return $default;
62 65
         }
63 66
 
Please login to merge, or discard this patch.
src/DataGrid/src/GridSchema.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function addFilter(string $name, FilterInterface $filter): void
42 42
     {
43
-        if ($this->hasFilter($name)) {
43
+        if ($this->hasFilter($name)){
44 44
             throw new SchemaException("Filter `$name` is already defined");
45 45
         }
46 46
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function getFilter(string $name): FilterInterface
67 67
     {
68
-        if (!$this->hasFilter($name)) {
68
+        if (!$this->hasFilter($name)){
69 69
             throw new SchemaException("No such filter `$name`");
70 70
         }
71 71
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function addSorter(string $name, SorterInterface $sorter): void
91 91
     {
92
-        if ($this->hasSorter($name)) {
92
+        if ($this->hasSorter($name)){
93 93
             throw new SchemaException("Sorter `$name` is already defined");
94 94
         }
95 95
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function getSorter(string $name): SorterInterface
116 116
     {
117
-        if (!$this->hasSorter($name)) {
117
+        if (!$this->hasSorter($name)){
118 118
             throw new SchemaException("No such sorter `$name`");
119 119
         }
120 120
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function addFilter(string $name, FilterInterface $filter): void
42 42
     {
43
-        if ($this->hasFilter($name)) {
43
+        if ($this->hasFilter($name))
44
+        {
44 45
             throw new SchemaException("Filter `$name` is already defined");
45 46
         }
46 47
 
@@ -65,7 +66,8 @@  discard block
 block discarded – undo
65 66
      */
66 67
     public function getFilter(string $name): FilterInterface
67 68
     {
68
-        if (!$this->hasFilter($name)) {
69
+        if (!$this->hasFilter($name))
70
+        {
69 71
             throw new SchemaException("No such filter `$name`");
70 72
         }
71 73
 
@@ -89,7 +91,8 @@  discard block
 block discarded – undo
89 91
      */
90 92
     public function addSorter(string $name, SorterInterface $sorter): void
91 93
     {
92
-        if ($this->hasSorter($name)) {
94
+        if ($this->hasSorter($name))
95
+        {
93 96
             throw new SchemaException("Sorter `$name` is already defined");
94 97
         }
95 98
 
@@ -114,7 +117,8 @@  discard block
 block discarded – undo
114 117
      */
115 118
     public function getSorter(string $name): SorterInterface
116 119
     {
117
-        if (!$this->hasSorter($name)) {
120
+        if (!$this->hasSorter($name))
121
+        {
118 122
             throw new SchemaException("No such sorter `$name`");
119 123
         }
120 124
 
Please login to merge, or discard this patch.
src/DataGrid/src/Specification/Sorter/SorterSet.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $sorter = clone $this;
37 37
         $sorter->sorters = [];
38 38
 
39
-        foreach ($this->sorters as $s) {
39
+        foreach ($this->sorters as $s){
40 40
             $sorter->sorters[] = $s->withDirection($direction);
41 41
         }
42 42
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@
 block discarded – undo
36 36
         $sorter = clone $this;
37 37
         $sorter->sorters = [];
38 38
 
39
-        foreach ($this->sorters as $s) {
39
+        foreach ($this->sorters as $s)
40
+        {
40 41
             $sorter->sorters[] = $s->withDirection($direction);
41 42
         }
42 43
 
Please login to merge, or discard this patch.