| 1 | <?php |
||
| 8 | class MakeTransformer extends TransformerAbstract |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * List of resources possible to include. |
||
| 12 | * |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $availableIncludes = ['racks', 'models', 'purchases', 'guitars']; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Turn this item object into a generic array. |
||
| 19 | * |
||
| 20 | * @param Make $make |
||
| 21 | * |
||
| 22 | * @return array |
||
| 23 | */ |
||
| 24 | 1 | public function transform(Make $make) |
|
| 31 | |||
| 32 | /** |
||
| 33 | * Include racks. |
||
| 34 | * |
||
| 35 | * @param Make $make |
||
| 36 | * |
||
| 37 | * @return \League\Fractal\Resource\Collection |
||
| 38 | */ |
||
| 39 | public function includeRacks(Make $make) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Include models. |
||
| 46 | * |
||
| 47 | * @param Make $make |
||
| 48 | * |
||
| 49 | * @return \League\Fractal\Resource\Collection |
||
| 50 | */ |
||
| 51 | public function includeModels(Make $make) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Include purchases. |
||
| 58 | * |
||
| 59 | * @param Make $make |
||
| 60 | * |
||
| 61 | * @return \League\Fractal\Resource\Collection |
||
| 62 | */ |
||
| 63 | public function includePurchases(Make $make) |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Include guitars. |
||
| 70 | * |
||
| 71 | * @param Make $make |
||
| 72 | * |
||
| 73 | * @return \League\Fractal\Resource\Collection |
||
| 74 | */ |
||
| 75 | public function includeGuitars(Make $make) |
||
| 79 | } |
||
| 80 |
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: