| 1 | <?php declare(strict_types = 1); |
||
| 10 | trait Constructor |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Set a field value. |
||
| 14 | */ |
||
| 15 | abstract protected function setField(string $field, $value, bool $strict = true); |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Create a new JSKOS object with given field values. |
||
| 19 | * |
||
| 20 | * @param Array|Object fields to copy |
||
| 21 | * @param bool strict throw error on unknown fields |
||
| 22 | */ |
||
| 23 | public function __construct($data = null, bool $strict = false) |
||
| 43 | } |
||
| 44 |
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.