| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 11 | public function __construct(Entitizer\Entity\Widget $widget) { |
||
| 12 | |||
| 13 | parent::__construct(ENTITY_TYPE_WIDGET); |
||
| 14 | |||
| 15 | # Add fields |
||
| 16 | |||
| 17 | $this->addText('title', $widget->title, FORM_FIELD_TEXT, CONFIG_WIDGET_TITLE_MAX_LENGTH, ['required' => true]); |
||
|
|
|||
| 18 | |||
| 19 | $this->addText('name', $widget->name, FORM_FIELD_TEXT, CONFIG_WIDGET_NAME_MAX_LENGTH, |
||
| 20 | |||
| 21 | ['required' => true, 'convert' => 'var']); |
||
| 22 | |||
| 23 | $this->addCheckbox('display', $widget->display); |
||
| 24 | |||
| 25 | $this->addText('contents', $widget->contents, FORM_FIELD_TEXTAREA, 0, ['multiline' => true, 'codestyle' => true]); |
||
| 26 | } |
||
| 27 | } |
||
| 29 |
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.