Test Failed
Push — ft/generate-page-command ( d3f4ee )
by Philippe
17:08
created
src/Concerns/Translatable/Translatable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         $available_locales = static::availableLocales();
147 147
         $current_locales = $this->translations->pluck('locale')->toArray();
148 148
 
149
-        return array_filter($available_locales, function ($v) use ($current_locales, $available) {
149
+        return array_filter($available_locales, function($v) use ($current_locales, $available) {
150 150
             return $available ? in_array($v, $current_locales) : !in_array($v, $current_locales);
151 151
         }, ARRAY_FILTER_USE_BOTH);
152 152
     }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     private function validateLocale($locale)
160 160
     {
161 161
         if (!in_array($locale, static::availableLocales())) {
162
-            throw new InvalidArgumentException('Locale [' . $locale . '] is not available');
162
+            throw new InvalidArgumentException('Locale ['.$locale.'] is not available');
163 163
         }
164 164
     }
165 165
 
Please login to merge, or discard this patch.
src/Concerns/Translatable/TranslatableController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@
 block discarded – undo
23 23
             }
24 24
 
25 25
             foreach ($rules as $key => $rule) {
26
-                $translationrules['trans.' . $locale . '.'.$key] = $rule;
26
+                $translationrules['trans.'.$locale.'.'.$key] = $rule;
27 27
             }
28 28
 
29 29
             foreach ($attributes as $key => $attribute) {
30
-                $translationattributes['trans.' . $locale . '.'.$key] = $attribute;
30
+                $translationattributes['trans.'.$locale.'.'.$key] = $attribute;
31 31
             }
32 32
 
33 33
             foreach ($messages as $key => $message) {
34
-                $translationmessages['trans.' . $locale . '.'.$key] = $message;
34
+                $translationmessages['trans.'.$locale.'.'.$key] = $message;
35 35
             }
36 36
         }
37 37
 
Please login to merge, or discard this patch.
src/Concerns/Publishable/CheckPreviewTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
         if (PreviewMode::fromRequest()->check()) {
12 12
             Session::now('note.default', 'U bekijkt een preview.');
13 13
             return true;
14
-        } else {
14
+        }else {
15 15
             return false;
16 16
         }
17 17
     }
Please login to merge, or discard this patch.
src/Concerns/Sortable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
      */
20 20
     public static function reorderAgainstSiblings(array $sequence)
