| 1 | <?php namespace App\LaravelRestCms\Page; |
||
| 9 | class PageTransformer extends BaseTransformer { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * List of resources possible to include |
||
| 13 | * |
||
| 14 | * @var array |
||
| 15 | */ |
||
| 16 | protected $availableIncludes = [ |
||
| 17 | 'detail', |
||
| 18 | 'template', |
||
| 19 | ]; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Include Page Detail |
||
| 23 | * |
||
| 24 | * @param \App\LaravelRestCms\Page\Page |
||
| 25 | * @return \League\Fractal\ItemResource |
||
| 26 | */ |
||
| 27 | public function includeDetail(Page $page) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Include Template |
||
| 34 | * |
||
| 35 | * @param \App\LaravelRestCms\Page\Page |
||
| 36 | * @return \League\Fractal\ItemResource |
||
| 37 | */ |
||
| 38 | public function includeTemplate(Page $page) |
||
| 42 | } |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.