| 1 | <?php |
||
| 14 | class Menu { |
||
| 15 | |||
| 16 | private $menu = [0 => ['children' => []]]; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Parse a menu item |
||
| 20 | */ |
||
| 21 | |||
| 22 | private function parseItem(int $id) : Template\Block { |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Constructor |
||
| 52 | */ |
||
| 53 | |||
| 54 | public function __construct() { |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Get a menu block |
||
| 63 | */ |
||
| 64 | |||
| 65 | public function getBlock() : Template\Block { |
||
| 75 | } |
||
| 76 | } |
||
| 77 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.