Passed
Push — master ( 6daab3...a0d881 )
by Bruno
10:37 queued 48s
created
Modelarium/Laravel/Targets/PolicyGenerator.php 2 patches
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -65,24 +65,24 @@
 block discarded – undo
65 65
         $model = $field->type->name; /** @phpstan-ignore-line */;
66 66
         foreach ($directive->arguments as $arg) {
67 67
             switch ($arg->name->value) {
68
-                case 'ability':
69
-                    // @phpstan-ignore-next-line
70
-                    $ability = $arg->value->value;
71
-                break;
72
-                case 'find':
73
-                    // @phpstan-ignore-next-line
74
-                    $find = $arg->value->value;
75
-                break;
76
-                case 'model':
77
-                    // @phpstan-ignore-next-line
78
-                    $model = $arg->value->value;
79
-                break;
80
-                case 'injectArgs':
81
-                    $injected = ', array $injectedArgs';
82
-                break;
83
-                case 'args':
84
-                    $args = ', array $staticArgs';
85
-                break;
68
+            case 'ability':
69
+                // @phpstan-ignore-next-line
70
+                $ability = $arg->value->value;
71
+            break;
72
+            case 'find':
73
+                // @phpstan-ignore-next-line
74
+                $find = $arg->value->value;
75
+            break;
76
+            case 'model':
77
+                // @phpstan-ignore-next-line
78
+                $model = $arg->value->value;
79
+            break;
80
+            case 'injectArgs':
81
+                $injected = ', array $injectedArgs';
82
+            break;
83
+            case 'args':
84
+                $args = ', array $staticArgs';
85
+            break;
86 86
             }
87 87
         }
