1 | <?php |
||
14 | trait ArrayAccessible |
||
15 | { |
||
16 | |||
17 | use Concerns\HasAttributes; |
||
18 | |||
19 | /** |
||
20 | * Get an attribute from the container. |
||
21 | * |
||
22 | * @param string $key |
||
23 | * @param mixed $default |
||
24 | * |
||
25 | * @return mixed |
||
26 | */ |
||
27 | public function get(string $key, $default = null) |
||
35 | |||
36 | /** |
||
37 | * @param string $key |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function has(string $key) : bool |
||
45 | |||
46 | /** |
||
47 | * Determine if the given offset exists. |
||
48 | * |
||
49 | * @param string $offset |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | public function offsetExists($offset) |
||
57 | |||
58 | /** |
||
59 | * Get the value for a given offset. |
||
60 | * |
||
61 | * @param string $offset |
||
62 | * |
||
63 | * @return mixed |
||
64 | */ |
||
65 | public function offsetGet($offset) |
||
69 | |||
70 | /** |
||
71 | * Set the value at the given offset. |
||
72 | * |
||
73 | * @param string $offset |
||
74 | * @param mixed $value |
||
75 | * |
||
76 | * @return void |
||
77 | */ |
||
78 | public function offsetSet($offset, $value) |
||
82 | |||
83 | /** |
||
84 | * Unset the value at the given offset. |
||
85 | * |
||
86 | * @param string $offset |
||
87 | * |
||
88 | * @return void |
||
89 | */ |
||
90 | public function offsetUnset($offset) |
||
94 | |||
95 | /** |
||
96 | * Dynamically retrieve the value of an attribute. |
||
97 | * |
||
98 | * @param string $key |
||
99 | * |
||
100 | * @return mixed |
||
101 | */ |
||
102 | public function __get($key) |
||
106 | |||
107 | /** |
||
108 | * Dynamically set the value of an attribute. |
||
109 | * |
||
110 | * @param string $key |
||
111 | * @param mixed $value |
||
112 | * |
||
113 | * @return void |
||
114 | */ |
||
115 | public function __set($key, $value) |
||
119 | |||
120 | /** |
||
121 | * Dynamically check if an attribute is set. |
||
122 | * |
||
123 | * @param string $key |
||
124 | * |
||
125 | * @return bool |
||
126 | */ |
||
127 | public function __isset($key) |
||
131 | |||
132 | /** |
||
133 | * Dynamically unset an attribute. |
||
134 | * |
||
135 | * @param string $key |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | public function __unset($key) |
||
143 | } |
||
144 |