21 21
     {
22
-        array_walk($sequence, function ($id, $i) {
22
+        array_walk($sequence, function($id, $i) {
23 23
             self::findOrFail($id)->reorder($i);
24 24
         });
25 25
     }
Please login to merge, or discard this patch.
src/Concerns/HasPeriod/SortPeriodDateScope.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\Concerns\HasPeriod;
6 6
 
Please login to merge, or discard this patch.
src/Concerns/Archivable/ArchiveScope.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\Concerns\Archivable;
6 6
 
Please login to merge, or discard this patch.
src/Relations/AvailableChildren.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     public function onlyModules(): Collection
35 35
     {
36
-        return $this->collection()->reject(function ($item) {
36
+        return $this->collection()->reject(function($item) {
37 37
             if ($item instanceof Page || $item instanceof StoredSetReference) {
38 38
                 return true;
39 39
             }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function onlyPages(): Collection
44 44
     {
45
-        return $this->collection()->filter(function ($item) {
45
+        return $this->collection()->filter(function($item) {
46 46
             if ($item instanceof Page) {
47 47
                 return true;
48 48
             }
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
 
73 73
         // Merging the results of all the pages and all the modules, then filter by the config
74 74
         // This prevents us from having duplicates and also reduces the query load.
75
-        $collection = $collection->filter(function ($page) use ($available_children_types) {
75
+        $collection = $collection->filter(function($page) use ($available_children_types) {
76 76
             return in_array(get_class($page), $available_children_types);
77 77
         });
78 78
 
79 79
         // Filter out our already loaded pages and modules
80
-        $remaining_children_types = collect($available_children_types)->reject(function ($type) {
80
+        $remaining_children_types = collect($available_children_types)->reject(function($type) {
81 81
             return (new $type() instanceof Page || new $type() instanceof Module);
82 82
         });
83 83
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $collection = collect(array_merge($collection->all(), (new $type())->all()->all()));
89 89
         }
90 90
         // Filter out our parent
91
-        return $this->collection = $collection->reject(function ($item) {
91
+        return $this->collection = $collection->reject(function($item) {
92 92
             if ($item instanceof $this->parent) {
93 93
                 return $item->id == $this->parent->id;
94 94
             }
Please login to merge, or discard this patch.
src/Relations/Relation.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
     {
104 104
         $relations = static::where(function ($query) use ($type, $id) {
105 105
             return $query->where('parent_type', $type)
106
-                         ->where('parent_id', $id);
106
+                            ->where('parent_id', $id);
107 107
         })->orWhere(function ($query) use ($type, $id) {
108 108
             return $query->where('child_type', $type)
109 109
                 ->where('child_id', $id);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             ->orderBy('sort', 'ASC')
47 47
             ->get();
48 48
 
49
-        return $relations->map(function (Relation $relation) {
49
+        return $relations->map(function(Relation $relation) {
50 50
             $parent = $relation->parent;
51 51
             $parent->relation = $relation;
52 52
             return $parent;
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
                             ->orderBy('sort', 'ASC')
61 61
                             ->get();
62 62
 
63
-        return $relations->map(function (Relation $relation) use ($parent_type, $parent_id) {
63
+        return $relations->map(function(Relation $relation) use ($parent_type, $parent_id) {
64 64
 
65 65
             // It could be that the child itself is soft-deleted, if this is the case, we will ignore it and move on.
66 66
             if (!$child = $relation->child) {
67 67
                 if (!$relation->child()->withTrashed()->first()) {
68 68
 //                if ((!method_exists($childInstance, 'trashed')) || ! $childInstance->onlyTrashed()->find($relation->child_id)) {
69 69
                     // If we cannot retrieve it then he collection type is possibly off, this is a database inconsistency and should be addressed
70
-                    throw new \DomainException('Corrupt relation reference. Related child ['.$relation->child_type.'@'.$relation->child_id.'] could not be retrieved for parent [' . $parent_type.'@'.$parent_id.']. Make sure the morph key can resolve to a valid class.');
70
+                    throw new \DomainException('Corrupt relation reference. Related child ['.$relation->child_type.'@'.$relation->child_id.'] could not be retrieved for parent ['.$parent_type.'@'.$parent_id.']. Make sure the morph key can resolve to a valid class.');
71 71
                 }
72 72
 
73 73
                 return null;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         })
80 80
 
81 81
         // In case of soft-deleted entries, this will be null and should be ignored. We make sure that keys are reset in case of removed child
82
-        ->reject(function ($child) {
82
+        ->reject(function($child) {
83 83
             return is_null($child);
84 84
         })
85 85
         ->values();
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
 
97 97
     public static function deleteRelationsOf($type, $id)
98 98
     {
99
-        $relations = static::where(function ($query) use ($type, $id) {
99
+        $relations = static::where(function($query) use ($type, $id) {
100 100
             return $query->where('parent_type', $type)
101 101
                          ->where('parent_id', $id);
102
-        })->orWhere(function ($query) use ($type, $id) {
102
+        })->orWhere(function($query) use ($type, $id) {
103 103
             return $query->where('child_type', $type)
104 104
                 ->where('child_id', $id);
105 105
         })->get();
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
     public static function deleteAllChildRelationsOf($type, $id)
113 113
     {
114
-        $relations = static::where(function ($query) use ($type, $id) {
114
+        $relations = static::where(function($query) use ($type, $id) {
115 115
             return $query->where('parent_type', $type)
116 116
                 ->where('parent_id', $id);
117 117
         })->get();
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
     public static function deleteAllParentRelationsOf($type, $id)
125 125
     {
126
-        $relations = static::where(function ($query) use ($type, $id) {
126
+        $relations = static::where(function($query) use ($type, $id) {
127 127
             return $query->where('child_type', $type)
128 128
                 ->where('child_id', $id);
129 129
         })->get();
Please login to merge, or discard this patch.
src/Media/MediaType.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\Media;
6 6
 
Please login to merge, or discard this patch.