Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function present($data) |
||
26 | { |
||
27 | if (! class_exists('League\Fractal\Manager')) { |
||
28 | throw new Exception(trans('repository::packages.league_fractal_required')); |
||
29 | } |
||
30 | if ($data instanceof Collection) { |
||
31 | $this->resource = $this->transformCollection($data); |
||
32 | } elseif ($data instanceof AbstractPaginator) { |
||
33 | $this->resource = $this->transformPaginator($data); |
||
34 | } else { |
||
35 | $this->resource = $this->transformItem($data); |
||
|
|||
36 | } |
||
37 | // set meta |
||
38 | $this->resource->setMeta($this->meta); |
||
39 | |||
40 | return $this->fractal->createData($this->resource)->toArray(); |
||
41 | } |
||
42 | |||
51 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..