1 | <?php |
||
11 | class ContentCrud |
||
12 | { |
||
13 | /** |
||
14 | * Get all projects, sorted by oreder. |
||
15 | * |
||
16 | * @return \Illuminate\Support\Collection |
||
17 | */ |
||
18 | public function getDashboardProjects() |
||
22 | |||
23 | /** |
||
24 | * Get collection of project image info: [project name => small url]. |
||
25 | * |
||
26 | * @param \Illuminate\Support\Collection $projects Collection of projects. |
||
27 | * |
||
28 | * @return \Illuminate\Support\Collection |
||
29 | */ |
||
30 | public function getDashboardProjectImages(Collection $projects) |
||
36 | |||
37 | /** |
||
38 | * Get collection of project block info: [project name => block text]. |
||
39 | * |
||
40 | * @param \Illuminate\Support\Collection $projects Collection of projects. |
||
41 | * |
||
42 | * @return \Illuminate\Support\Collection |
||
43 | */ |
||
44 | public function getDashboardProjectBlocks(Collection $projects) |
||
50 | |||
51 | /** |
||
52 | * Get all pages, sorted by oreder. |
||
53 | * |
||
54 | * @return \Illuminate\Support\Collection |
||
55 | */ |
||
56 | public function getDashboardPages() |
||
60 | |||
61 | /** |
||
62 | * Show an individual resource in the manager. |
||
63 | * |
||
64 | * @param \Larafolio\Models\HasContent $model Resource to show. |
||
65 | * @param string $type Type of resource (page, project etc.). |
||
66 | * |
||
67 | * @return \Illuminate\Http\Response |
||
68 | */ |
||
69 | public function show(HasContent $model, $type) |
||
78 | |||
79 | /** |
||
80 | * Return the create resource page. |
||
81 | * |
||
82 | * @param string $type Type of resource (page, project etc.). |
||
83 | * |
||
84 | * @return \Illuminate\Http\Response |
||
85 | */ |
||
86 | public function create($type) |
||
90 | |||
91 | /** |
||
92 | * Add a new resource to the portfolio. |
||
93 | * |
||
94 | * @param \Illuminate\Http\Request $request Form request. |
||
95 | * @param User $user User object. |
||
96 | * @param string $type Type of resource (page, project etc.). |
||
97 | * |
||
98 | * @return \Illuminate\Http\Response |
||
99 | */ |
||
100 | public function store(Request $request, $user, $type) |
||
112 | |||
113 | /** |
||
114 | * Return the resource edit form view. |
||
115 | * |
||
116 | * @param \Larafolio\Models\HasContent $model Resource to show edit form for. |
||
117 | * |
||
118 | * @return \Illuminate\Http\Response |
||
119 | */ |
||
120 | public function edit(HasContent $model) |
||
137 | |||
138 | /** |
||
139 | * Update a resource. |
||
140 | * |
||
141 | * @param \Illuminate\Http\Request $request Request data. |
||
142 | * @param \Larafolio\Models\HasContent $model Resource to update. |
||
143 | * @param User $user User object. |
||
144 | * |
||
145 | * @return \Illuminate\Http\Response |
||
146 | */ |
||
147 | public function update(Request $request, HasContent $model, $user) |
||
167 | |||
168 | /** |
||
169 | * Remove a resource from the portfolio. |
||
170 | * |
||
171 | * @param \Illuminate\Http\Request $request Request data. |
||
172 | * @param \Larafolio\Models\HasContent $model Resource to update. |
||
173 | * @param User $user User object. |
||
174 | * |
||
175 | * @return \Illuminate\Http\Response|bool |
||
176 | */ |
||
177 | public function destroy(Request $request, HasContent $model, $user) |
||
197 | |||
198 | /** |
||
199 | * Make HasContent method. |
||
200 | * |
||
201 | * @param string $verb Action to perform. |
||
202 | * @param string $type Name of resource. |
||
203 | * |
||
204 | * @return string |
||
205 | */ |
||
206 | protected function makeMethod($verb, $type) |
||
210 | |||
211 | /** |
||
212 | * Make route name. |
||
213 | * |
||
214 | * @param string $verb Route action to perform. |
||
215 | * @param string $type Name of resource. |
||
216 | * |
||
217 | * @return string |
||
218 | */ |
||
219 | protected function makeRoute($verb, $type) |
||
223 | |||
224 | /** |
||
225 | * Get the model type (short class name) from the model. |
||
226 | * |
||
227 | * @param \Larafolio\Models\HasContent $model Model to get name of. |
||
228 | * |
||
229 | * @return string |
||
230 | */ |
||
231 | protected function getTypeFromModel(HasContent $model) |
||
237 | |||
238 | /** |
||
239 | * Icons needed for dashboard. |
||
240 | * |
||
241 | * @return array |
||
242 | */ |
||
243 | public function dashboardIcons() |
||
252 | |||
253 | /** |
||
254 | * Get icon file contents. |
||
255 | * |
||
256 | * @param string $path Path to icon file, relative to public path. |
||
257 | * |
||
258 | * @return string |
||
259 | */ |
||
260 | protected function getIcon($path) |
||
264 | } |
||
265 |
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: