Completed
Push — v5 ( 9c84b7...e03f3a )
by Georges
02:50
created
src/autoload.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         return;
28 28
     } else if (strpos($entity, 'Psr\Cache') === 0) {
29 29
         trigger_error('If you cannot use <b>composer</b>, you have to include manually the Psr\\Cache interfaces.<br />See: https://github.com/php-fig/cache/tree/master/src<br /> Called ' . $entity,
30
-          E_USER_ERROR);
30
+            E_USER_ERROR);
31 31
 
32 32
         return;
33 33
     }
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
 
43 43
 if (class_exists('Composer\Autoload\ClassLoader')) {
44 44
     trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.',
45
-      E_USER_WARNING);
45
+        E_USER_WARNING);
46 46
 }
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Core/MemcacheDriverCollisionDetectorTrait.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
                 return true;
28 28
             } else if (constant($CONSTANT_NAME) !== $driverName) {
29 29
                 trigger_error('Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours',
30
-                  E_USER_WARNING);
30
+                    E_USER_WARNING);
31 31
 
32 32
                 return false;
33 33
             }
Please login to merge, or discard this patch.
src/phpFastCache/Core/DriverAbstract.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         foreach ($list as $array) {
232 232
             $name = $array[ 0 ];
233 233
             $res[ $name ] = $this->touch($name, $array[ 1 ],
234
-              isset($array[ 2 ]) ? $array[ 2 ] : []);
234
+                isset($array[ 2 ]) ? $array[ 2 ] : []);
235 235
         }
236 236
 
237 237
         return $res;
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     {
277 277
         if (isset($v[ 1 ]) && is_scalar($v[ 1 ])) {
278 278
             return $this->set($name, $v[ 0 ], $v[ 1 ],
279
-              isset($v[ 2 ]) ? $v[ 2 ] : []);
279
+                isset($v[ 2 ]) ? $v[ 2 ] : []);
280 280
         } else {
281 281
             throw new phpFastCacheDriverException("Example ->$name = array('VALUE', 300);");
282 282
         }
@@ -395,10 +395,10 @@  discard block
 block discarded – undo
395 395
     protected function _tagCaching()
396 396
     {
397 397
         return CacheManager::Sqlite(
398
-          [
398
+            [
399 399
             "path" => $this->config[ 'path' ],
400 400
             "cache_method" => 3,
401
-          ]
401
+            ]
402 402
         );
403 403
     }
404 404
 
@@ -567,9 +567,9 @@  discard block
 block discarded – undo
567 567
     public function driverPreWrap(ExtendedCacheItemInterface $item)
568 568
     {
569 569
         return [
570
-          self::DRIVER_DATA_WRAPPER_INDEX => $item->get(),
571
-          self::DRIVER_TIME_WRAPPER_INDEX => $item->getExpirationDate(),
572
-          self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(),
570
+            self::DRIVER_DATA_WRAPPER_INDEX => $item->get(),
571
+            self::DRIVER_TIME_WRAPPER_INDEX => $item->getExpirationDate(),
572
+            self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(),
573 573
         ];
574 574
     }
575 575
 
Please login to merge, or discard this patch.
src/phpFastCache/Core/PathSeekerTrait.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
     protected static function cleanFileName($filename)
161 161
     {
162 162
         $regex = [
163
-          '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/',
164
-          '/\.$/',
165
-          '/^\./',
163
+            '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/',
164
+            '/\.$/',
165
+            '/^\./',
166 166
         ];
167 167
         $replace = ['-', '', ''];
168 168
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                     chmod($path, 0777);
183 183
                 } catch (phpFastCacheDriverException $e) {
184 184
                     throw new phpFastCacheDriverException('PLEASE CHMOD ' . $path . ' - 0777 OR ANY WRITABLE PERMISSION!',
185
-                      92);
185
+                        92);
186 186
                 }
187 187
             }
188 188
 
Please login to merge, or discard this patch.
src/phpFastCache/Cache/ItemBaseTrait.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -149,9 +149,9 @@
 block discarded – undo
149 149
         if (is_numeric($time)) {
150 150
             if ($time <= 0) {
151 151
                 /**
152
-                * 5 years, however memcached or memory cached will gone when u restart it
153
-                * just recommended for sqlite. files                
154
-                */
152
+                 * 5 years, however memcached or memory cached will gone when u restart it
153
+                 * just recommended for sqlite. files                
154
+                 */
155 155
                 $time = 30 * 24 * 3600 * 5;
156 156
             }
157 157
             $this->expirationDate = $this->expirationDate->add(new \DateInterval(sprintf('PT%dS', $time)));
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Files/Driver.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
                             $key = $key[ 0 ];
254 254
                         }
255 255
                         $content[ $key ] = [
256
-                          'size' => $size,
257
-                          'write_time' => (isset($object[ 'write_time' ]) ? $object[ 'write_time' ] : null),
256
+                            'size' => $size,
257
+                            'write_time' => (isset($object[ 'write_time' ]) ? $object[ 'write_time' ] : null),
258 258
                         ];
259 259
                         if ($object->isExpired()) {
260 260
                             @unlink($file_path);
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
         }
268 268
 
269 269
         $stat->setData($content)
