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