Test Setup Failed
Push — a-simpler-manager ( c7b435...29c609 )
by Ben
09:30
created
src/Managers/Assistants/FragmentCrudAssistant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
     public function fragmentsIndex(string $ownerClass, $ownerId)
56 56
     {
57 57
 //        trap($ownerClass, $ownerId);
58
-        $models = static::managedModelClass()::whereIn('id',[2,3])->get();
58
+        $models = static::managedModelClass()::whereIn('id', [2, 3])->get();
59 59
 
60 60
         return view('chief::back.catalogpages._fragments', [
61 61
             'models'            => $models,
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
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
         // Default sorted by publish date
96 96
         $modelClass = static::managedModelClass();
97 97
         if (Schema::hasColumn((new $modelClass)->getTable(), 'published_at')) {
98
-            $filters = $filters->add(HiddenFilter::make('publish', function($query){
99
-                return $query->orderBy('published_at','DESC');
98
+            $filters = $filters->add(HiddenFilter::make('publish', function($query) {
99
+                return $query->orderBy('published_at', 'DESC');
100 100
             }));
101 101
         }
102 102
 
103 103
         // if model has no timestamps, updated_at doesn't exist
104 104
         if ((new $modelClass)->timestamps) {
105
-            $filters = $filters->add(HiddenFilter::make('updated', function($query){
106
-                return $query->orderBy('updated_at','DESC');
105
+            $filters = $filters->add(HiddenFilter::make('updated', function($query) {
106
+                return $query->orderBy('updated_at', 'DESC');
107 107
             }));
108 108
         }
109 109
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $model->saveFields($model->fields()->tagged('create'), $request->all(), $request->allFiles());
135 135
 
136 136
         return redirect()->to($this->route('edit', $model))
137
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is toegevoegd');
137
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is toegevoegd');
138 138
     }
139 139
 
140 140
     public function edit($id)
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         return view('chief::back.managers.edit', [
150 150
             'manager'    => $this,
151 151
             'model'      => $model,
152
-            'fields'     => $model->fields()->map(function (Field $field) use ($model) {
152
+            'fields'     => $model->fields()->map(function(Field $field) use ($model) {
153 153
                 // TODO refactor so render method of field takes model and managerViewModel as arguments.
154 154
                 return $field->model($model)
155 155
                              ->viewData(['managerViewModel' => new managerViewModel($this)]);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         $model->saveFields($model->fields(), $request->all(), $request->allFiles());
170 170
 
171 171
         return redirect()->to($this->route('index'))
172
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  <a href="'. $this->route('edit',$model) .'">' . $model->adminLabel('title') . '</a> is aangepast');
172
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  <a href="'.$this->route('edit', $model).'">'.$model->adminLabel('title').'</a> is aangepast');
173 173
     }
174 174
 
175 175
     public function delete($id, Request $request)
@@ -179,12 +179,12 @@  discard block
 block discarded – undo
179 179
         $model = static::managedModelClass()::findOrFail($id);
180 180
 
181 181
         if ($request->get('deleteconfirmation') !== 'DELETE') {
182
-            return redirect()->back()->with('messages.warning', $model->adminLabel('title') . ' is niet verwijderd.');
182
+            return redirect()->back()->with('messages.warning', $model->adminLabel('title').' is niet verwijderd.');
183 183
         }
184 184
 
185 185
         app(DeleteManagedModel::class)->handle($model);
186 186
 
187 187
         return redirect()->to($this->route('index'))
188
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is verwijderd.');
188
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is verwijderd.');
189 189
     }
190 190
 }
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.
src/Managers/Routes/ManagedRoutes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
     public function push($managedRoutes): self
36 36
     {
37
-        return new static($this->managerClass, $this->name, array_merge($this->routes, (array) $managedRoutes));
37
+        return new static($this->managerClass, $this->name, array_merge($this->routes, (array)$managedRoutes));
38 38
     }
39 39
 
40 40
     public function getManagerClass(): string
Please login to merge, or discard this patch.
src/Managers/Routes/RegisterManagedRoutes.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $managedRoutes = $this->expandWithAssistantRoutes($managerClass, $managedRoutes);
29 29
 
30
-        $this->router->group(['prefix' => $this->routePrefix, 'middleware' => $this->routeMiddleware], function () use($managedRoutes) {
31
-            foreach($managedRoutes as $route) {
30
+        $this->router->group(['prefix' => $this->routePrefix, 'middleware' => $this->routeMiddleware], function() use($managedRoutes) {
31
+            foreach ($managedRoutes as $route) {
32 32
                 $this->router->addRoute(
33 33
                     $route->method,
34
-                    $managedRoutes->getName() .'/'. $route->uri,
34
+                    $managedRoutes->getName().'/'.$route->uri,
35 35
                     [$managedRoutes->getManagerClass(), $route->action]
36
-                )->name('chief.' . $managedRoutes->getName() . '.' . $route->action);
36
+                )->name('chief.'.$managedRoutes->getName().'.'.$route->action);
37 37
             }
38 38
         });
39 39
     }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             }
48 48
         }
49 49
 
50
-        if(public_method_exists($managerClass, 'routes')) {
50
+        if (public_method_exists($managerClass, 'routes')) {
51 51
             $managedRoutes = $managedRoutes->push($managerClass::routes());
52 52
         }
53 53
 
Please login to merge, or discard this patch.
src/Filters/Presets/CheckboxFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
     protected function viewData(): array
30 30
     {
31
-        return array_merge( parent::viewData(),[
31
+        return array_merge(parent::viewData(), [
32 32
             'options' => $this->options,
33 33
         ]);
34 34
     }
Please login to merge, or discard this patch.
src/Filters/Presets/SelectFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
     protected function viewData(): array
38 38
     {
39
-        return array_merge( parent::viewData(),[
39
+        return array_merge(parent::viewData(), [
40 40
             'options' => $this->options,
41 41
             'multiple' => $this->multiple,
42 42
         ]);
Please login to merge, or discard this patch.
src/Filters/FilterType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
 
7 7
 class FilterType
8 8
 {
9
-    const HIDDEN = 'hidden';   // hidden input - default sorting or filtering without admin manipulation possible
10
-    const INPUT = 'input';   // oneliner text (input)
11
-    const SELECT = 'select';  // Select options
9
+    const HIDDEN = 'hidden'; // hidden input - default sorting or filtering without admin manipulation possible
10
+    const INPUT = 'input'; // oneliner text (input)
11
+    const SELECT = 'select'; // Select options
12 12
     const CHECKBOX = 'checkbox';
13 13
     const RADIO = 'radio';
14 14
 }
Please login to merge, or discard this patch.