@@ 146-158 (lines=13) @@ | ||
143 | * @throws InvalidArgumentException |
|
144 | * @throws LogicException |
|
145 | */ |
|
146 | public function offsetSet($offset, $value) |
|
147 | { |
|
148 | trigger_error($this->getDeprecatedMsg(), E_USER_DEPRECATED); |
|
149 | if (!is_string($offset)) { |
|
150 | throw new InvalidArgumentException('$offset must be a string'); |
|
151 | } else { |
|
152 | if (property_exists($this, $offset)) { |
|
153 | $this->{$offset} = $value; |
|
154 | } else { |
|
155 | throw new LogicException("Property {$offset} does not exists"); |
|
156 | } |
|
157 | } |
|
158 | } |
|
159 | ||
160 | /** |
|
161 | * @param string $offset |
|
@@ 166-178 (lines=13) @@ | ||
163 | * @throws InvalidArgumentException |
|
164 | * @throws LogicException |
|
165 | */ |
|
166 | public function offsetExists($offset) |
|
167 | { |
|
168 | trigger_error($this->getDeprecatedMsg(), E_USER_DEPRECATED); |
|
169 | if (!is_string($offset)) { |
|
170 | throw new InvalidArgumentException('$offset must be a string'); |
|
171 | } else { |
|
172 | if (property_exists($this, $offset)) { |
|
173 | return isset($this->{$offset}); |
|
174 | } else { |
|
175 | throw new LogicException("Property {$offset} does not exists"); |
|
176 | } |
|
177 | } |
|
178 | } |
|
179 | ||
180 | /** |
|
181 | * @param string $offset |
|
@@ 185-197 (lines=13) @@ | ||
182 | * @throws InvalidArgumentException |
|
183 | * @throws LogicException |
|
184 | */ |
|
185 | public function offsetUnset($offset) |
|
186 | { |
|
187 | trigger_error($this->getDeprecatedMsg(), E_USER_DEPRECATED); |
|
188 | if (!is_string($offset)) { |
|
189 | throw new InvalidArgumentException('$offset must be a string'); |
|
190 | } else { |
|
191 | if (property_exists($this, $offset)) { |
|
192 | unset($this->{$offset}); |
|
193 | } else { |
|
194 | throw new LogicException("Property {$offset} does not exists"); |
|
195 | } |
|
196 | } |
|
197 | } |
|
198 | ||
199 | /** |
|
200 | * @param string $offset |
|
@@ 205-217 (lines=13) @@ | ||
202 | * @throws InvalidArgumentException |
|
203 | * @throws LogicException |
|
204 | */ |
|
205 | public function offsetGet($offset) |
|
206 | { |
|
207 | trigger_error($this->getDeprecatedMsg(), E_USER_DEPRECATED); |
|
208 | if (!is_string($offset)) { |
|
209 | throw new InvalidArgumentException('$offset must be a string'); |
|
210 | } else { |
|
211 | if (property_exists($this, $offset)) { |
|
212 | return isset($this->{$offset}) ? $this->{$offset} : null; |
|
213 | } else { |
|
214 | throw new LogicException("Property {$offset} does not exists"); |
|
215 | } |
|
216 | } |
|
217 | } |
|
218 | ||
219 | /** |
|
220 | * @return string |