Completed
Push — master ( 4f4c65...7f4329 )
by Mehmet
02:53
created
src/RedisCache.php 1 patch
Spacing   +10 added lines, -10 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'],
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
      *
70 70
      * @return bool True on success and false on failure
71 71
      */
72
-    public function set($key, $value, $ttl = null){
72
+    public function set($key, $value, $ttl = null) {
73 73
         $ttl = intval($ttl);
74
-        if($ttl ==0 ){
74
+        if ($ttl == 0) {
75 75
             return $this->handler->set($key, $value);
76 76
         }
77 77
         return $this->handler->set($key, $value, $ttl);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      *
84 84
      * @return bool True on success and false on failure
85 85
      */
86
-    public function delete($key){
86
+    public function delete($key) {
87 87
         return (bool) $this->handler->delete($key);
88 88
     }
89 89
     /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      *
92 92
      * @return bool True on success and false on failure
93 93
      */
94
-    public function clear(){
94
+    public function clear() {
95 95
         return $this->handler->flushDb();
96 96
     }
97 97
     /**
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
             return $this->handler->mSet($items);
121 121
         }
122 122
 
123
-        $return =[];
123
+        $return = [];
124 124
         foreach ($items as $key=>$value) {
125
-            $return[$key] =  $this->set($key, $value, $ttl);
125
+            $return[$key] = $this->set($key, $value, $ttl);
126 126
         }
127 127
         return $return;
128 128
     }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function deleteMultiple($keys)
137 137
     {
138
-        $return =[];
138
+        $return = [];
139 139
         foreach ($keys as $key) {
140 140
             $return[$key] = (bool) $this->delete($key);
141 141
         }
Please login to merge, or discard this patch.