Passed
Push — 2.x ( ba8025...66fa7c )
by Quentin
07:23
created
src/Commands/ListBlocks.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $this->blockCollection
49 49
             ->getMissingDirectories()
50
-            ->each(function ($directory) {
50
+            ->each(function($directory) {
51 51
                 $this->error("Directory not found: {$directory}");
52 52
             });
53 53
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         return $blockCollection
62 62
             ->first()
63 63
             ->keys()
64
-            ->map(function ($key) {
64
+            ->map(function($key) {
65 65
                 return Str::studly($key);
66 66
             })
67 67
             ->toArray();
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 
82 82
         return $this->blockCollection
83 83
             ->collect()
84
-            ->reject(function (Block $block) use ($sourceFiltered) {
84
+            ->reject(function(Block $block) use ($sourceFiltered) {
85 85
                 return $sourceFiltered && !$this->option($block->source);
86 86
             })
87
-            ->reject(function (Block $block) use ($typeFiltered) {
87
+            ->reject(function(Block $block) use ($typeFiltered) {
88 88
                 return $this->dontPassTextFilter($block) ||
89 89
                     ($typeFiltered &&
90 90
                     !$this->option(Str::plural($block->type)));
91 91
             })
92
-            ->map(function (Block $block) {
92
+            ->map(function(Block $block) {
93 93
                 return $this->colorize(
94 94
                     $this->option('short') ? $block->toShortList() : $block->toList()
95 95
                 );
96 96
             })
97
-            ->sortBy(function ($block) {
97
+            ->sortBy(function($block) {
98 98
                 return [$block['group'], $block['title']];
99 99
             });
100 100
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         if (filled($filter = $this->argument('filter'))) {
153 153
             return !$block
154 154
                 ->toList()
155
-                ->reduce(function ($keep, $element) use ($filter) {
155
+                ->reduce(function($keep, $element) use ($filter) {
156 156
                     return $keep ||
157 157
                     Str::contains(
158 158
                         Str::lower($element),
Please login to merge, or discard this patch.
src/Services/Blocks/BlockMaker.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 
354 354
         return collect(
355 355
             config('twill.block_editor.directories.source.icons')
356
-        )->reduce(function ($keep, $path) use ($icon) {
356
+        )->reduce(function($keep, $path) use ($icon) {
357 357
             if ($keep) {
358 358
                 return $keep;
359 359
             }
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
                 return null;
363 363
             }
364 364
 
365
-            return collect($this->files->files($path))->reduce(function ($keep, SplFileInfo $file) use ($icon) {
365
+            return collect($this->files->files($path))->reduce(function($keep, SplFileInfo $file) use ($icon) {
366 366
                 if ($keep) {
367 367
                     return $keep;
368 368
                 }
Please login to merge, or discard this patch.
src/Repositories/BlockRepository.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
         if (Schema::hasTable(config('twill.related_table', 'twill_related'))) {
47 47
             $relatedItems = Collection::make();
48 48
 
49
-            Collection::make($fields['browsers'])->each(function ($items, $browserName) use (&$relatedItems) {
50
-                Collection::make($items)->each(function ($item) use ($browserName, &$relatedItems) {
49
+            Collection::make($fields['browsers'])->each(function($items, $browserName) use (&$relatedItems) {
50
+                Collection::make($items)->each(function($item) use ($browserName, &$relatedItems) {
51 51
                     try {
52 52
                         $repository = $this->getModelRepository($item['endpointType'] ?? $browserName);
53 53
                         $relatedItems->push((object) [
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     {
76 76
         if (Schema::hasTable(config('twill.related_table', 'twill_related'))) {
77 77
             if (isset($fields['browsers'])) {
78
-                Collection::make($fields['browsers'])->each(function ($items, $browserName) use ($object) {
78
+                Collection::make($fields['browsers'])->each(function($items, $browserName) use ($object) {
79 79
                     $object->saveRelated($items, $browserName);
80 80
                 });
81 81
             }
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
             $blocksList = app(BlockCollection::class)->getBlockList();
108 108
         }
109 109
 
110
-        $block['type'] = $blocksList->keyBy('name')->search(function ($blockConfig) use ($block) {
110
+        $block['type'] = $blocksList->keyBy('name')->search(function($blockConfig) use ($block) {
111 111
             return $blockConfig['component'] === $block['type'];
112 112
         });
113 113
 
114 114
         $block['content'] = empty($block['content']) ? new \stdClass : (object) $block['content'];
115 115
 
116 116
         if ($block['browsers']) {
117
-            $browsers = Collection::make($block['browsers'])->map(function ($items) {
117
+            $browsers = Collection::make($block['browsers'])->map(function($items) {
118 118
                 return Collection::make($items)->pluck('id');
119 119
             })->toArray();
120 120
 
Please login to merge, or discard this patch.