1 | <?php |
||
21 | trait ContainerProxyTrait |
||
22 | { |
||
23 | /** |
||
24 | * Proxies calls into the container. |
||
25 | * |
||
26 | * @param string $method |
||
27 | * @param array $parameters |
||
28 | * |
||
29 | * @throws \BadMethodCallException |
||
30 | * |
||
31 | * @return mixed |
||
32 | */ |
||
33 | public function __call(string $method, array $parameters) |
||
41 | |||
42 | /** |
||
43 | * Dynamically access container services. |
||
44 | * |
||
45 | * @param string $key |
||
46 | * |
||
47 | * @return mixed |
||
48 | */ |
||
49 | public function __get(string $key) |
||
53 | |||
54 | /** |
||
55 | * Dynamically set container services. |
||
56 | * |
||
57 | * @param string $key |
||
58 | * @param mixed $value |
||
59 | * |
||
60 | * @return void |
||
61 | */ |
||
62 | public function __set(string $key, $value): void |
||
66 | |||
67 | /** |
||
68 | * Determine if a given offset exists. |
||
69 | * |
||
70 | * @param string $key |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function offsetExists($key): bool |
||
78 | |||
79 | /** |
||
80 | * Get the value at a given offset. |
||
81 | * |
||
82 | * @param string $key |
||
83 | * |
||
84 | * @return mixed |
||
85 | */ |
||
86 | public function offsetGet($key) |
||
90 | |||
91 | /** |
||
92 | * Set the value at a given offset. |
||
93 | * |
||
94 | * @param string $key |
||
95 | * @param mixed $value |
||
96 | * |
||
97 | * @return void |
||
98 | */ |
||
99 | public function offsetSet($key, $value): void |
||
103 | |||
104 | /** |
||
105 | * Unset the value at a given offset. |
||
106 | * |
||
107 | * @param string $key |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | public function offsetUnset($key): void |
||
115 | } |
||
116 |
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@property
annotation 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.