1 | <?php |
||
4 | trait Attributes |
||
5 | { |
||
6 | /** @var array */ |
||
7 | protected $attributes = []; |
||
8 | |||
9 | /** |
||
10 | * @param string $name |
||
11 | * @param array $arguments |
||
12 | * @return static |
||
13 | */ |
||
14 | 3 | public function __call($name, array $arguments = []) |
|
21 | |||
22 | /** |
||
23 | * @param string $name |
||
24 | * @return mixed |
||
25 | */ |
||
26 | function __get($name) |
||
30 | |||
31 | /** |
||
32 | * @param string $name |
||
33 | * @param string $value |
||
34 | */ |
||
35 | function __set($name, $value) |
||
39 | |||
40 | /** |
||
41 | * @param string $offset |
||
42 | * @return bool |
||
43 | */ |
||
44 | public function offsetExists($offset) |
||
48 | |||
49 | /** |
||
50 | * @param string $offset |
||
51 | * @return mixed |
||
52 | */ |
||
53 | public function offsetGet($offset) |
||
57 | |||
58 | /** |
||
59 | * @param string $offset |
||
60 | * @param mixed $value |
||
61 | */ |
||
62 | public function offsetSet($offset, $value) |
||
66 | |||
67 | /** |
||
68 | * @param string $offset |
||
69 | */ |
||
70 | public function offsetUnset($offset) |
||
74 | } |
||
75 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.