Passed
Push — master ( 516123...5dad54 )
by Takafumi
05:01
created
src/Http/Controllers/Controller.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     public function show(int $id)
101 101
     {
102 102
         $model = $this->model::findOrFail($id);
103
-        $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function ($type, $name) use ($model) {
103
+        $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function($type, $name) use ($model) {
104 104
             return !in_array($name, ['id', 'updated_at', $model->comments()->getForeignKeyName(), $model->comments()->getMorphType()]);
105 105
         }, ARRAY_FILTER_USE_BOTH);
106 106
 
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function create(Request $request)
147 147
     {
148
-        $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) {
148
+        $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) {
149 149
             return $item !== null;
150 150
         });
151 151
         if (isset($inputs['password'])) {
152 152
             $inputs['password'] = \Hash::make($inputs['password']);
153 153
         }
154 154
         if (!empty($this->files)) {
155
-            $files = array_filter($inputs, function ($item, $key) {
155
+            $files = array_filter($inputs, function($item, $key) {
156 156
                 return in_array($key, $this->files) && $item instanceof UploadedFile;
157 157
             }, ARRAY_FILTER_USE_BOTH);
158 158
 
@@ -212,14 +212,14 @@  discard block
 block discarded – undo
212 212
     public function update(Request $request, int $id)
213 213
     {
214 214
         $model = $this->model::findOrFail($id);
215
-        $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) {
215
+        $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) {
216 216
             return $item !== null;
217 217
         });
218 218
         if (isset($inputs['password'])) {
219 219
             $inputs['password'] = \Hash::make($inputs['password']);
220 220
         }
221 221
         if (!empty($this->files)) {
222
-            $files = array_filter($inputs, function ($item, $key) {
222
+            $files = array_filter($inputs, function($item, $key) {
223 223
                 return in_array($key, $this->files) && $item instanceof UploadedFile;
224 224
             }, ARRAY_FILTER_USE_BOTH);
225 225
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
         try {
302 302
             $methods = (new ReflectionClass($model))->getMethods(ReflectionMethod::IS_PUBLIC);
303
-            foreach($methods as $method) {
303
+            foreach ($methods as $method) {
304 304
                 if (
305 305
                     $method->class != get_class($model) ||
306 306
                     !empty($method->getParameters()) ||
Please login to merge, or discard this patch.