Completed
Push — master ( b0f7dc...017e63 )
by Takafumi
07:37
created
src/Http/Controllers/Controller.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     public function show(int $id)
107 107
     {
108 108
         $model = $this->model::findOrFail($id);
109
-        $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function ($type, $name) use ($model) {
109
+        $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function($type, $name) use ($model) {
110 110
             return !in_array($name, ['id', 'updated_at', $model->comments()->getForeignKeyName(), $model->comments()->getMorphType()]);
111 111
         }, ARRAY_FILTER_USE_BOTH);
112 112
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function create(Request $request)
155 155
     {
156
-        $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) {
156
+        $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) {
157 157
             return $item !== null;
158 158
         });
159 159
         if (isset($inputs['password'])) {
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     public function update(Request $request, int $id)
211 211
     {
212 212
         $model = $this->model::findOrFail($id);
213
-        $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) {
213
+        $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) {
214 214
             return $item !== null;
215 215
         });
216 216
         if (isset($inputs['password'])) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
         try {
289 289
             $methods = (new ReflectionClass($model))->getMethods(ReflectionMethod::IS_PUBLIC);
290
-            foreach($methods as $method) {
290
+            foreach ($methods as $method) {
291 291
                 if (
292 292
                     $method->class != get_class($model) ||
293 293
                     !empty($method->getParameters()) ||
@@ -372,8 +372,8 @@  discard block
 block discarded – undo
372 372
      */
373 373
     protected function getInputsWithFiles($request, $inputs)
374 374
     {
375
-        if (! empty($this->files)) {
376
-            $files = array_filter($inputs, function ($item, $key) {
375
+        if (!empty($this->files)) {
376
+            $files = array_filter($inputs, function($item, $key) {
377 377
                 return in_array($key, $this->files) && $item instanceof UploadedFile;
378 378
             }, ARRAY_FILTER_USE_BOTH);
379 379
 
Please login to merge, or discard this patch.