Completed
Push — 2.0 ( 1bf2af...b5e900 )
by Marco
04:04
created
src/Comodojo/Cache/Drivers/PhpRedis.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
         $result = [];
177 177
 
178
-        foreach ($keys as $key) {
178
+        foreach ( $keys as $key ) {
179 179
             $result[$key] = $this->get($key, $namespace);
180 180
         }
181 181
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
         $result = [];
190 190
 
191
-        foreach ($key_values as $key => $value) {
191
+        foreach ( $key_values as $key => $value ) {
192 192
             $result[] = $this->set($key, $namespace, $value, $ttl);
193 193
         }
194 194
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         $result = [];
203 203
 
204
-        foreach ($keys as $key) {
204
+        foreach ( $keys as $key ) {
205 205
             $result[] = $this->delete($key, $namespace);
206 206
         }
207 207
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             $objects = $instance->dbSize();
241 241
             $stats = $instance->info();
242 242
 
243
-        } catch (RedisException $re ) {
243
+        } catch (RedisException $re) {
244 244
 
245 245
             throw $re;
246 246
 
Please login to merge, or discard this patch.
src/Comodojo/Cache/Item.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
     /**
90 90
      * {@inheritdoc}
91 91
      */
92
-    public function expiresAt($expiration=null) {
92
+    public function expiresAt($expiration = null) {
93 93
 
94
-        if (is_null($expiration)) {
94
+        if ( is_null($expiration) ) {
95 95
             $this->expiration = 0;
96 96
         }
97 97
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         }
114 114
 
115 115
         if ( is_numeric($time) ) {
116
-            $this->expiration = new DateTime('now +' . $time . ' seconds');
116
+            $this->expiration = new DateTime('now +'.$time.' seconds');
117 117
         }
118 118
 
119 119
         if ( $time instanceof DateInterval ) {
@@ -153,9 +153,9 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function getTtl() {
155 155
 
156
-        if (is_null($this->expiration)) return null;
156
+        if ( is_null($this->expiration) ) return null;
157 157
 
158
-        if ($this->expiration === 0) return 0;
158
+        if ( $this->expiration === 0 ) return 0;
159 159
 
160 160
         $now = new DateTime("now");
161 161
 
Please login to merge, or discard this patch.
src/Comodojo/Cache/Manager.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
 
95 95
     public function deleteItem($key) {
96 96
 
97
-        if ( $this->align_cache === false && $this->pick_mode < 5) {
97
+        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
98 98
             return $this->selectProvider()->deleteItem($key);
99 99
         }
100 100
 
101 101
         $result = [];
102 102
 
103
-        foreach ($this->stack as $provider) {
103
+        foreach ( $this->stack as $provider ) {
104 104
 
105 105
             $result[] = $provider[0]->deleteItem($key);
106 106
 
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 
113 113
     public function save(CacheItemInterface $item) {
114 114
 
115
-        if ( $this->align_cache === false && $this->pick_mode < 5) {
115
+        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
116 116
             return $this->selectProvider()->save($item);
117 117
         }
118 118
 
119 119
         $result = [];
120 120
 
121
-        foreach ($this->stack as $provider) {
121
+        foreach ( $this->stack as $provider ) {
122 122
 
123 123
             $pro = $provider[0];
124 124
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
         if ( $mode == 'GET' ) {
173 173
 
174
-            foreach ($this->stack as $provider) {
174
+            foreach ( $this->stack as $provider ) {
175 175
 
176 176
                 $result[] = $provider[0]->getItem($key);
177 177
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
         } else {
188 188
 
189
-            foreach ($this->stack as $provider) {
189
+            foreach ( $this->stack as $provider ) {
190 190
 
191 191
                 $result[] = $provider[0]->hasItem($key);
192 192
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
         if ( $mode == 'GET' ) {
209 209
 
210
-            foreach ($this->stack as $provider) {
210
+            foreach ( $this->stack as $provider ) {
211 211
 
212 212
                 $item = $provider[0]->getItem($key);
213 213
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
         } else {
231 231
 
232
-            foreach ($this->stack as $provider) {
232
+            foreach ( $this->stack as $provider ) {
233 233
 
234 234
                 $item = $provider[0]->hasItem($key);
235 235
 
Please login to merge, or discard this patch.
src/Comodojo/SimpleCache/Providers/Filesystem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
                 throw new InvalidSimpleCacheArgumentException("Invalid or unspecified cache folder");
37 37
             }
38 38
 
39
-            if ( $cache_folder[strlen($cache_folder)-1] != "/" ) $cache_folder = "$cache_folder/";
39
+            if ( $cache_folder[strlen($cache_folder) - 1] != "/" ) $cache_folder = "$cache_folder/";
40 40
 
41 41
             if ( self::isXattrSupported($cache_folder) ) {
42 42
                 $this->driver = new FilesystemXattrDriver(['cache-folder'=>$cache_folder]);
Please login to merge, or discard this patch.
src/Comodojo/SimpleCache/Providers/Memcached.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function __construct(
32 32
         $server = '127.0.0.1',
33
-        $port=11211,
34
-        $weight=0,
35
-        $persistent_id=null,
36
-        LoggerInterface $logger=null
33
+        $port = 11211,
34
+        $weight = 0,
35
+        $persistent_id = null,
36
+        LoggerInterface $logger = null
37 37
     ) {
38 38
 
39 39
         if ( empty($server) ) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         $objects = 0;
78 78
 
79
-        foreach ($info as $key => $value) {
79
+        foreach ( $info as $key => $value ) {
80 80
 
81 81
             $objects = max($objects, $value['curr_items']);
82 82
 
Please login to merge, or discard this patch.
src/Comodojo/SimpleCache/Providers/AbstractProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
      */
59 59
     public function setLogger(LoggerInterface $logger = null) {
60 60
 
61
-        $this->logger = is_null($logger) ? LogManager::create('cache',false)->getLogger() : $logger;
61
+        $this->logger = is_null($logger) ? LogManager::create('cache', false)->getLogger() : $logger;
62 62
 
63 63
         return $this;
64 64
 
Please login to merge, or discard this patch.
src/Comodojo/SimpleCache/Providers/AbstractEnhancedProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 
145 145
     public function getMultiple($keys, $default = null) {
146 146
 
147
-        if ( !is_array($keys) && !($keys instanceof Traversable ) ) {
147
+        if ( !is_array($keys) && !($keys instanceof Traversable) ) {
148 148
             throw new InvalidSimpleCacheArgumentException('Invalid keys provided');
149 149
         }
150 150
 
151
-        foreach ($keys as $key) {
151
+        foreach ( $keys as $key ) {
152 152
             if ( KeyValidator::validateKey($key) === false ) {
153 153
                 throw new InvalidSimpleCacheArgumentException('Invalid key provided');
154 154
             }
@@ -174,13 +174,13 @@  discard block
 block discarded – undo
174 174
 
175 175
     public function setMultiple($values, $ttl = null) {
176 176
 
177
-        if ( !is_array($values) && !($values instanceof Traversable ) ) {
177
+        if ( !is_array($values) && !($values instanceof Traversable) ) {
178 178
             throw new InvalidSimpleCacheArgumentException('Invalid keys provided');
179 179
         }
180 180
 
181 181
         $real_values = [];
182 182
 
183
-        foreach ($values as $key => $value) {
183
+        foreach ( $values as $key => $value ) {
184 184
             if ( KeyValidator::validateKey($key) === false ) {
185 185
                 throw new InvalidSimpleCacheArgumentException('Invalid key provided');
186 186
             }
@@ -213,11 +213,11 @@  discard block
 block discarded – undo
213 213
 
214 214
     public function deleteMultiple($keys) {
215 215
 
216
-        if ( !is_array($keys) && !($keys instanceof Traversable ) ) {
216
+        if ( !is_array($keys) && !($keys instanceof Traversable) ) {
217 217
             throw new InvalidSimpleCacheArgumentException('Invalid keys provided');
218 218
         }
219 219
 
220
-        foreach ($keys as $key) {
220
+        foreach ( $keys as $key ) {
221 221
             if ( KeyValidator::validateKey($key) === false ) {
222 222
                 throw new InvalidSimpleCacheArgumentException('Invalid key provided');
223 223
             }
Please login to merge, or discard this patch.
src/Comodojo/SimpleCache/Providers/PhpRedis.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
 
32 32
     public function __construct(
33 33
         $server = '127.0.0.1',
34
-        $port=6379,
35
-        $timeout=0,
36
-        LoggerInterface $logger=null
34
+        $port = 6379,
35
+        $timeout = 0,
36
+        LoggerInterface $logger = null
37 37
     ) {
38 38
 
39 39
         if ( empty($server) ) {
Please login to merge, or discard this patch.
src/Comodojo/SimpleCache/Manager.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 
86 86
     public function set($key, $value, $ttl = null) {
87 87
 
88
-        if ( $this->align_cache === false && $this->pick_mode < 5) {
88
+        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
89 89
             return $this->selectProvider()->set($key, $value, $ttl);
90 90
         }
91 91
 
92 92
         $result = [];
93 93
 
94
-        foreach ($this->stack as $provider) {
94
+        foreach ( $this->stack as $provider ) {
95 95
 
96 96
             $pro = $provider[0];
97 97
 
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
 
111 111
     public function delete($key) {
112 112
 
113
-        if ( $this->align_cache === false && $this->pick_mode < 5) {
113
+        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
114 114
             return $this->selectProvider()->delete($key);
115 115
         }
116 116
 
117 117
         $result = [];
118 118
 
119
-        foreach ($this->stack as $provider) {
119
+        foreach ( $this->stack as $provider ) {
120 120
 
121 121
             $result[] = $provider[0]->delete($key);
122 122
 
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
 
135 135
     public function setMultiple($values, $ttl = null) {
136 136
 
137
-        if ( $this->align_cache === false && $this->pick_mode < 5) {
137
+        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
138 138
             return $this->selectProvider()->setMultiple($values, $ttl);
139 139
         }
140 140
 
141 141
         $result = [];
142 142
 
143
-        foreach ($this->stack as $provider) {
143
+        foreach ( $this->stack as $provider ) {
144 144
 
145 145
             $result[] = $provider[0]->setMultiple($values, $ttl);
146 146
 
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 
153 153
     public function deleteMultiple($keys) {
154 154
 
155
-        if ( $this->align_cache === false && $this->pick_mode < 5) {
155
+        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
156 156
             return $this->selectProvider()->deleteMultiple($keys);
157 157
         }
158 158
 
159 159
         $result = [];
160 160
 
161
-        foreach ($this->stack as $provider) {
161
+        foreach ( $this->stack as $provider ) {
162 162
 
163 163
             $result[] = $provider[0]->deleteMultiple($keys);
164 164
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
     }
176 176
 
177
-    protected function selectFrom($mode, $key, $default=null) {
177
+    protected function selectFrom($mode, $key, $default = null) {
178 178
 
179 179
         if ( $this->pick_mode < 5 ) {
180 180
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
         $provider = $this->selectProvider();
200 200
 
201
-        switch ($mode) {
201
+        switch ( $mode ) {
202 202
 
203 203
             case 'GET':
204 204
                 $data = $provider->get($key, $default);
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
         if ( $mode == 'GET' ) {
226 226
 
227
-            foreach ($this->stack as $provider) {
227
+            foreach ( $this->stack as $provider ) {
228 228
 
229 229
                 $result[] = $provider[0]->get($key, $default);
230 230
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
         } else if ( $mode == 'GETMULTIPLE' ) {
241 241
 
242
-            foreach ($this->stack as $provider) {
242
+            foreach ( $this->stack as $provider ) {
243 243
 
244 244
                 $result[] = $provider[0]->getMultiple($key, $default);
245 245
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
         } else {
260 260
 
261
-            foreach ($this->stack as $provider) {
261
+            foreach ( $this->stack as $provider ) {
262 262
 
263 263
                 $result[] = $provider[0]->has($key);
264 264
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
         if ( $mode == 'GET' ) {
281 281
 
282
-            foreach ($this->stack as $provider) {
282
+            foreach ( $this->stack as $provider ) {
283 283
 
284 284
                 $item = $provider[0]->get($key);
285 285
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
         } else if ( $mode == 'GETMULTIPLE' ) {
303 303
 
304
-            foreach ($this->stack as $provider) {
304
+            foreach ( $this->stack as $provider ) {
305 305
 
306 306
                 $items = $provider[0]->getMultiple($key);
307 307
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
         } else {
327 327
 
328
-            foreach ($this->stack as $provider) {
328
+            foreach ( $this->stack as $provider ) {
329 329
 
330 330
                 $item = $provider[0]->has($key);
331 331
 
Please login to merge, or discard this patch.