1 | <?php |
||
12 | class Reflectable implements \ArrayAccess, \Countable |
||
13 | { |
||
14 | /** |
||
15 | * Data |
||
16 | * |
||
17 | * @var array |
||
18 | * @access private |
||
19 | */ |
||
20 | private $data = []; |
||
21 | |||
22 | /** |
||
23 | * Get a data by key |
||
24 | * |
||
25 | * @param string The key data to retrieve |
||
26 | * @access public |
||
27 | */ |
||
28 | public function &__get($key) |
||
32 | |||
33 | |||
34 | /** |
||
35 | * Assigns a value to the specified data |
||
36 | * |
||
37 | * @param string The data key to assign the value to |
||
38 | * @param mixed The value to set |
||
39 | * @access public |
||
40 | */ |
||
41 | public function __set($key, $value) |
||
45 | |||
46 | /** |
||
47 | * Whether or not an data exists by key |
||
48 | * |
||
49 | * @param string An data key to check for |
||
50 | * @access public |
||
51 | * @return boolean |
||
52 | * @abstracting ArrayAccess |
||
53 | */ |
||
54 | public function __isset($key) |
||
58 | |||
59 | /** |
||
60 | * Unsets an data by key |
||
61 | * |
||
62 | * @param string The key to unset |
||
63 | * @access public |
||
64 | */ |
||
65 | public function __unset($key) |
||
69 | |||
70 | /** |
||
71 | * Assigns a value to the specified offset |
||
72 | * |
||
73 | * @param string The offset to assign the value to |
||
74 | * @param mixed The value to set |
||
75 | * @access public |
||
76 | * @abstracting ArrayAccess |
||
77 | */ |
||
78 | public function offsetSet($offset, $value) |
||
86 | |||
87 | /** |
||
88 | * Whether or not an offset exists |
||
89 | * |
||
90 | * @param string An offset to check for |
||
91 | * @access public |
||
92 | * @return boolean |
||
93 | * @abstracting ArrayAccess |
||
94 | */ |
||
95 | public function offsetExists($offset) |
||
99 | |||
100 | /** |
||
101 | * Unsets an offset |
||
102 | * |
||
103 | * @param string The offset to unset |
||
104 | * @access public |
||
105 | * @abstracting ArrayAccess |
||
106 | */ |
||
107 | public function offsetUnset($offset) |
||
113 | |||
114 | /** |
||
115 | * Returns the value at specified offset |
||
116 | * |
||
117 | * @param string The offset to retrieve |
||
118 | * @access public |
||
119 | * @return mixed |
||
120 | * @abstracting ArrayAccess |
||
121 | */ |
||
122 | public function offsetGet($offset) |
||
126 | |||
127 | public function clear() |
||
135 | |||
136 | public function rewind() { |
||
139 | |||
140 | public function count() { |
||
143 | } |