1313 */
1414namespace phpFastCache \Entities ;
1515
16- use ArrayAccess ;
17- use InvalidArgumentException ;
18- use LogicException ;
19-
2016/**
2117 * Class driverStatistic
2218 * @package phpFastCache\Entities
2319 */
24- class driverStatistic implements ArrayAccess
20+ class driverStatistic
2521{
2622 /**
2723 * @var string
@@ -132,96 +128,4 @@ public function getPublicDesc()
132128 'RawData ' => 'Cache raw data ' ,
133129 ];
134130 }
135-
136- /*****************
137- * ArrayAccess
138- *****************/
139-
140- /**
141- * @param string $offset
142- * @param string $value
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
162- * @return bool
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
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
201- * @return string
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
221- */
222- private function getDeprecatedMsg ()
223- {
224- return 'You should consider upgrading your code and treat the statistic array as an object.
225- The arrayAccess compatibility will be removed in the next major release (>=V6) ' ;
226- }
227131}
0 commit comments