1 | <?php |
||
15 | class FlowController extends Controller |
||
16 | { |
||
17 | use FlowManager; |
||
18 | |||
19 | |||
20 | /** |
||
21 | * @param Requests\FlowRequest $request |
||
22 | * @return mixed |
||
23 | */ |
||
24 | public function store(Requests\FlowRequest $request) |
||
25 | { |
||
26 | $flow = $this->createFlow($request->all()); |
||
27 | $response = fractal()->item($flow, new FlowTransformer)->toArray(); |
||
28 | return response()->json($response); |
||
|
|||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param Requests\FlowRequest $request |
||
33 | * @param $id |
||
34 | * @return mixed |
||
35 | */ |
||
36 | public function update(Requests\FlowRequest $request, $id) |
||
37 | { |
||
38 | $flow = $this->updateFlow(Flow::findOrFail($id), $request->all()); |
||
39 | $response = fractal()->item($flow, new FlowTransformer)->toArray(); |
||
40 | return response()->json($response); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param $id |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function destroy($id) |
||
52 | } |
||
53 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.