Completed
Push — fix/menu-item-collection ( 07c784...ace305 )
by Philippe
364:39 queued 333:12
created
src/Management/Assistants/PublishAssistant.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
     public function findAll(): Collection
73 73
     {
74
-        return $this->model->published()->get()->map(function ($model) {
74
+        return $this->model->published()->get()->map(function($model) {
75 75
             return $this->managers->findByModel($model);
76 76
         });
77 77
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
     public function guard($verb): Assistant
95 95
     {
96
-        if (! $this->can($verb)) {
96
+        if (!$this->can($verb)) {
97 97
             NotAllowedManagerRoute::notAllowedVerb($verb, $this->manager);
98 98
         }
99 99
 
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 
103 103
     public function previewUrl(): string
104 104
     {
105
-        if (! $this->model instanceof ProvidesUrl) {
106
-            throw new \Exception('Managed model ' . get_class($this->model) . ' should implement ' . ProvidesUrl::class);
105
+        if (!$this->model instanceof ProvidesUrl) {
106
+            throw new \Exception('Managed model '.get_class($this->model).' should implement '.ProvidesUrl::class);
107 107
         }
108 108
 
109 109
         return $this->model->previewUrl();
Please login to merge, or discard this patch.
src/Management/Assistants/ArchiveAssistant.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     public function findAll(): Collection
71 71
     {
72
-        return $this->model->archived()->get()->map(function ($model) {
72
+        return $this->model->archived()->get()->map(function($model) {
73 73
             return $this->managers->findByModel($model);
74 74
         });
75 75
     }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
     public function guard($verb): Assistant
101 101
     {
102
-        if (! $this->can($verb)) {
102
+        if (!$this->can($verb)) {
103 103
             NotAllowedManagerRoute::notAllowedVerb($verb, $this->manager);
104 104
         }
105 105
 
Please login to merge, or discard this patch.
src/Management/Exceptions/NotAllowedManagerRoute.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@
 block discarded – undo
39 39
 
40 40
     public static function notAllowedVerb($verb, Manager $manager)
41 41
     {
42
-        throw new static('Not allowed to '.$verb.' a model. '.ucfirst($verb).' route is not allowed by the ' . $manager->details()->key.' manager.');
42
+        throw new static('Not allowed to '.$verb.' a model. '.ucfirst($verb).' route is not allowed by the '.$manager->details()->key.' manager.');
43 43
     }
44 44
 
45 45
     public static function notAllowedPermission($permission, Manager $manager)
46 46
     {
47
-        throw new static('Not allowed permission for '.$permission.' on a model as managed by the ' . $manager->details()->key.' manager.');
47
+        throw new static('Not allowed permission for '.$permission.' on a model as managed by the '.$manager->details()->key.' manager.');
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
src/Management/Details/Details.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 
65 65
     public function __toString()
66 66
     {
67
-        return (string) $this->get('key');
67
+        return (string)$this->get('key');
68 68
     }
69 69
 
70 70
     /**
Please login to merge, or discard this patch.
src/Management/Details/HasDetails.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         $internal_label = contract($this->model, ProvidesFlatReference::class) ? $this->model->flatReferenceLabel() : $key;
22 22
 
23 23
         // Manager index and header info
24
-        $title = $this->model->title ?? ($this->model->id ? $labelSingular . ' ' . $this->model->id : $labelSingular);
24
+        $title = $this->model->title ?? ($this->model->id ? $labelSingular.' '.$this->model->id : $labelSingular);
25 25
 
26 26
         return new Details(
27 27
             $id,
Please login to merge, or discard this patch.
src/Management/Registration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
         }
84 84
 
85 85
         $manager = new \ReflectionClass($this->managerClass);
86
-        if (! $manager->implementsInterface(Manager::class)) {
86
+        if (!$manager->implementsInterface(Manager::class)) {
87 87
             throw new \InvalidArgumentException('Class ['.$this->managerClass.'] is expected to implement the ['.Manager::class.'] contract.');
88 88
         }
89 89
     }
Please login to merge, or discard this patch.
src/Management/AbstractManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
             $this->filters()->apply($builder);
72 72
 
73 73
             $results = $builder->get();
74
-        } else {
74
+        }else {
75 75
             $results = $model::all();
76 76
         }
77 77
 
78
-        return $results->map(function ($model) {
78
+        return $results->map(function($model) {
79 79
             return (new static($this->registration))->manage($model);
80 80
         });
81 81
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     protected function existingModel()
95 95
     {
96
-        if (!$this->model ||! $this->model->exists) {
96
+        if (!$this->model || !$this->model->exists) {
97 97
             throw new NonExistingRecord('Model does not exist yet but is expected.');
98 98
         }
99 99
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
     public function guard($verb): Manager
140 140
     {
141
-        if (! $this->can($verb)) {
141
+        if (!$this->can($verb)) {
142 142
             NotAllowedManagerRoute::notAllowedVerb($verb, $this);
143 143
         }
144 144
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
                 // Could be translatable field
175 175
                 if ($this->isTranslatableKey($field)) {
176
-                    $attribute = substr($field, strrpos($field, '.') + 1);
176
+                    $attribute = substr($field, strrpos($field, '.')+1);
177 177
                     $locale = substr($field, strlen('trans.'), 2);
178 178
 
179 179
                     return $this->model->getTranslationFor($attribute, $locale);
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
             // Make our media fields able to be translatable as well...
213 213
             if ($field->ofType(FieldType::MEDIA, FieldType::DOCUMENT)) {
214
-                throw new \Exception('Cannot process the ' . $field->key . ' media field. Currently no support for translatable media files. We should fix this!');
214
+                throw new \Exception('Cannot process the '.$field->key.' media field. Currently no support for translatable media files. We should fix this!');
215 215
             }
216 216
 
217 217
             // Okay so this is a bit odd but since all translations are expected to be inside the trans
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             : 'chief::back._fields.formgroup';
254 254
 
255 255
         // form element view path
256
-        $viewpath = 'chief::back._fields.' . $field->type;
256
+        $viewpath = 'chief::back._fields.'.$field->type;
257 257
 
258 258
         return view($path, [
259 259
             'field'    => $field,
Please login to merge, or discard this patch.
src/Management/ManagesPagebuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         
49 49
         $availableChildren = AvailableChildren::forParent($model);
50 50
         
51
-        $modules = $availableChildren->onlyModules()->reject(function ($module) use ($model) {
51
+        $modules = $availableChildren->onlyModules()->reject(function($module) use ($model) {
52 52
             return $module->page_id != null && $module->page_id != $model->id;
53 53
         });
54 54
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $available_sets = FlatReferencePresenter::toGroupedSelectValues($availableChildren->onlySets())->toArray();
58 58
 
59 59
         // Current sections
60
-        $sections = $model->children()->map(function ($section, $index) {
60
+        $sections = $model->children()->map(function($section, $index) {
61 61
             if ($section instanceof TranslatableContract) {
62 62
                 $section->injectTranslationForForm();
63 63
             }
Please login to merge, or discard this patch.
src/Management/Register.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function filter(callable $callback): self
48 48
     {
49
-        if (! is_callable($callback)) {
49
+        if (!is_callable($callback)) {
50 50
             return new static($this->registrations);
51 51
         }
52 52
 
53 53
         $registrations = $this->registrations;
54 54
 
55 55
         foreach ($registrations as $k => $registration) {
56
-            if (!! call_user_func($callback, $registration)) {
56
+            if (!!call_user_func($callback, $registration)) {
57 57
                 unset($registrations[$k]);
58 58
             }
59 59
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function filterByTag($tag): self
80 80
     {
81 81
         try {
82
-            return $this->filterBy('tags', (array) $tag);
82
+            return $this->filterBy('tags', (array)$tag);
83 83
         } catch (NonRegisteredManager $e) {
84 84
             return new static();
85 85
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         foreach ($registrations as $k => $registration) {
108 108
             $containsValue = $registration->has($key, $value);
109 109
 
110
-            if ($type == 'filter' && ! $containsValue) {
110
+            if ($type == 'filter' && !$containsValue) {
111 111
                 unset($registrations[$k]);
112 112
             }
113 113
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     private function registrationMustExistConstraint(string $key, $value, $registrations): void
137 137
     {
138 138
         if (empty($registrations) && count($registrations) != $this->registrations) {
139
-            throw new NonRegisteredManager('No manager found for ' . $key . ' [' . print_r($value, true) . ']. Did you perhaps forgot to register the manager?');
139
+            throw new NonRegisteredManager('No manager found for '.$key.' ['.print_r($value, true).']. Did you perhaps forgot to register the manager?');
140 140
         }
141 141
     }
142 142
 }
Please login to merge, or discard this patch.