270
-          ->setSize($total - $removed)
271
-          ->setInfo('Total [bytes]: ' . $total . ', '
270
+            ->setSize($total - $removed)
271
+            ->setInfo('Total [bytes]: ' . $total . ', '
272 272
             . 'Expired and removed [bytes]: ' . $removed . ', '
273 273
             . 'Current [bytes], ' . $total - $removed
274
-          );
274
+            );
275 275
 
276 276
         return $stat;
277 277
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Predis/Driver.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -127,14 +127,14 @@
 block discarded – undo
127 127
     public function driverConnect()
128 128
     {
129 129
         $server = isset($this->config[ 'redis' ]) ? $this->config[ 'redis' ] : [
130
-          'host' => '127.0.0.1',
131
-          'port' => '6379',
132
-          'password' => '',
133
-          'database' => '',
130
+            'host' => '127.0.0.1',
131
+            'port' => '6379',
132
+            'password' => '',
133
+            'database' => '',
134 134
         ];
135 135
 
136 136
         $config = [
137
-          'host' => $server[ 'host' ],
137
+            'host' => $server[ 'host' ],
138 138
         ];
139 139
 
140 140
         $port = isset($server[ 'port' ]) ? $server[ 'port' ] : '';
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Mongodb/Driver.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
         if ($item instanceof Item) {
79 79
             try {
80 80
                 $result = (array) $this->getCollection()->update(
81
-                  ['_id' => $item->getKey()],
82
-                  [
81
+                    ['_id' => $item->getKey()],
82
+                    [
83 83
                     '$set' => [
84
-                      self::DRIVER_TIME_WRAPPER_INDEX => ($item->getTtl() > 0 ? new MongoDate(time() + $item->getTtl()) : null),
85
-                      self::DRIVER_DATA_WRAPPER_INDEX => new MongoBinData($this->encode($item->get()), MongoBinData::BYTE_ARRAY),
84
+                        self::DRIVER_TIME_WRAPPER_INDEX => ($item->getTtl() > 0 ? new MongoDate(time() + $item->getTtl()) : null),
85
+                        self::DRIVER_DATA_WRAPPER_INDEX => new MongoBinData($this->encode($item->get()), MongoBinData::BYTE_ARRAY),
86 86
                     ],
87
-                  ],
88
-                  ['upsert' => true, 'multiple' => false]
87
+                    ],
88
+                    ['upsert' => true, 'multiple' => false]
89 89
                 );
90 90
             } catch (MongoCursorException $e) {
91 91
                 return false;
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
         $document = $this->getCollection()->findOne(['_id' => $key], [self::DRIVER_DATA_WRAPPER_INDEX, self::DRIVER_TIME_WRAPPER_INDEX  /*'d', 'e'*/]);
107 107
         if ($document) {
108 108
             return [
109
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
110
-              self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
109
+                self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
110
+                self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
111 111
             ];
112 112
         } else {
113 113
             return null;
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
              * @todo make an url builder
163 163
              */
164 164
             $this->instance = $this->instance ?: (new MongodbClient('mongodb://' .
165
-              ($username ?: '') .
166
-              ($password ? ":{$password}" : '') .
167
-              ($username ? '@' : '') . "{$host}" .
168
-              ($port != '27017' ? ":{$port}" : ''), ['timeout' => $timeout * 1000]))->phpFastCache;
165
+                ($username ?: '') .
166
+                ($password ? ":{$password}" : '') .
167
+                ($username ? '@' : '') . "{$host}" .
168
+                ($port != '27017' ? ":{$port}" : ''), ['timeout' => $timeout * 1000]))->phpFastCache;
169 169
             $this->instance->Cache->createIndex([self::DRIVER_TIME_WRAPPER_INDEX => 1], ['expireAfterSeconds' => 0]);
170 170
         }
171 171
     }
@@ -206,23 +206,23 @@  discard block
 block discarded – undo
206 206
     public function getStats()
207 207
     {
208 208
         $serverStatus = $this->getCollection()->db->command([
209
-          'serverStatus' => 1,
210
-          'recordStats' => 0,
211
-          'repl' => 0,
212
-          'metrics' => 0,
209
+            'serverStatus' => 1,
210
+            'recordStats' => 0,
211
+            'repl' => 0,
212
+            'metrics' => 0,
213 213
         ]);
214 214
         $collStats = $this->getCollection()->db->command([
215
-          'collStats' => 'Cache',
216
-          'verbose' => true,
215
+            'collStats' => 'Cache',
216
+            'verbose' => true,
217 217
         ]);
218 218
 
219 219
         $stats = (new driverStatistic())
220
-          ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1))
221
-          ->setSize((int) $collStats[ 'size' ])
222
-          ->setRawData([
220
+            ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1))
221
+            ->setSize((int) $collStats[ 'size' ])
222
+            ->setRawData([
223 223
             'serverStatus' => $serverStatus,
224 224
             'collStats' => $collStats,
225
-          ]);
225
+            ]);
226 226
 
227 227
         return $stats;
228 228
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Memcache/Driver.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
         $servers = (!empty($this->config[ 'memcache' ]) && is_array($this->config[ 'memcache' ]) ? $this->config[ 'memcache' ] : []);
134 134
         if (count($servers) < 1) {
135 135
             $servers = [
136
-              ['127.0.0.1', 11211],
136
+                ['127.0.0.1', 11211],
137 137
             ];
138 138
         }
139 139
 
Please login to merge, or discard this patch.