1 | <?php |
||
28 | trait GenericTrait |
||
29 | { |
||
30 | use HasReflectorTrait; |
||
31 | |||
32 | /** |
||
33 | * @var GenericContext |
||
34 | */ |
||
35 | protected $genericContext; |
||
36 | |||
37 | /** |
||
38 | * @var ObjectType |
||
39 | */ |
||
40 | protected $objectType; |
||
41 | |||
42 | /** |
||
43 | * Gets the object descriptor for this class |
||
44 | * |
||
45 | * @return ObjectType |
||
46 | */ |
||
47 | 2 | public function getObjectType() : ObjectType |
|
57 | |||
58 | /** |
||
59 | * Gets the generic context for this class or creates one if it does |
||
60 | * not exist |
||
61 | * |
||
62 | * @return GenericContext |
||
63 | */ |
||
64 | public function getGenericContext() : GenericContext |
||
77 | |||
78 | /** |
||
79 | * Sets the generic context for this class if one does not already |
||
80 | * exist |
||
81 | * |
||
82 | * @param GenericContext $genericContext |
||
83 | */ |
||
84 | public function setGenericContext(GenericContext $genericContext) |
||
99 | |||
100 | /** |
||
101 | * Gets an instance of a generic |
||
102 | * |
||
103 | * @param string $name |
||
104 | * @return mixed |
||
105 | */ |
||
106 | protected function getInstanceOfGeneric(string $name) |
||
113 | } |
||
114 |
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@property
annotation 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.