1 | <?php |
||
11 | trait MagicMethodsTrait |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @param $name |
||
16 | * @param $arguments |
||
17 | * @return string |
||
18 | */ |
||
19 | 19 | public function __call($name, $arguments) |
|
26 | |||
27 | /** |
||
28 | * @param $name |
||
29 | * @param $arguments |
||
30 | * @return mixed |
||
31 | */ |
||
32 | public static function __callStatic($name, $arguments) |
||
36 | } |
||
37 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: