| Conditions | 4 |
| Paths | 3 |
| Total Lines | 27 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | private function parseItem(int $id) : Template\Block { |
||
| 23 | |||
| 24 | if ([] !== $this->menu[$id]['children']) { |
||
| 25 | |||
| 26 | $item = View::get('Blocks/Utils/Menu/Container'); |
||
| 27 | |||
| 28 | $item->text = $this->menu[$id]['dataset']->text; |
||
|
|
|||
| 29 | |||
| 30 | $item->children = ($children = Template::createBlock()); |
||
| 31 | |||
| 32 | foreach ($this->menu[$id]['children'] as $child) $children->addItem($this->parseItem($child)); |
||
| 33 | |||
| 34 | } else { |
||
| 35 | |||
| 36 | $item = View::get('Blocks/Utils/Menu/Item'); |
||
| 37 | |||
| 38 | $item->target = (($this->menu[$id]['dataset']->target === TARGET_BLANK) ? '_blank' : '_self'); |
||
| 39 | |||
| 40 | $item->link = $this->menu[$id]['dataset']->link; |
||
| 41 | |||
| 42 | $item->text = $this->menu[$id]['dataset']->text; |
||
| 43 | } |
||
| 44 | |||
| 45 | # ------------------------ |
||
| 46 | |||
| 47 | return $item; |
||
| 48 | } |
||
| 49 | |||
| 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.