Completed
Branch master (4f4c65)
by Mehmet
02:55
created
src/RedisCache.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function __construct(array $config)
26 26
     {
27
-        $this->handler= new \Redis();
28
-        $redisConfig= $this::$defaults;
27
+        $this->handler = new \Redis();
28
+        $redisConfig = $this::$defaults;
29 29
         foreach ($config as $key=>$value) {
30 30
             $redisConfig[$key] = $value;
31 31
         }
32
-        if( isset($redisConfig['persistent']) && ($redisConfig['persistent'] === true)){
32
+        if (isset($redisConfig['persistent']) && ($redisConfig['persistent'] === true)) {
33 33
             $this->handler->connect(
34 34
                 $redisConfig['host'],
35 35
                 $redisConfig['port'],
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                 $redisConfig['reconnectAttempt']
39 39
             );
40 40
         }
41
-        else{
41
+        else {
42 42
             $this->handler->pconnect(
43 43
                 $redisConfig['host'],
44 44
                 $redisConfig['port'],
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      *
71 71
      * @return bool True on success and false on failure
72 72
      */
73
-    public function set($key, $value, $ttl = null){
73
+    public function set($key, $value, $ttl = null) {
74 74
         $ttl = intval($ttl);
75
-        if($ttl ==0 ){
75
+        if ($ttl == 0) {
76 76
             return $this->handler->set($key, $value);
77 77
         }
78 78
         return $this->handler->set($key, $value, $ttl);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      *
85 85
      * @return bool True on success and false on failure
86 86
      */
87
-    public function delete($key){
87
+    public function delete($key) {
88 88
         return (bool) $this->handler->delete($key);
89 89
     }
90 90
     /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      *
93 93
      * @return bool True on success and false on failure
94 94
      */
95
-    public function clear(){
95
+    public function clear() {
96 96
         return $this->handler->flushDb();
97 97
     }
98 98
     /**
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
             return $this->handler->mSet($items);
122 122
         }
123 123
 
124
-        $return =[];
124
+        $return = [];
125 125
         foreach ($items as $key=>$value) {
126
-            $return[$key] =  $this->set($key, $value, $ttl);
126
+            $return[$key] = $this->set($key, $value, $ttl);
127 127
         }
128 128
         return $return;
129 129
     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function deleteMultiple($keys)
138 138
     {
139
-        $return =[];
139
+        $return = [];
140 140
         foreach ($keys as $key) {
141 141
             $return[$key] = (bool) $this->delete($key);
142 142
         }
Please login to merge, or discard this patch.