Test Setup Failed
Push — a-simpler-manager ( a8eb21...cfc0f9 )
by Ben
06:30 queued 10s
created
src/OLD/Management/Exceptions/NotAllowedManagerAction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@
 block discarded – undo
40 40
 
41 41
     public static function notAllowedAction($action, string $managerKey)
42 42
     {
43
-        return new self('Not allowed to ' . $action . ' a model. ' . ucfirst($action) . ' route is not allowed by the ' . $managerKey . ' manager.');
43
+        return new self('Not allowed to '.$action.' a model. '.ucfirst($action).' route is not allowed by the '.$managerKey.' manager.');
44 44
     }
45 45
 
46 46
     public static function notAllowedPermission($permission, string $managerKey)
47 47
     {
48
-        return new self('Not allowed permission for ' . $permission . ' on a model as managed by the ' . $managerKey . ' manager.');
48
+        return new self('Not allowed permission for '.$permission.' on a model as managed by the '.$managerKey.' manager.');
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
src/Menu/MenuItem.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             if ($item->ofType(static::TYPE_INTERNAL) && $page = $item->page) {
105 105
                 if (public_method_exists($page, 'isArchived') && $page->isArchived()) {
106 106
                     unset($items[$k]);
107
-                } else {
107
+                }else {
108 108
                     $item->url = self::composePageUrl($item, $page);
109 109
                     $item->page_label = public_method_exists($page, 'menuLabel') ? $page->menuLabel() : '';
110 110
                     $item->hidden_in_menu = $page->hidden_in_menu;
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             'id'             => $node->id,
154 154
             'type'           => $node->type,
155 155
             'label'          => $node->label,
156
-            'page_label'     => $node->page_label,                       // Extra info when dealing with internal links
156
+            'page_label'     => $node->page_label, // Extra info when dealing with internal links
157 157
             'url'            => $node->url,
158 158
             'order'          => $node->order,
159 159
             'page_id'        => $node->page_id,
Please login to merge, or discard this patch.
src/Modules/Modules.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
         // TODO: how to assign for pagebuilder?? with tag, via the chief relations config or is this default
37 37
         $moduleManagerClasses = $this->registeredManagers->tagged('module')->get();
38 38
 
39
-        $managers = collect(array_map(function($moduleManagerClass){
39
+        $managers = collect(array_map(function($moduleManagerClass) {
40 40
             return app($moduleManagerClass);
41 41
         }, $moduleManagerClasses));
42 42
 
43 43
         return $managers
44
-            ->reject(function($manager){ return !$manager->can('create'); })
44
+            ->reject(function($manager) { return !$manager->can('create'); })
45 45
             ->map(function($manager) use($ownerType, $ownerId){
46 46
                 return [
47 47
                     'label' => $manager->adminLabel('page_title'),
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
         // Get the modules that are set to be shareable.
57 57
         $moduleManagerClasses = $this->shareableModules();
58 58
 
59
-        $managers = collect(array_map(function($moduleManagerClass){
59
+        $managers = collect(array_map(function($moduleManagerClass) {
60 60
             return app($moduleManagerClass);
61 61
         }, $moduleManagerClasses));
62 62
 
63 63
         return $managers
64
-            ->reject(function($manager){ return !$manager->can('create-shared'); })
65
-            ->map(function($manager){
64
+            ->reject(function($manager) { return !$manager->can('create-shared'); })
65
+            ->map(function($manager) {
66 66
                 return [
67 67
                     'label' => $manager->adminLabel('page_title'),
68 68
                     'value' => $manager->route('create-shared')
Please login to merge, or discard this patch.
src/Modules/Assistants/ModuleCudAssistant.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $model->saveFields($model->fields()->tagged('create'), $request->all(), $request->allFiles());
92 92
 
93 93
         return redirect()->to($this->route('edit', $model))
94
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is toegevoegd');
94
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is toegevoegd');
95 95
     }
96 96
 
97 97
     public function edit($id)
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         return view('chief::back.managers.edit', [
107 107
             'model'      => $model,
108 108
             'managerViewModel' => $this->managerViewModel(),
109
-            'fields'     => $model->fields()->map(function (Field $field) use ($model) {
109
+            'fields'     => $model->fields()->map(function(Field $field) use ($model) {
110 110
                 // TODO refactor so render method of field takes model and managerViewModel as arguments.
111 111
                 return $field->model($model)
112 112
                     ->viewData(['managerViewModel' => $this->managerViewModel()]);
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $model->saveFields($model->fields(), $request->all(), $request->allFiles());
127 127
 
128 128
         return redirect()->to($this->route('edit', $model))
129
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is aangepast');
129
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is aangepast');
130 130
     }
131 131
 
132 132
     public function delete($id, Request $request)
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
         $model = static::managedModelClass()::findOrFail($id);
137 137
 
138 138
         if ($request->get('deleteconfirmation') !== 'DELETE') {
139
-            return redirect()->back()->with('messages.warning', $model->adminLabel('title') . ' is niet verwijderd.');
139
+            return redirect()->back()->with('messages.warning', $model->adminLabel('title').' is niet verwijderd.');
140 140
         }
141 141
 
142 142
         app(DeleteManagedModel::class)->handle($model);
143 143
 
144 144
         return redirect()->to($this->route('index'))
145
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is verwijderd.');
145
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is verwijderd.');
146 146
     }
147 147
 }
Please login to merge, or discard this patch.
src/Modules/ModuleManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
159 159
             if (is_array_empty($translation)) {
160 160
 
161 161
                 // Nullify all values
162
-                $trans[$locale] = array_map(function ($value) {
162
+                $trans[$locale] = array_map(function($value) {
163 163
                     return null;
164 164
                 }, $translation);
165 165
                 continue;
Please login to merge, or discard this patch.
src/Managers/Assistants/ManagerDefaults.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function route(string $action, $model = null, ...$parameters): string
28 28
     {
29
-        foreach(DiscoverTraitMethods::belongingTo(static::class, 'route') as $method) {
30
-            if(null !== ($route = $this->$method($action, $model, ...$parameters))){
29
+        foreach (DiscoverTraitMethods::belongingTo(static::class, 'route') as $method) {
30
+            if (null !== ($route = $this->$method($action, $model, ...$parameters))) {
31 31
                 return $route;
32 32
             }
33 33
         }
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function can(string $action, $model = null): bool
42 42
     {
43
-        foreach(DiscoverTraitMethods::belongingTo(static::class, 'can') as $method) {
44
-            if(true === $this->$method($action, $model)){
43
+        foreach (DiscoverTraitMethods::belongingTo(static::class, 'can') as $method) {
44
+            if (true === $this->$method($action, $model)) {
45 45
                 return true;
46 46
             }
47 47
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $parameters = array_merge((array)$modelId, $parameters);
84 84
         }
85 85
 
86
-        return route('chief.' . static::routeKey() . '.' . $action, $parameters);
86
+        return route('chief.'.static::routeKey().'.'.$action, $parameters);
87 87
     }
88 88
 
89 89
     private function guard(string $action)
Please login to merge, or discard this patch.
src/Managers/Assistants/CrudAssistant.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@
 block discarded – undo
153 153
             'fields'     => $model->fields()->map(function (Field $field) use ($model) {
154 154
                 // TODO refactor so render method of field takes model and managerViewModel as arguments.
155 155
                 return $field->model($model)
156
-                             ->viewData(['managerViewModel' => new managerViewModel($this)]);
156
+                                ->viewData(['managerViewModel' => new managerViewModel($this)]);
157 157
             }),
158 158
         ]);
159 159
     }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
         // Default sorted by publish date
97 97
         $modelClass = static::managedModelClass();
98 98
         if (Schema::hasColumn((new $modelClass)->getTable(), 'published_at')) {
99
-            $filters = $filters->add(HiddenFilter::make('publish', function($query){
100
-                return $query->orderBy('published_at','DESC');
99
+            $filters = $filters->add(HiddenFilter::make('publish', function($query) {
100
+                return $query->orderBy('published_at', 'DESC');
101 101
             }));
102 102
         }
103 103
 
104 104
         // if model has no timestamps, updated_at doesn't exist
105 105
         if ((new $modelClass)->timestamps) {
106
-            $filters = $filters->add(HiddenFilter::make('updated', function($query){
107
-                return $query->orderBy('updated_at','DESC');
106
+            $filters = $filters->add(HiddenFilter::make('updated', function($query) {
107
+                return $query->orderBy('updated_at', 'DESC');
108 108
             }));
109 109
         }
110 110
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $model->saveFields($model->fields()->tagged('create'), $request->all(), $request->allFiles());
136 136
 
137 137
         return redirect()->to($this->route('edit', $model))
138
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is toegevoegd');
138
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is toegevoegd');
139 139
     }
140 140
 
141 141
     public function edit($id)
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         return view('chief::back.managers.edit', [
151 151
             'manager'    => $this,
152 152
             'model'      => $model,
153
-            'fields'     => $model->fields()->map(function (Field $field) use ($model) {
153
+            'fields'     => $model->fields()->map(function(Field $field) use ($model) {
154 154
                 // TODO refactor so render method of field takes model and managerViewModel as arguments.
155 155
                 return $field->model($model)
156 156
                              ->viewData(['managerViewModel' => new managerViewModel($this)]);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         $model->saveFields($model->fields(), $request->all(), $request->allFiles());
171 171
 
172 172
         return redirect()->to($this->route('edit', $model))
173
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is aangepast');
173
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is aangepast');
174 174
     }
175 175
 
176 176
     public function delete($id, Request $request)
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
         $model = static::managedModelClass()::findOrFail($id);
181 181
 
182 182
         if ($request->get('deleteconfirmation') !== 'DELETE') {
183
-            return redirect()->back()->with('messages.warning', $model->adminLabel('title') . ' is niet verwijderd.');
183
+            return redirect()->back()->with('messages.warning', $model->adminLabel('title').' is niet verwijderd.');
184 184
         }
185 185
 
186 186
         app(DeleteManagedModel::class)->handle($model);
187 187
 
188 188
         return redirect()->to($this->route('index'))
189
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is verwijderd.');
189
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is verwijderd.');
190 190
     }
191 191
 }
Please login to merge, or discard this patch.
src/Managers/Register/RegisteredManagers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
     public function tagged($tags): self
16 16
     {
17
-        $tags = (array) $tags;
17
+        $tags = (array)$tags;
18 18
 
19 19
         return $this->filter(function($value, $key) use($tags){
20 20
             return count(array_intersect($value, $tags)) > 0;
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function notTagged($tags): self
25 25
     {
26
-        $tags = (array) $tags;
26
+        $tags = (array)$tags;
27 27
 
28 28
         return $this->filter(function($value, $key) use($tags){
29 29
             return count(array_intersect($value, $tags)) === 0;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function untagged($tags): self
34 34
     {
35
-        $tags = (array) $tags;
35
+        $tags = (array)$tags;
36 36
 
37 37
         return $this->filter(function($value, $key) use($tags){
38 38
             return empty($value);
Please login to merge, or discard this patch.
src/Managers/Register/RegisterManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,6 +29,6 @@
 block discarded – undo
29 29
         );
30 30
 
31 31
         $this->container->make(ModelToManagerMap::class)->map($class::managedModelClass(), $class);
32
-        $this->container->make(RegisteredManagers::class)->tag($class, (array) $tags);
32
+        $this->container->make(RegisteredManagers::class)->tag($class, (array)$tags);
33 33
     }
34 34
 }
Please login to merge, or discard this patch.