Passed
Push — dependabot/npm_and_yarn/browse... ( c64c68...e99520 )
by Philippe
28:31
created
src/PageBuilder/PresentSections.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $this->addChildToCollection($i, $child);
79 79
         }
80 80
 
81
-        return $this->sets->values()->map(function (PresentForParent $child) {
81
+        return $this->sets->values()->map(function(PresentForParent $child) {
82 82
             return ($this->withSnippets && method_exists($child, 'withSnippets'))
83 83
                 ? $child->withSnippets()->presentForParent($this->parent)
84 84
                 : $child->presentForParent($this->parent);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     private function addChildToCollection($index, ActsAsChild $child)
95 95
     {
96 96
         // Only published pages you fool!
97
-        if (method_exists($child, 'isPublished') && ! $child->isPublished()) {
97
+        if (method_exists($child, 'isPublished') && !$child->isPublished()) {
98 98
             return;
99 99
         }
100 100
 
Please login to merge, or discard this patch.
src/PageBuilder/UpdateSections.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     private function removeExistingSets()
91 91
     {
92 92
         foreach ($this->model->children() as $instance) {
93
-            if (! $instance instanceof StoredSetReference) {
93
+            if (!$instance instanceof StoredSetReference) {
94 94
                 continue;
95 95
             }
96 96
             $this->model->rejectChild($instance);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         }
145 145
 
146 146
         foreach ($this->text_modules['replace'] as $text_module) {
147
-            if (! $module = FlatReferenceFactory::fromString($text_module['id'])->instance()) {
147
+            if (!$module = FlatReferenceFactory::fromString($text_module['id'])->instance()) {
148 148
                 continue;
149 149
             }
150 150
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
     private function removeTextualModule($module)
165 165
     {
166
-        if (! $module instanceof TextModule && ! $module instanceof PagetitleModule) {
166
+        if (!$module instanceof TextModule && !$module instanceof PagetitleModule) {
167 167
             throw new \Exception('Invalid request to remove non textual module');
168 168
         }
169 169
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 continue;
186 186
             }
187 187
 
188
-            $child = $children->first(function ($c) use ($reference) {
188
+            $child = $children->first(function($c) use ($reference) {
189 189
                 return $c->flatReference()->get() == $reference;
190 190
             });
191 191
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     private function stripTagsBlacklist($value, $blacklist = [])
237 237
     {
238 238
         foreach ($blacklist as $tag) {
239
-            $value = preg_replace('/<\/?' . $tag . '(.|\s)*?>/', '', $value);
239
+            $value = preg_replace('/<\/?'.$tag.'(.|\s)*?>/', '', $value);
240 240
         }
241 241
 
242 242
         return $value;
Please login to merge, or discard this patch.
src/Menu/Application/UpdateMenu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
             $menu->parent_id = ($request->get('allow_parent') && $request->get('parent_id')) ? $request->get('parent_id') : null;
25 25
             $menu->page_id = ($page_id = $request->get('page_id')) ? $this->getPage($request->get('page_id'))->id : null;
26 26
             $menu->collection_type = $request->get('collection_type', null);
27
-            $menu->order        = $request->get('order', 0);
27
+            $menu->order = $request->get('order', 0);
28 28
 
29 29
             $this->reorderAgainstSiblings($menu);
30 30
             $menu->save();
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
         if (in_array($menu->order, $sequence)) {
53 53
             foreach ($sequence as $id => $order) {
54 54
                 if ($order < $menu->order) {
55
-                } else {
55
+                }else {
56 56
                     $sequence[$id]++;
57 57
                 }
58 58
             }
59 59
         }
60 60
 
61
-        $sequence = $sequence + [$menu->id => $menu->order];
61
+        $sequence = $sequence+[$menu->id => $menu->order];
62 62
 
63 63
         asort($sequence);
64 64
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
     private function reorder(array $sequence)
69 69
     {
70
-        array_walk($sequence, function ($order, $id) {
70
+        array_walk($sequence, function($order, $id) {
71 71
             MenuItem::withoutGlobalScope(SoftDeletingScope::class)
72 72
                 ->where('id', $id)
73 73
                 ->update(['order' => $order]);
Please login to merge, or discard this patch.
src/Menu/ChiefMenu.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Thinktomorrow\Chief\Menu;
5 5
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $collection = NodeCollection::fromArray($items);
28 28
 
29
-        $collection->mapRecursive(function ($node) {
29
+        $collection->mapRecursive(function($node) {
30 30
             return $node->replaceEntry((new MenuItem())->entry($node));
31 31
         });
32 32
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     public function items(): NodeCollection
44 44
     {
45 45
         if (!$this->includeHidden) {
46
-            $this->collection = $this->collection->shake(function ($node) {
46
+            $this->collection = $this->collection->shake(function($node) {
47 47
                 return !$node->hidden_in_menu && !$node->draft;
48 48
             });
49 49
         }
@@ -56,22 +56,22 @@  discard block
 block discarded – undo
56 56
         $this->collection = $this->items();
57 57
 
58 58
         if ($id) {
59
-            $this->collection = $this->collection->prune(function ($node) use ($id) {
59
+            $this->collection = $this->collection->prune(function($node) use ($id) {
60 60
                 return !in_array($id, $node->pluckAncestors('id'));
61 61
             });
62 62
         }
63 63
 
64
-        $menu = $this->collection->mapRecursive(function ($node) {
64
+        $menu = $this->collection->mapRecursive(function($node) {
65 65
             $entry = $node->entry();
66 66
             $label = $entry->label;
67
-            $entry->label = $node->depth() != 0 ? (str_repeat('-', $node->depth())) . '>' : '';
67
+            $entry->label = $node->depth() != 0 ? (str_repeat('-', $node->depth())).'>' : '';
68 68
             $entry->label .= $label;
69 69
             return $node->replaceEntry($entry);
70 70
         });
71 71
 
72 72
         $menuitems = collect();
73
-        $menu->flatten()->each(function ($node) use ($menuitems) {
74
-            $menuitems[]  = [
73
+        $menu->flatten()->each(function($node) use ($menuitems) {
74
+            $menuitems[] = [
75 75
                 'label' => $node->label,
76 76
                 'id'    => $node->id
77 77
             ];
Please login to merge, or discard this patch.
src/Menu/MenuItem.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
             if ($item->collection_type) {
111 111
                 $pages = Morphables::instance($item->collection_type)->getAllPublished();
112 112
 
113
-                $pages->each(function (ActsAsMenuItem $page) use (&$collectionItems, $item) {
113
+                $pages->each(function(ActsAsMenuItem $page) use (&$collectionItems, $item) {
114 114
                     $collectionItems->push(MenuItem::make([
115
-                        'id'             => 1000 . $item->id . $page->id,         // Unique integer identifier since model->id is automatically casted to int.
115
+                        'id'             => 1000.$item->id.$page->id, // Unique integer identifier since model->id is automatically casted to int.
116 116
                         'label'          => $page->menuLabel(),
117 117
                         'url'            => self::composePageUrl($item, $page),
118 118
                         'parent_id'      => $item->id,
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             if ($item->ofType(static::TYPE_INTERNAL) && $page = $item->page) {
128 128
                 if ($page->isArchived()) {
129 129
                     unset($items[$k]);
130
-                } else {
130
+                }else {
131 131
                     $item->url            = self::composePageUrl($item, $page);
132 132
                     $item->page_label     = $page->menuLabel();
133 133
                     $item->hidden_in_menu = $page->hidden_in_menu;
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
      */
173 173
     public function entry(Node $node)
174 174
     {
175
-        return (object) [
175
+        return (object)[
176 176
             'id'             => $node->id,
177 177
             'type'           => $node->type,
178 178
             'label'          => $node->label,
179
-            'page_label'     => $node->page_label,                       // Extra info when dealing with internal links
179
+            'page_label'     => $node->page_label, // Extra info when dealing with internal links
180 180
             'url'            => $node->url,
181 181
             'order'          => $node->order,
182 182
             'page_id'        => $node->page_id,
Please login to merge, or discard this patch.
src/Menu/Menu.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $types = config('thinktomorrow.chief.menus', []);
29 29
 
30
-        return collect($types)->map(function ($menu, $key) {
30
+        return collect($types)->map(function($menu, $key) {
31 31
             return new static($key, $menu['label'], $menu['view']);
32 32
         });
33 33
     }
34 34
 
35 35
     public static function find($key): ?self
36 36
     {
37
-        return static::all()->filter(function ($menu) use ($key) {
37
+        return static::all()->filter(function($menu) use ($key) {
38 38
             return $menu->key() == $key;
39 39
         })->first();
40 40
     }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $menu = [];
85 85
 
86
-        $this->items()->each(function ($item) use (&$menu) {
86
+        $this->items()->each(function($item) use (&$menu) {
87 87
             $menu[] = sprintf('<li><a href="%s">%s</a></li>', $item->url, $item->label);
88 88
         });
89 89
 
Please login to merge, or discard this patch.
src/Snippets/SnippetCollection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $files = collect();
26 26
 
27 27
         foreach ($paths as $path) {
28
-            if (! $fullpath = self::constructFullPath($path)) {
28
+            if (!$fullpath = self::constructFullPath($path)) {
29 29
                 continue;
30 30
             }
31 31
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             }
38 38
         }
39 39
 
40
-        return static::$loadedSnippets = new static($files->map(function (SplFileInfo $file) {
40
+        return static::$loadedSnippets = new static($files->map(function(SplFileInfo $file) {
41 41
             $path = $file->getRealPath();
42 42
 
43 43
             if (0 === strpos($path, resource_path('views')) && false !== strpos($file->getBasename(), '.blade.php')) {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             }
46 46
 
47 47
             $key = substr($file->getBasename(), 0, strpos($file->getBasename(), '.'));
48
-            $label = ucfirst(str_replace(['-','_'], ' ', $key));
48
+            $label = ucfirst(str_replace(['-', '_'], ' ', $key));
49 49
 
50 50
             return new Snippet($key, $label, $path);
51 51
         })->all());
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     {
56 56
         $loadedSnippets = static::load();
57 57
 
58
-        return $loadedSnippets->first(function (Snippet $snippet) use ($key) {
58
+        return $loadedSnippets->first(function(Snippet $snippet) use ($key) {
59 59
             return $snippet->key() == $key;
60 60
         });
61 61
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
     public function toClips(): array
88 88
     {
89
-        return $this->map(function ($snippet) {
89
+        return $this->map(function($snippet) {
90 90
             return [$snippet->label(), $snippet->placeholder()];
91 91
         })->toArray();
92 92
     }
Please login to merge, or discard this patch.
src/Snippets/FileLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Thinktomorrow\Chief\Snippets;
6 6
 
Please login to merge, or discard this patch.
src/Snippets/SnippetParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
             return $value;
13 13
         }
14 14
 
15
-        $value = preg_replace_callback(static::$pattern, function ($matches) {
15
+        $value = preg_replace_callback(static::$pattern, function($matches) {
16 16
 
17 17
             // First entry of matches contains our full captured group, which we want to replace.
18 18
             // Second entry is the text itself, without the brackets
Please login to merge, or discard this patch.