Passed
Push — relationships ( d37974...d3f308 )
by Alex
02:50
created
src/Http/Controllers/JsonApiController.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      * Return a specified record.
90 90
      *
91 91
      * @param Request   $request
92
-     * @param Model|int $record
92
+     * @param Model $record
93 93
      *
94 94
      * @return JsonApiResponse
95 95
      */
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     /**
278 278
      * Sort a resource query by one or more attributes.
279 279
      *
280
-     * @param Illuminate\Database\Eloquent\Builder $query
280
+     * @param \Illuminate\Database\Eloquent\Builder $query
281 281
      * @param array                                $attributes
282 282
      *
283 283
      * @return Illuminate\Database\Eloquent\Builder
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.