| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 11 | public function __construct(Entitizer\Entity\Variable $variable) { |
||
| 12 | |||
| 13 | parent::__construct(ENTITY_TYPE_VARIABLE); |
||
| 14 | |||
| 15 | # Add fields |
||
| 16 | |||
| 17 | $this->addText('title', $variable->title, FORM_FIELD_TEXT, CONFIG_VARIABLE_TITLE_MAX_LENGTH, ['required' => true]); |
||
|
|
|||
| 18 | |||
| 19 | $this->addText('name', $variable->name, FORM_FIELD_TEXT, CONFIG_VARIABLE_NAME_MAX_LENGTH, |
||
| 20 | |||
| 21 | ['required' => true, 'convert' => 'var']); |
||
| 22 | |||
| 23 | $this->addText('value', $variable->value, FORM_FIELD_TEXT, CONFIG_VARIABLE_VALUE_MAX_LENGTH); |
||
| 24 | } |
||
| 25 | } |
||
| 27 |
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.