Passed
Push — relationships ( d3f308...ba3a3d )
by Alex
02:29
created
src/Http/Controllers/JsonApiController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
      * Return a specified record.
64 64
      *
65 65
      * @param Request   $request
66
-     * @param Model|int $record
66
+     * @param Model $record
67 67
      *
68 68
      * @return JsonApiResponse
69 69
      */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         $record = $record instanceof Model ? $record : $this->findModelInstance($record);
188 188
         $data = (array) $request->input('data');
189 189
 
190
-        $record->update([($foreignKey ?: $relation . '_id') => $data['id']]);
190
+        $record->update([($foreignKey ?: $relation.'_id') => $data['id']]);
191 191
 
192 192
         return new JsonApiResponse();
193 193
     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     protected function getRequestParameters($request)
255 255
     {
256 256
         return [
257
-            'fields' => $this->getRequestQuerySet($request, 'fields.' . $this->getModelType()),
257
+            'fields' => $this->getRequestQuerySet($request, 'fields.'.$this->getModelType()),
258 258
             'include' => $this->getRequestQuerySet($request, 'include'),
259 259
             'sort' => $this->getRequestQuerySet($request, 'sort'),
260 260
             'filter' => (array) $request->input('filter'),
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
                 $query = $query->where($column, filter_var($value, FILTER_VALIDATE_BOOLEAN));
313 313
             } else {
314 314
                 // Partial string match
315
-                $query = $query->where($column, 'like', '%' . $value . '%');
315
+                $query = $query->where($column, 'like', '%'.$value.'%');
316 316
             }
317 317
         }
318 318
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
      */
381 381
     protected function transformCollection($records, array $fields = [])
382 382
     {
383
-        $data = $records->map(function ($record) use ($fields) {
383
+        $data = $records->map(function($record) use ($fields) {
384 384
             return $this->transformRecord($record, $fields)['data'];
385 385
         });
386 386
 
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
      */
398 398
     protected function transformCollectionIds($records)
399 399
     {
400
-        $data = $records->map(function ($record) {
400
+        $data = $records->map(function($record) {
401 401
             return [
402 402
                 'type' => $record->getTable(),
403 403
                 'id' => $record->id,
Please login to merge, or discard this patch.