88 88
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     public function generate(): GeneratedCollection
31 31
     {
32 32
         return new GeneratedCollection(
33
-            [ new GeneratedItem(
33
+            [new GeneratedItem(
34 34
                 GeneratedItem::TYPE_POLICY,
35 35
                 $this->generateString(),
36 36
                 $this->getGenerateFilename()
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
     public function generateString(): string
147 147
     {
148
-        return $this->stubToString('policy', function ($stub) {
148
+        return $this->stubToString('policy', function($stub) {
149 149
             foreach ($this->type->getFields() as $field) {
150 150
                 $directives = $field->astNode->directives;
151 151
                 $this->processDirectives($field, $directives);
@@ -168,6 +168,6 @@  discard block
 block discarded – undo
168 168
 
169 169
     public function getGenerateFilename(): string
170 170
     {
171
-        return $this->getBasePath('app/Policies/'. $this->studlyName . 'Policy.php');
171
+        return $this->getBasePath('app/Policies/' . $this->studlyName . 'Policy.php');
172 172
     }
173 173
 }
Please login to merge, or discard this patch.
Modelarium/Laravel/Targets/EventGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     {
35 35
         return new GeneratedItem(
36 36
             $name,
37
-            $this->stubToString('event', function ($stub) use ($name, $type) {
37
+            $this->stubToString('event', function($stub) use ($name, $type) {
38 38
                 $eventTokens = explode('\\', $name);
39 39
                 $eventClassName = array_pop($eventTokens);
40 40
                 $eventNamespace = implode('\\', $eventTokens);
Please login to merge, or discard this patch.
Modelarium/Laravel/Targets/SeedGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     public function generate(): GeneratedCollection
11 11
     {
12 12
         return new GeneratedCollection(
13
-            [ new GeneratedItem(
13
+            [new GeneratedItem(
14 14
                 GeneratedItem::TYPE_SEED,
15 15
                 $this->generateString(),
16 16
                 $this->getGenerateFilename()
@@ -25,6 +25,6 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function getGenerateFilename(): string
27 27
     {
28
-        return $this->getBasePath('database/seeds/'. $this->studlyName . 'Seeder.php');
28
+        return $this->getBasePath('database/seeds/' . $this->studlyName . 'Seeder.php');
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
Modelarium/GeneratedCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     public function filterByType(string $type): GeneratedCollection
10 10
     {
11 11
         return $this->filter(
12
-            function ($i) use ($type) {
12
+            function($i) use ($type) {
13 13
                 return $i->type == $type;
14 14
             }
15 15
         );
Please login to merge, or discard this patch.
Modelarium/Laravel/Targets/FactoryGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     public function generate(): GeneratedCollection
11 11
     {
12 12
         return new GeneratedCollection(
13
-            [ new GeneratedItem(
13
+            [new GeneratedItem(
14 14
                 GeneratedItem::TYPE_FACTORY,
15 15
                 $this->generateString(),
16 16
                 $this->getGenerateFilename()
@@ -25,6 +25,6 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function getGenerateFilename(): string
27 27
     {
28
-        return $this->getBasePath('database/factories/'. $this->studlyName . 'Factory.php');
28
+        return $this->getBasePath('database/factories/' . $this->studlyName . 'Factory.php');
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
Modelarium/Types/FormulariumScalarType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
                     throw new Exception("Directive $validator does not have argument $argName");
107 107
                 }
108 108
                 if ($argValidator->type === 'Int') {
109
-                    $argValue = (int)$argValue;
109
+                    $argValue = (int) $argValue;
110 110
                 }
111 111
                 $arguments[$argName] = $argValue;
112 112
             }
Please login to merge, or discard this patch.
Modelarium/Parser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $originalTypeLoader = $this->schema->getConfig()->typeLoader;
155 155
 
156
-        $this->schema->getConfig()->typeLoader = function ($typeName) use ($originalTypeLoader) {
156
+        $this->schema->getConfig()->typeLoader = function($typeName) use ($originalTypeLoader) {
157 157
             $type = $originalTypeLoader($typeName);
158 158
             if ($type instanceof \GraphQL\Type\Definition\CustomScalarType) {
159 159
                 $scalarName = $type->name;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     {
169 169
         $this->ast = Visitor::visit($this->ast, [
170 170
             // load the scalar type classes
171
-            NodeKind::SCALAR_TYPE_DEFINITION => function ($node) {
171
+            NodeKind::SCALAR_TYPE_DEFINITION => function($node) {
172 172
                 $scalarName = $node->name->value;
173 173
 
174 174
                 // load classes
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             return [];
226 226
         }
227 227
         return array_map(
228
-            function ($i) use ($basedir) {
228
+            function($i) use ($basedir) {
229 229
                 if ($i[1] === 'formularium.graphql') {
230 230
                     return \Safe\file_get_contents(__DIR__ . '/Types/Graphql/scalars.graphql');
231 231
                 }
Please login to merge, or discard this patch.
Modelarium/Laravel/Targets/MigrationGenerator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
             $name = $directive->name->value;
293 293
             switch ($name) {
294 294
             case 'migrationSoftDeletes':
295
-                $this->createCode[] ='$table->softDeletes();';
295
+                $this->createCode[] = '$table->softDeletes();';
296 296
                 break;
297 297
             case 'migrationPrimaryIndex':
298 298
                 // TODO
@@ -307,10 +307,10 @@  discard block
 block discarded – undo
307 307
                 if (!count($indexFields)) {
308 308
                     throw new Exception("You must provide at least one field to an index");
309 309
                 }
310
-                $this->createCode[] ='$table->index("' . implode('", "', $indexFields) .'");';
310
+                $this->createCode[] = '$table->index("' . implode('", "', $indexFields) . '");';
311 311
                 break;
312 312
             case 'migrationSpatialIndex':
313
-                $this->createCode[] ='$table->spatialIndex("' . $directive->arguments[0]->value->value .'");';
313
+                $this->createCode[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value . '");';
314 314
                 break;
315 315
 
316 316
             case 'migrationFulltextIndex':
@@ -331,10 +331,10 @@  discard block
 block discarded – undo
331 331
                     "\")');";
332 332
                 break;
333 333
             case 'migrationRememberToken':
334
-                $this->createCode[] ='$table->rememberToken();';
334
+                $this->createCode[] = '$table->rememberToken();';
335 335
                 break;
336 336
             case 'migrationTimestamps':
337
-                $this->createCode[] ='$table->timestamps();';
337
+                $this->createCode[] = '$table->timestamps();';
338 338
                 break;
339 339
             default:
340 340
             }
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 
344 344
     public function generateString(): string
345 345
     {
346
-        return $this->stubToString('migration', function ($stub) {
346
+        return $this->stubToString('migration', function($stub) {
347 347
             foreach ($this->type->getFields() as $field) {
348 348
                 $directives = $field->astNode->directives;
349 349
                 if (
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 
416 416
     public function generateManyToManyTable(string $type1, string $type2): GeneratedItem
417 417
     {
418
-        $contents = $this->stubToString('migration', function ($stub) use ($type1, $type2) {
418
+        $contents = $this->stubToString('migration', function($stub) use ($type1, $type2) {
419 419
             $code = <<<EOF
420 420
 
421 421
             \$table->increments("id");
Please login to merge, or discard this patch.
Modelarium/Laravel/ServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
         Event::listen(
30 30
             RegisterDirectiveNamespaces::class,
31
-            function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string {
31
+            function(RegisterDirectiveNamespaces $registerDirectiveNamespaces): string {
32 32
                 return 'Modelarium\\Laravel\\Lighthouse\\Directives';
33 33
             }
34 34
         );
Please login to merge, or discard this patch.