Passed
Push — master ( 3d9bd4...840640 )
by Bruno
09:55
created
Modelarium/Laravel/Console/Commands/ModelariumFrontendCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $writtenFiles = $this->writeFiles(
82 82
             $collection,
83 83
             $basepath,
84
-            (bool)$this->option('overwrite')
84
+            (bool) $this->option('overwrite')
85 85
         );
86 86
         $this->info('Files generated.');
87 87
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             // this runs all prettier commands in parallel.
98 98
             $run = array_reduce(
99 99
                 $writtenFiles,
100
-                function ($carry, $f) use ($command) {
100
+                function($carry, $f) use ($command) {
101 101
                     return $carry . '(' . $command . $f . ') & ';
102 102
                 }
103 103
             );
Please login to merge, or discard this patch.
Modelarium/Laravel/Console/Commands/ModelariumTypeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
         $target = base_path('graphql/data/' . $this->lowerName . '.graphql');
70 70
         $this->writeFile(
71 71
             $target,
72
-            (bool)$this->option('overwrite'),
72
+            (bool) $this->option('overwrite'),
73 73
             $graphql
74 74
         );
75 75
         $this->info('Type generated at ' . $target);
Please login to merge, or discard this patch.
Modelarium/Util.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      */
47 47
     public static function scalars(array $datatypes, string $ns): array
48 48
     {
49
-        $graphql = [ '# File automatically generated by Modelarium on ' . date('c') . "\n\n" ];
49
+        $graphql = ['# File automatically generated by Modelarium on ' . date('c') . "\n\n"];
50 50
 
51 51
         foreach ($datatypes as $name) {
52 52
             $typeName = Str::studly($name);
Please login to merge, or discard this patch.
Modelarium/Types/FormulariumScalarType.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
     {
53 53
         try {
54 54
             return $this->datatype->validate($value);
55
-        }
56
-        catch (ValidatorException $e) {
55
+        } catch (ValidatorException $e) {
57 56
             throw new Error($e->getMessage());
58 57
         }
59 58
     }
Please login to merge, or discard this patch.
Modelarium/Laravel/ServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,13 +45,13 @@
 block discarded – undo
45 45
 
46 46
         Event::listen(
47 47
             RegisterDirectiveNamespaces::class,
48
-            function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string {
48
+            function(RegisterDirectiveNamespaces $registerDirectiveNamespaces): string {
49 49
                 return 'Modelarium\\Laravel\\Lighthouse\\Directives';
50 50
             }
51 51
         );
52 52
         Event::listen(
53 53
             RegisterDirectiveNamespaces::class,
54
-            function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string {
54
+            function(RegisterDirectiveNamespaces $registerDirectiveNamespaces): string {
55 55
                 return 'App\\Datatypes\\Types';
56 56
             }
57 57
         );
Please login to merge, or discard this patch.
Modelarium/Laravel/Lighthouse/Directives/MinLengthDirective.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $previousResolver = $fieldValue->getResolver();
44 44
 
45 45
         // Wrap around the resolver
46
-        $wrappedResolver = function ($root, array $args, GraphQLContext $context, ResolveInfo $info) use ($previousResolver): string {
46
+        $wrappedResolver = function($root, array $args, GraphQLContext $context, ResolveInfo $info) use ($previousResolver): string {
47 47
             // Call the resolver, passing along the resolver arguments
48 48
             /** @var string $result */
49 49
             $result = $previousResolver($root, $args, $context, $info);
Please login to merge, or discard this patch.
Modelarium/Frontend/FrontendGenerator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
         // $blade = FrameworkComposer::getByName('Blade');
88 88
 
89 89
         if ($vue !== null) {
90
-            $cardFieldNames = array_map(function (Field $f) {
90
+            $cardFieldNames = array_map(function(Field $f) {
91 91
                 return $f->getName();
92 92
             }, $this->cardFields);
93
-            $tableFieldNames = array_map(function (Field $f) {
93
+            $tableFieldNames = array_map(function(Field $f) {
94 94
                 return $f->getName();
95 95
             }, $this->tableFields);
96 96
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
     protected function buildTemplateParameters(): void
143 143
     {
144 144
         $this->cardFields = $this->model->filterField(
145
-            function (Field $field) {
145
+            function(Field $field) {
146 146
                 return $field->getRenderable('card', false);
147 147
             }
148 148
         );
149 149
         $this->tableFields = $this->model->filterField(
150
-            function (Field $field) {
150
+            function(Field $field) {
151 151
                 return $field->getRenderable('table', false);
152 152
             }
153 153
         );
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             'Button',
160 160
             [
161 161
                 Button::TYPE => 'a',
162
-                Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit" ],
162
+                Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit"],
163 163
             ]
164 164
         )->setContent(
165 165
             '<i class="fa fa-plus"></i> Add new',
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             'Table',
203 203
             [
204 204
                 Table::ROW_NAMES => array_map(
205
-                    function (Field $field) {
205
+                    function(Field $field) {
206 206
                         return $field->getRenderable(Renderable::LABEL, $field->getName());
207 207
                     },
208 208
                     $this->tableFields
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             true
221 221
         );
222 222
         $titleFields = $this->model->filterField(
223
-            function (Field $field) {
223
+            function(Field $field) {
224 224
                 return $field->getRenderable('title', false);
225 225
             }
226 226
         );
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
             // TODO 'hasCan' => $this->model
246 246
             'spinner' => $spinner,
247 247
             'tablelist' => $table->getRenderHTML(),
248
-            'tableItemFields' => array_keys(array_map(function (Field $f) {
248
+            'tableItemFields' => array_keys(array_map(function(Field $f) {
249 249
                 return $f->getName();
250 250
             }, $this->tableFields)),
251 251
             'titleField' => array_key_first($titleFields) ?: 'id'
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
         if ($mode == 'editable') {
275 275
             $vue->setEditableTemplate(
276
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
276
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
277 277
                     return $this->templateCallback($stub, $vue, $data, $m);
278 278
                 }
279 279
             );
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
             );
288 288
         } else {
289 289
             $vue->setViewableTemplate(
290
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
290
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
291 291
                     return $this->templateCallback($stub, $vue, $data, $m);
292 292
                 }
293 293
             );
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
          * card
315 315
          */
316 316
         $cardFieldNames = array_map(
317
-            function (Field $field) {
317
+            function(Field $field) {
318 318
                 return $field->getName();
319 319
             },
320 320
             $this->cardFields
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
          * table
351 351
          */
352 352
         $tableFieldNames = array_map(
353
-            function (Field $field) {
353
+            function(Field $field) {
354 354
                 return $field->getName();
355 355
             },
356 356
             $this->tableFields
@@ -448,14 +448,14 @@  discard block
 block discarded – undo
448 448
         ];
449 449
 
450 450
         $import = array_map(
451
-            function ($i) use ($name) {
451
+            function($i) use ($name) {
452 452
                 return "import {$name}$i from './{$name}$i.vue';";
453 453
             },
454 454
             $items
455 455
         );
456 456
 
457 457
         $export = array_map(
458
-            function ($i) use ($name) {
458
+            function($i) use ($name) {
459 459
                 return "    {$name}$i,\n";
460 460
             },
461 461
             $items
Please login to merge, or discard this patch.
Modelarium/Laravel/Console/Commands/ModelariumScaffoldCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $files = $processor->getCollection();
92 92
         if ($name && $name !== '*' && $name !== 'all') {
93 93
             $files = $files->filter(
94
-                function (GeneratedItem $g) use ($name) {
94
+                function(GeneratedItem $g) use ($name) {
95 95
                     return mb_stripos($g->filename, $name);
96 96
                 }
97 97
             );
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $this->writeFiles(
101 101
             $files,
102 102
             base_path(),
103
-            (bool)$this->option('overwrite')
103
+            (bool) $this->option('overwrite')
104 104
         );
105 105
         $this->info('Finished scaffolding. You might want to run `composer dump-autoload`');
106 106
     }
Please login to merge, or discard this patch.