@@ -62,17 +62,17 @@ class Zend_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_
6262 const DEFAULT_PERSISTENT = true ;
6363 const DEFAULT_DBINDEX = 0 ;
6464
65- protected $ _options = array (
66- 'servers ' => array (
67- array (
65+ protected $ _options = [
66+ 'servers ' => [
67+ [
6868 'host ' => self ::DEFAULT_HOST ,
6969 'port ' => self ::DEFAULT_PORT ,
7070 'persistent ' => self ::DEFAULT_PERSISTENT ,
7171 'dbindex ' => self ::DEFAULT_DBINDEX ,
72- ) ,
73- ) ,
72+ ] ,
73+ ] ,
7474 'key_prefix ' => '' ,
75- ) ;
75+ ] ;
7676
7777 /**
7878 * Redis object
@@ -206,9 +206,9 @@ public function save($data, $id, $tags =[], $specificLifetime = false)
206206 $ lifetime = $ this ->getLifetime ($ specificLifetime );
207207
208208 if (!$ tags || !count ($ tags ))
209- $ tags = array ( '' ) ;
209+ $ tags = [ '' ] ;
210210 if (is_string ($ tags ))
211- $ tags = array ( $ tags) ;
211+ $ tags = [ $ tags] ;
212212
213213 if (!count ($ tags )) {
214214 $ this ->_redis ->delete ($ this ->_keyFromItemTags ($ id ));
@@ -255,7 +255,7 @@ public function save($data, $id, $tags =[], $specificLifetime = false)
255255 $ redis = $ redis ->setex ($ this ->_keyFromId ($ id ), $ lifetime , $ data );
256256 }
257257
258- $ itemTags = array ( $ this ->_keyFromItemTags ($ id )) ;
258+ $ itemTags = [ $ this ->_keyFromItemTags ($ id )] ;
259259 foreach ($ tags as $ tag ) {
260260 $ itemTags [] = $ tag ;
261261 if ($ tag ) {
@@ -268,9 +268,9 @@ public function save($data, $id, $tags =[], $specificLifetime = false)
268268 }
269269 if (count ($ itemTags ) > 1 ) {
270270 if (!$ redis )
271- $ return [] = call_user_func_array (array ( $ this ->_redis , 'sAdd ' ) , $ itemTags );
271+ $ return [] = call_user_func_array ([ $ this ->_redis , 'sAdd ' ] , $ itemTags );
272272 else
273- $ redis = call_user_func_array (array ( $ redis , 'sAdd ' ) , $ itemTags );
273+ $ redis = call_user_func_array ([ $ redis , 'sAdd ' ] , $ itemTags );
274274 }
275275
276276 if ($ lifetime !== null ) {
@@ -381,7 +381,7 @@ public function remove($id, $hardReset = false)
381381 if (!$ id )
382382 return false ;
383383 if (is_string ($ id ))
384- $ id = array ( $ id) ;
384+ $ id = [ $ id] ;
385385 if (!count ($ id ))
386386 return false ;
387387 $ deleteIds = [];
@@ -410,7 +410,7 @@ public function removeTag($tag)
410410 if (!$ tag )
411411 return false ;
412412 if (is_string ($ tag ))
413- $ id = array ( $ tag) ;
413+ $ id = [ $ tag] ;
414414 if (!count ($ tag ))
415415 return false ;
416416 $ deleteTags = [];
@@ -457,7 +457,7 @@ public function addToSet($member, $set, $specificLifetime = false)
457457
458458 if (is_array ($ member )) {
459459 $ redis = $ this ->_redis ;
460- $ return = call_user_func_array (array ( $ redis , 'sAdd ' ) , array_merge (array ( $ this ->_keyFromId ($ set )) , $ member ));
460+ $ return = call_user_func_array ([ $ redis , 'sAdd ' ] , array_merge ([ $ this ->_keyFromId ($ set )] , $ member ));
461461 } else {
462462 $ return = $ this ->_redis ->sAdd ($ this ->_keyFromId ($ set ), $ member );
463463 }
@@ -483,7 +483,7 @@ public function removeFromSet($member, $set)
483483 if (!count ($ member ))
484484 return true ;
485485 $ redis = $ this ->_redis ;
486- $ return = call_user_func_array (array ( $ redis , 'sRem ' ) , array_merge (array ( $ this ->_keyFromId ($ set )) , $ member ));
486+ $ return = call_user_func_array ([ $ redis , 'sRem ' ] , array_merge ([ $ this ->_keyFromId ($ set )] , $ member ));
487487 } else {
488488 $ return = $ this ->_redis ->sRem ($ this ->_keyFromId ($ set ), $ member );
489489 }
@@ -652,7 +652,7 @@ public function getIdsMatchingTags($tags = [])
652652 if (!$ tags )
653653 return [];
654654 if ($ tags && is_string ($ tags ))
655- $ tags = array ( $ tags) ;
655+ $ tags = [ $ tags] ;
656656
657657 $ matchTags = [];
658658 foreach ($ tags as $ tag ) {
@@ -693,7 +693,7 @@ public function getIdsMatchingAnyTags($tags = [])
693693 if (!$ tags )
694694 return [];
695695 if ($ tags && is_string ($ tags ))
696- $ tags = array ( $ tags) ;
696+ $ tags = [ $ tags] ;
697697
698698 $ return = [];
699699 foreach ($ tags as $ tag ) {
@@ -798,13 +798,13 @@ protected function _touchKey($id, $extraLifetime)
798798 */
799799 public function getCapabilities ()
800800 {
801- return array (
801+ return [
802802 'automatic_cleaning ' => true ,
803803 'tags ' => true ,
804804 'expired_read ' => false ,
805805 'priority ' => false ,
806806 'infinite_lifetime ' => true ,
807807 'get_list ' => false
808- ) ;
808+ ] ;
809809 }
810810}
0 commit comments