Completed
Push — 2.0 ( a52f91...c9f4d8 )
by Marco
12:16
created
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.