Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
20 | public function update(Request $request) |
||
21 | { |
||
22 | $request['user_id'] = Auth::user()->id; |
||
23 | $favorite = Favorite::where('user_id', Auth::user()->id) |
||
24 | ->where('video_id', $request->input('video_id')) |
||
25 | ->get(); |
||
26 | |||
27 | if ($favorite->count() === 0) { |
||
28 | return $this->videoRepository->favoriteVideo($request->all()); |
||
|
|||
29 | } |
||
30 | |||
31 | return $this->videoRepository->unFavoriteVideo($request->all()); |
||
32 | } |
||
33 | } |
||
34 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: