1 | <?php |
||
17 | class VideoController extends ApiGuardController |
||
18 | { |
||
19 | /** |
||
20 | * @var VideoTransformer |
||
21 | */ |
||
22 | protected $videoTransformer; |
||
23 | |||
24 | /** |
||
25 | * @var Video |
||
26 | */ |
||
27 | protected $video; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $apiMethods = [ |
||
33 | 'getAllVideos' => [ |
||
34 | 'keyAuthentication' => false, |
||
35 | ], |
||
36 | 'show' => [ |
||
37 | 'keyAuthentication' => false, |
||
38 | ], |
||
39 | 'getBestVideos' => [ |
||
40 | 'keyAuthentication' => false, |
||
41 | ], |
||
42 | 'getVideosUser' => [ |
||
43 | 'keyAuthentication' => false, |
||
44 | ], |
||
45 | 'getVideosForCategory' => [ |
||
46 | 'keyAuthentication' => false, |
||
47 | ], |
||
48 | 'getVideosForSearch' => [ |
||
49 | 'keyAuthentication' => false, |
||
50 | ], |
||
51 | 'store' => [ |
||
52 | 'limits' => [ |
||
53 | 'key' => [ |
||
54 | 'increment' => '1 hour', |
||
55 | 'limit' => 10, |
||
56 | ], |
||
57 | ], |
||
58 | ], |
||
59 | ]; |
||
60 | |||
61 | /** |
||
62 | * VideoController constructor. |
||
63 | * |
||
64 | * @param VideoTransformer $videoTransformer |
||
65 | * @param Video $video |
||
66 | * @param User $user |
||
67 | */ |
||
68 | 12 | public function __construct(Video $video, User $user, VideoTransformer $videoTransformer) |
|
69 | { |
||
70 | 12 | parent::__construct(); |
|
71 | |||
72 | 12 | $this->videoTransformer = $videoTransformer; |
|
73 | 12 | $this->video = $video; |
|
74 | 12 | $this->user = $user; |
|
75 | 12 | } |
|
76 | |||
77 | /** |
||
78 | * Return all Videos. |
||
79 | */ |
||
80 | 5 | public function getAllVideos() |
|
86 | |||
87 | /** |
||
88 | * Return the best Videos. |
||
89 | */ |
||
90 | 1 | public function getBestVideos() |
|
96 | |||
97 | /** |
||
98 | * Return Videos only user. |
||
99 | */ |
||
100 | 1 | public function getVideosUser($id) |
|
107 | |||
108 | /** |
||
109 | * Return Videos for Category. |
||
110 | */ |
||
111 | 1 | public function getVideosForCategory($name) |
|
117 | |||
118 | /** |
||
119 | * Return Videos for Search. |
||
120 | */ |
||
121 | 1 | public function getVideosForSearch($search) |
|
127 | |||
128 | /** |
||
129 | * Store a newly created video in storage. |
||
130 | * |
||
131 | * @param VideoUploadRequest $request |
||
132 | * |
||
133 | * @return mixed |
||
134 | */ |
||
135 | 1 | public function store(VideoUploadRequest $request) |
|
154 | |||
155 | /** |
||
156 | * @param $id |
||
157 | * |
||
158 | * @return mixed |
||
159 | */ |
||
160 | 2 | public function show($id) |
|
166 | |||
167 | /** |
||
168 | * Update the specified video in storage. |
||
169 | * |
||
170 | * @param Request $request |
||
171 | * @param $id |
||
172 | * |
||
173 | * @return mixed |
||
174 | */ |
||
175 | 1 | public function update(Request $request, $id) |
|
183 | |||
184 | /** |
||
185 | * Remove the specified video from storage. |
||
186 | * |
||
187 | * @param $id |
||
188 | * |
||
189 | * @return mixed |
||
190 | */ |
||
191 | 1 | public function destroy($id) |
|
201 | |||
202 | /** |
||
203 | * Save and Convert to webm video. |
||
204 | * |
||
205 | * @param $video |
||
206 | * @param $name |
||
207 | */ |
||
208 | 1 | private function saveAndConvert($video, $name) |
|
218 | } |
||
219 |
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: