| 1 | <?php |
||
| 14 | class Widget { |
||
| 15 | |||
| 16 | private $widget = null; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Constructor |
||
| 20 | */ |
||
| 21 | |||
| 22 | public function __construct(Entitizer\Entity\Widget $widget) { |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Invoker |
||
| 29 | * |
||
| 30 | * @return true|string|array : true on success, otherwise an error code, or an array of type [$param_name, $error_code], |
||
| 31 | * where $param_name is a name of param that has triggered the error, |
||
| 32 | * and $error_code is a language phrase related to the error |
||
| 33 | */ |
||
| 34 | |||
| 35 | public function __invoke(array $post) { |
||
| 72 | } |
||
| 73 | } |
||
| 74 |
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.