Completed
Push — V6 ( 8b729c...5d3acf )
by Georges
03:16
created
src/phpFastCache/Core/Pool/ExtendedCacheItemPoolTrait.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
 
15 15
 namespace phpFastCache\Core\Pool;
16 16
 
17
-use InvalidArgumentException;
18 17
 use phpFastCache\Core\Item\ExtendedCacheItemInterface;
19 18
 use phpFastCache\EventManager;
20 19
 use phpFastCache\Exceptions\phpFastCacheInvalidArgumentException;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function getItemsAsJsonString(array $keys = [], $option = 0, $depth = 512)
33 33
     {
34
-        $callback = function (CacheItemInterface $item) {
34
+        $callback = function(CacheItemInterface $item) {
35 35
             return $item->get();
36 36
         };
37 37
         return json_encode(array_map($callback, array_values($this->getItems($keys))), $option, $depth);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         if (is_string($tagName)) {
46 46
             $driverResponse = $this->getItem($this->getTagKey($tagName));
47 47
             if ($driverResponse->isHit()) {
48
-                $items = (array)$driverResponse->get();
48
+                $items = (array) $driverResponse->get();
49 49
 
50 50
                 /**
51 51
                  * getItems() may provides expired item(s)
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                  *
58 58
                  * #headache
59 59
                  */
60
-                return array_filter($this->getItems(array_unique(array_keys($items))), function (ExtendedCacheItemInterface $item) {
60
+                return array_filter($this->getItems(array_unique(array_keys($items))), function(ExtendedCacheItemInterface $item) {
61 61
                     return $item->isHit();
62 62
                 });
63 63
             } else {
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
     {
76 76
         $items = [];
77 77
         foreach (array_unique($tagNames) as $tagName) {
78
-            if(is_string($tagName)){
78
+            if (is_string($tagName)) {
79 79
                 $items = array_merge($items, $this->getItemsByTag($tagName));
80
-            }else{
80
+            } else {
81 81
                 throw new phpFastCacheInvalidArgumentException('$tagName must be a a string');
82 82
             }
83 83
         }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
         foreach ($items as $key => $item) {
97 97
             if (array_diff($tagNames, $item->getTags())) {
98
-                unset($items[ $key ]);
98
+                unset($items[$key]);
99 99
             }
100 100
         }
101 101
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function getItemsByTagsAsJsonString(array $tagNames, $option = 0, $depth = 512)
110 110
     {
111
-        $callback = function (CacheItemInterface $item) {
111
+        $callback = function(CacheItemInterface $item) {
112 112
             return $item->get();
113 113
         };
114 114
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
      */
380 380
     public function detachItem(CacheItemInterface $item)
381 381
     {
382
-        if (isset($this->itemInstances[ $item->getKey() ])) {
382
+        if (isset($this->itemInstances[$item->getKey()])) {
383 383
             $this->deregisterItem($item);
384 384
         }
385 385
     }
@@ -399,10 +399,10 @@  discard block
 block discarded – undo
399 399
      */
400 400
     public function attachItem(CacheItemInterface $item)
401 401
     {
402
-        if (isset($this->itemInstances[ $item->getKey() ]) && spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])) {
402
+        if (isset($this->itemInstances[$item->getKey()]) && spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) {
403 403
             throw new phpFastCacheLogicException('The item already exists and cannot be overwritten because the Spl object hash mismatches ! You probably tried to re-attach a detached item which has been already retrieved from cache.');
404 404
         } else {
405
-            $this->itemInstances[ $item->getKey() ] = $item;
405
+            $this->itemInstances[$item->getKey()] = $item;
406 406
         }
407 407
     }
408 408
 
@@ -415,10 +415,10 @@  discard block
 block discarded – undo
415 415
     protected function deregisterItem($item)
416 416
     {
417 417
         if ($item instanceof CacheItemInterface) {
418
-            unset($this->itemInstances[ $item->getKey() ]);
418
+            unset($this->itemInstances[$item->getKey()]);
419 419
 
420 420
         } else if (is_string($item)) {
421
-            unset($this->itemInstances[ $item ]);
421
+            unset($this->itemInstances[$item]);
422 422
         } else {
423 423
             throw new phpFastCacheInvalidArgumentException('Invalid type for $item variable');
424 424
         }
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
      */
438 438
     public function isAttached(CacheItemInterface $item)
439 439
     {
440
-        if (isset($this->itemInstances[ $item->getKey() ])) {
441
-            return spl_object_hash($item) === spl_object_hash($this->itemInstances[ $item->getKey() ]);
440
+        if (isset($this->itemInstances[$item->getKey()])) {
441
+            return spl_object_hash($item) === spl_object_hash($this->itemInstances[$item->getKey()]);
442 442
         }
443 443
         return null;
444 444
     }
@@ -458,8 +458,8 @@  discard block
 block discarded – undo
458 458
      */
459 459
     public function saveMultiple(...$items)
460 460
     {
461
-        if (isset($items[ 0 ]) && is_array($items[ 0 ])) {
462
-            foreach ($items[ 0 ] as $item) {
461
+        if (isset($items[0]) && is_array($items[0])) {
462
+            foreach ($items[0] as $item) {
463 463
                 $this->save($item);
464 464
             }
465 465
             return true;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
         foreach (array_unique($tagNames) as $tagName) {
78 78
             if(is_string($tagName)){
79 79
                 $items = array_merge($items, $this->getItemsByTag($tagName));
80
-            }else{
80
+            } else{
81 81
                 throw new phpFastCacheInvalidArgumentException('$tagName must be a a string');
82 82
             }
83 83
         }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Mongodb/Driver.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 
77 77
     /**
78 78
      * @param \Psr\Cache\CacheItemInterface $item
79
-     * @return mixed
79
+     * @return boolean
80 80
      * @throws phpFastCacheInvalidArgumentException
81 81
      * @throws phpFastCacheDriverException
82 82
      */
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function driverCheck()
68 68
     {
69
-        if(!class_exists('MongoDB\Driver\Manager') && class_exists('MongoClient')){
69
+        if (!class_exists('MongoDB\Driver\Manager') && class_exists('MongoClient')) {
70 70
             trigger_error('This driver is used to support the pecl MongoDb extension with mongo-php-library.
71 71
             For MongoDb with Mongo PECL support use Mongo Driver.', E_USER_ERROR);
72 72
         }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                     '$set' => [
94 94
                       self::DRIVER_DATA_WRAPPER_INDEX => new Binary($this->encode($item->get()), Binary::TYPE_GENERIC),
95 95
                       self::DRIVER_TAGS_WRAPPER_INDEX => new Binary($this->encode($item->getTags()), Binary::TYPE_GENERIC),
96
-                      self::DRIVER_EDATE_WRAPPER_INDEX => ($item->getTtl() > 0 ? new UTCDateTime((time() + $item->getTtl()) * 1000) : new UTCDateTime(time()*1000)),
96
+                      self::DRIVER_EDATE_WRAPPER_INDEX => ($item->getTtl() > 0 ? new UTCDateTime((time() + $item->getTtl()) * 1000) : new UTCDateTime(time() * 1000)),
97 97
                     ],
98 98
                   ],
99 99
                   ['upsert' => true, 'multiple' => false]
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                 throw new phpFastCacheDriverException('Got an exception while trying to write data to MongoDB server', null, $e);
103 103
             }
104 104
 
105
-            return isset($result[ 'ok' ]) ? $result[ 'ok' ] == 1 : true;
105
+            return isset($result['ok']) ? $result['ok'] == 1 : true;
106 106
         } else {
107 107
             throw new phpFastCacheInvalidArgumentException('Cross-Driver type confusion detected');
108 108
         }
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 
119 119
         if ($document) {
120 120
             return [
121
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->getData()),
122
-              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->getData()),
123
-              self::DRIVER_EDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_EDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
121
+              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[self::DRIVER_DATA_WRAPPER_INDEX]->getData()),
122
+              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[self::DRIVER_TAGS_WRAPPER_INDEX]->getData()),
123
+              self::DRIVER_EDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[self::DRIVER_EDATE_WRAPPER_INDEX]->toDateTime()->getTimestamp()),
124 124
             ];
125 125
         } else {
126 126
             return null;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
          * @var \MongoDB\Model\BSONDocument $result
159 159
          */
160 160
         $result = $this->getCollection()->drop()->getArrayCopy();
161
-        $this->collection = new Collection($this->instance,'phpFastCache','Cache');
161
+        $this->collection = new Collection($this->instance, 'phpFastCache', 'Cache');
162 162
 
163 163
         /**
164 164
          * This will rebuild automatically the Collection indexes
@@ -178,13 +178,13 @@  discard block
 block discarded – undo
178 178
         if ($this->instance instanceof \MongoDB\Driver\Manager) {
179 179
             throw new LogicException('Already connected to Mongodb server');
180 180
         } else {
181
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
182
-            $port = isset($server[ 'port' ]) ? $server[ 'port' ] : '27017';
183
-            $timeout = isset($server[ 'timeout' ]) ? $server[ 'timeout' ] : 3;
184
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
185
-            $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
186
-            $collectionName = isset($this->config[ 'collectionName' ]) ? $this->config[ 'collectionName' ] : 'Cache';
187
-            $databaseName = isset($this->config[ 'databaseName' ]) ? $this->config[ 'databaseName' ] : 'phpFastCache';
181
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
182
+            $port = isset($server['port']) ? $server['port'] : '27017';
183
+            $timeout = isset($server['timeout']) ? $server['timeout'] : 3;
184
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
185
+            $username = isset($this->config['username']) ? $this->config['username'] : '';
186
+            $collectionName = isset($this->config['collectionName']) ? $this->config['collectionName'] : 'Cache';
187
+            $databaseName = isset($this->config['databaseName']) ? $this->config['databaseName'] : 'phpFastCache';
188 188
 
189 189
 
190 190
             /**
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
               ($password ? ":{$password}" : '') .
196 196
               ($username ? '@' : '') . "{$host}" .
197 197
               ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]));
198
-            $this->collection = $this->collection ?: new Collection($this->instance,$databaseName, $collectionName);
198
+            $this->collection = $this->collection ?: new Collection($this->instance, $databaseName, $collectionName);
199 199
 
200 200
             return true;
201 201
         }
@@ -229,16 +229,16 @@  discard block
 block discarded – undo
229 229
         ]))->toArray()[0];
230 230
 
231 231
         $collectionStats = $this->instance->executeCommand('phpFastCache', new Command([
232
-          'collStats' => (isset($this->config[ 'collectionName' ]) ? $this->config[ 'collectionName' ] : 'Cache'),
232
+          'collStats' => (isset($this->config['collectionName']) ? $this->config['collectionName'] : 'Cache'),
233 233
           'verbose' => true,
234 234
         ]))->toArray()[0];
235 235
 
236
-        $array_filter_recursive = function( $array, callable $callback = null ) use(&$array_filter_recursive) {
236
+        $array_filter_recursive = function($array, callable $callback = null) use(&$array_filter_recursive) {
237 237
             $array = $callback($array);
238 238
 
239
-            if(is_object($array) ||is_array($array)){
240
-                foreach ( $array as &$value ) {
241
-                    $value = call_user_func( $array_filter_recursive, $value, $callback );
239
+            if (is_object($array) || is_array($array)) {
240
+                foreach ($array as &$value) {
241
+                    $value = call_user_func($array_filter_recursive, $value, $callback);
242 242
                 }
243 243
             }
244 244
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             /**
251 251
              * Remove unserializable properties
252 252
              */
253
-            if($item instanceof \MongoDB\BSON\UTCDateTime){
253
+            if ($item instanceof \MongoDB\BSON\UTCDateTime) {
254 254
                 return (string) $item;
255 255
             }
256 256
             return $item;
Please login to merge, or discard this patch.
src/phpFastCache/CacheManager.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -64,95 +64,95 @@  discard block
 block discarded – undo
64 64
         /**
65 65
          * Specify if the item must provide detailed creation/modification dates
66 66
          */
67
-      'itemDetailedDate' => false,
67
+        'itemDetailedDate' => false,
68 68
 
69 69
         /**
70 70
          * Automatically attempt to fallback to temporary directory
71 71
          * if the cache fails to write on the specified directory
72 72
          */
73
-      'autoTmpFallback' => false,
73
+        'autoTmpFallback' => false,
74 74
 
75 75
         /**
76 76
          * Provide a secure file manipulation mechanism,
77 77
          * on intensive usage the performance can be affected.
78 78
          */
79
-      'secureFileManipulation' => false,
79
+        'secureFileManipulation' => false,
80 80
 
81 81
         /**
82 82
          * Ignore Symfony notice for Symfony project which
83 83
          * do not makes use of PhpFastCache's Symfony Bundle
84 84
          */
85
-      'ignoreSymfonyNotice' => false,
85
+        'ignoreSymfonyNotice' => false,
86 86
 
87 87
         /**
88 88
          * Default time-to-live in second
89 89
          */
90
-      'defaultTtl' => 900,
90
+        'defaultTtl' => 900,
91 91
 
92 92
         /**
93 93
          * Default key hash function
94 94
          * (md5 by default)
95 95
          */
96
-      'defaultKeyHashFunction' => '',
96
+        'defaultKeyHashFunction' => '',
97 97
 
98 98
         /**
99 99
          * The securityKey that will be used
100 100
          * to create sub-directory
101 101
          * (Files-based drivers only)
102 102
          */
103
-      'securityKey' => 'auto',
103
+        'securityKey' => 'auto',
104 104
 
105 105
         /**
106 106
          * Auto-generate .htaccess if it's missing
107 107
          * (Files-based drivers only)
108 108
          */
109
-      'htaccess' => true,
109
+        'htaccess' => true,
110 110
 
111 111
         /**
112 112
          * Default files chmod
113 113
          * 0777 recommended
114 114
          * (Files-based drivers only)
115 115
          */
116
-      'default_chmod' => 0777,
116
+        'default_chmod' => 0777,
117 117
 
118 118
         /**
119 119
          * The path where we will writecache files
120 120
          * default value if empty: sys_get_temp_dir()
121 121
          * (Files-based drivers only)
122 122
          */
123
-      'path' => '',
123
+        'path' => '',
124 124
 
125 125
         /**
126 126
          * Driver fallback in case of failure.
127 127
          * Caution, in case of failure an E_WARNING
128 128
          * error will always be raised
129 129
          */
130
-      'fallback' => false,
130
+        'fallback' => false,
131 131
 
132 132
         /**
133 133
          * Maximum size (bytes) of object store in memory
134 134
          * (Memcache(d) drivers only)
135 135
          */
136
-      'limited_memory_each_object' => 4096,
136
+        'limited_memory_each_object' => 4096,
137 137
 
138 138
         /**
139 139
          * Compress stored data, if the backend supports it
140 140
          * (Memcache(d) drivers only)
141 141
          */
142
-      'compress_data' => false,
142
+        'compress_data' => false,
143 143
 
144 144
         /**
145 145
          * Prevent cache slams when
146 146
          * making use of heavy cache
147 147
          * items
148 148
          */
149
-      'preventCacheSlams' => false,
149
+        'preventCacheSlams' => false,
150 150
 
151 151
         /**
152 152
          * Cache slams timeout
153 153
          * in seconds
154 154
          */
155
-      'cacheSlamsTimeout' => 15,
155
+        'cacheSlamsTimeout' => 15,
156 156
 
157 157
     ];
158 158
 
@@ -335,24 +335,24 @@  discard block
 block discarded – undo
335 335
     public static function getStaticSystemDrivers()
336 336
     {
337 337
         return [
338
-          'Apc',
339
-          'Apcu',
340
-          'Cassandra',
341
-          'Couchbase',
342
-          'Couchdb',
343
-          'Devnull',
344
-          'Files',
345
-          'Leveldb',
346
-          'Memcache',
347
-          'Memcached',
348
-          'Memstatic',
349
-          'Mongodb',
350
-          'Predis',
351
-          'Redis',
352
-          'Ssdb',
353
-          'Sqlite',
354
-          'Wincache',
355
-          'Xcache',
338
+            'Apc',
339
+            'Apcu',
340
+            'Cassandra',
341
+            'Couchbase',
342
+            'Couchdb',
343
+            'Devnull',
344
+            'Files',
345
+            'Leveldb',
346
+            'Memcache',
347
+            'Memcached',
348
+            'Memstatic',
349
+            'Mongodb',
350
+            'Predis',
351
+            'Redis',
352
+            'Ssdb',
353
+            'Sqlite',
354
+            'Wincache',
355
+            'Xcache',
356 356
         ];
357 357
     }
358 358
 
@@ -362,9 +362,9 @@  discard block
 block discarded – undo
362 362
     public static function getStaticAllDrivers()
363 363
     {
364 364
         return array_merge(self::getStaticSystemDrivers(), [
365
-          'Devtrue',
366
-          'Devfalse',
367
-          'Cookie',
365
+            'Devtrue',
366
+            'Devfalse',
367
+            'Cookie',
368 368
         ]);
369 369
     }
370 370
 
Please login to merge, or discard this patch.
src/phpFastCache/Core/Item/ItemExtendedTrait.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $keyHashFunction = $this->driver->getConfigOption('defaultKeyHashFunction');
52 52
 
53
-        if($keyHashFunction){
53
+        if ($keyHashFunction) {
54 54
             return $keyHashFunction($this->getKey());
55
-        }else{
55
+        } else {
56 56
             return md5($this->getKey());
57 57
         }
58 58
     }
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function getCreationDate()
98 98
     {
99
-        if($this->driver->getConfig()['itemDetailedDate']){
99
+        if ($this->driver->getConfig()['itemDetailedDate']) {
100 100
             return $this->creationDate;
101
-        }else{
101
+        } else {
102 102
             throw new phpFastCacheLogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.');
103 103
         }
104 104
     }
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function setCreationDate(\DateTimeInterface $date)
112 112
     {
113
-        if($this->driver->getConfig()['itemDetailedDate']){
113
+        if ($this->driver->getConfig()['itemDetailedDate']) {
114 114
             $this->creationDate = $date;
115 115
             return $this;
116
-        }else{
116
+        } else {
117 117
             throw new phpFastCacheLogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.');
118 118
         }
119 119
     }
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function getModificationDate()
126 126
     {
127
-        if($this->driver->getConfig()['itemDetailedDate']){
127
+        if ($this->driver->getConfig()['itemDetailedDate']) {
128 128
             return $this->modificationDate;
129
-        }else{
129
+        } else {
130 130
             throw new phpFastCacheLogicException('Cannot access to the modification date when the "itemDetailedDate" configuration is disabled.');
131 131
         }
132 132
     }
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
      */
139 139
     public function setModificationDate(\DateTimeInterface $date)
140 140
     {
141
-        if($this->driver->getConfig()['itemDetailedDate']){
141
+        if ($this->driver->getConfig()['itemDetailedDate']) {
142 142
             $this->modificationDate = $date;
143 143
             return $this;
144
-        }else{
144
+        } else {
145 145
             throw new phpFastCacheLogicException('Cannot access to the modification date when the "itemDetailedDate" configuration is disabled.');
146 146
         }
147 147
     }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     public function removeTag($tagName)
310 310
     {
311 311
         if (($key = array_search($tagName, $this->tags)) !== false) {
312
-            unset($this->tags[ $key ]);
312
+            unset($this->tags[$key]);
313 313
             $this->removedTags[] = $tagName;
314 314
         }
315 315
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     final public function __debugInfo()
389 389
     {
390 390
         $info = get_object_vars($this);
391
-        $info[ 'driver' ] = 'object(' . get_class($info[ 'driver' ]) . ')';
391
+        $info['driver'] = 'object(' . get_class($info['driver']) . ')';
392 392
 
393 393
         return (array) $info;
394 394
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
         if($keyHashFunction){
54 54
             return $keyHashFunction($this->getKey());
55
-        }else{
55
+        } else{
56 56
             return md5($this->getKey());
57 57
         }
58 58
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         if($this->driver->getConfig()['itemDetailedDate']){
100 100
             return $this->creationDate;
101
-        }else{
101
+        } else{
102 102
             throw new phpFastCacheLogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.');
103 103
         }
104 104
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         if($this->driver->getConfig()['itemDetailedDate']){
114 114
             $this->creationDate = $date;
115 115
             return $this;
116
-        }else{
116
+        } else{
117 117
             throw new phpFastCacheLogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.');
118 118
         }
119 119
     }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     {
127 127
         if($this->driver->getConfig()['itemDetailedDate']){
128 128
             return $this->modificationDate;
129
-        }else{
129
+        } else{
130 130
             throw new phpFastCacheLogicException('Cannot access to the modification date when the "itemDetailedDate" configuration is disabled.');
131 131
         }
132 132
     }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         if($this->driver->getConfig()['itemDetailedDate']){
142 142
             $this->modificationDate = $date;
143 143
             return $this;
144
-        }else{
144
+        } else{
145 145
             throw new phpFastCacheLogicException('Cannot access to the modification date when the "itemDetailedDate" configuration is disabled.');
146 146
         }
147 147
     }
Please login to merge, or discard this patch.
src/phpFastCache/Core/Pool/DriverBaseTrait.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         if (is_array($config_name)) {
54 54
             $this->config = array_merge($this->config, $config_name);
55 55
         } else {
56
-            $this->config[ $config_name ] = $value;
56
+            $this->config[$config_name] = $value;
57 57
         }
58 58
     }
59 59
 
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function getConfigOption($optionName)
73 73
     {
74
-        if(isset($this->config[$optionName])){
74
+        if (isset($this->config[$optionName])) {
75 75
             return $this->config[$optionName];
76
-        }else{
76
+        } else {
77 77
             return null;
78 78
         }
79 79
     }
@@ -143,16 +143,16 @@  discard block
 block discarded – undo
143 143
           self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(),
144 144
         ];
145 145
 
146
-        if($this->config['itemDetailedDate']){
147
-            $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = new \DateTime();
146
+        if ($this->config['itemDetailedDate']) {
147
+            $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = new \DateTime();
148 148
             /**
149 149
              * If the creation date exists
150 150
              * reuse it else set a new Date
151 151
              */
152
-            $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = $item->getCreationDate() ?: new \DateTime();
153
-        }else{
154
-            $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = null;
155
-            $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = null;
152
+            $wrap[self::DRIVER_CDATE_WRAPPER_INDEX] = $item->getCreationDate() ?: new \DateTime();
153
+        } else {
154
+            $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = null;
155
+            $wrap[self::DRIVER_CDATE_WRAPPER_INDEX] = null;
156 156
         }
157 157
 
158 158
         return $wrap;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function driverUnwrapData(array $wrapper)
166 166
     {
167
-        return $wrapper[ self::DRIVER_DATA_WRAPPER_INDEX ];
167
+        return $wrapper[self::DRIVER_DATA_WRAPPER_INDEX];
168 168
     }
169 169
 
170 170
     /**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      */
174 174
     public function driverUnwrapTags(array $wrapper)
175 175
     {
176
-        return $wrapper[ self::DRIVER_TAGS_WRAPPER_INDEX ];
176
+        return $wrapper[self::DRIVER_TAGS_WRAPPER_INDEX];
177 177
     }
178 178
 
179 179
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function driverUnwrapEdate(array $wrapper)
185 185
     {
186
-        return $wrapper[ self::DRIVER_EDATE_WRAPPER_INDEX ];
186
+        return $wrapper[self::DRIVER_EDATE_WRAPPER_INDEX];
187 187
     }
188 188
 
189 189
     /**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function driverUnwrapCdate(array $wrapper)
194 194
     {
195
-        return $wrapper[ self::DRIVER_CDATE_WRAPPER_INDEX ];
195
+        return $wrapper[self::DRIVER_CDATE_WRAPPER_INDEX];
196 196
     }
197 197
 
198 198
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
      */
203 203
     public function driverUnwrapMdate(array $wrapper)
204 204
     {
205
-        return $wrapper[ self::DRIVER_MDATE_WRAPPER_INDEX ];
205
+        return $wrapper[self::DRIVER_MDATE_WRAPPER_INDEX];
206 206
     }
207 207
 
208 208
     /**
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
          * on tags item, it can leads
228 228
          * to an infinite recursive calls
229 229
          */
230
-        if(strpos($item->getKey(), self::DRIVER_TAGS_KEY_PREFIX ) === 0){
230
+        if (strpos($item->getKey(), self::DRIVER_TAGS_KEY_PREFIX) === 0) {
231 231
             throw new phpFastCacheLogicException('Trying to set tag(s) to an Tag item index: ' . $item->getKey());
232 232
         }
233 233
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         foreach ($tagsItems as $tagsItem) {
271 271
             $data = (array) $tagsItem->get();
272 272
 
273
-            unset($data[ $item->getKey() ]);
273
+            unset($data[$item->getKey()]);
274 274
             $tagsItem->set($data);
275 275
 
276 276
             /**
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Cassandra/Driver.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -75,16 +75,16 @@  discard block
 block discarded – undo
75 75
             try{
76 76
                 $cacheData = $this->encode($this->driverPreWrap($item));
77 77
                 $options = new Cassandra\ExecutionOptions([
78
-                  'arguments' => [
78
+                    'arguments' => [
79 79
                     'cache_uuid' => new Cassandra\Uuid(),
80 80
                     'cache_id' => $item->getKey(),
81 81
                     'cache_data' => $cacheData,
82 82
                     'cache_creation_date' => new Cassandra\Timestamp((new \DateTime())->getTimestamp()),
83 83
                     'cache_expiration_date' => new Cassandra\Timestamp($item->getExpirationDate()->getTimestamp()),
84 84
                     'cache_length' => strlen($cacheData)
85
-                  ],
86
-                  'consistency' => Cassandra::CONSISTENCY_ALL,
87
-                  'serial_consistency' => Cassandra::CONSISTENCY_SERIAL
85
+                    ],
86
+                    'consistency' => Cassandra::CONSISTENCY_ALL,
87
+                    'serial_consistency' => Cassandra::CONSISTENCY_SERIAL
88 88
                 ]);
89 89
 
90 90
                 $query = sprintf('INSERT INTO %s.%s
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
     {
123 123
         try {
124 124
             $options = new Cassandra\ExecutionOptions([
125
-              'arguments' => ['cache_id' => $item->getKey()],
126
-              'page_size' => 1
125
+                'arguments' => ['cache_id' => $item->getKey()],
126
+                'page_size' => 1
127 127
             ]);
128 128
             $query = sprintf(
129
-              'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;',
130
-              self::CASSANDRA_KEY_SPACE,
131
-              self::CASSANDRA_TABLE
129
+                'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;',
130
+                self::CASSANDRA_KEY_SPACE,
131
+                self::CASSANDRA_TABLE
132 132
             );
133 133
             $results = $this->instance->execute(new Cassandra\SimpleStatement($query), $options);
134 134
 
@@ -155,14 +155,14 @@  discard block
 block discarded – undo
155 155
         if ($item instanceof Item) {
156 156
             try {
157 157
                 $options = new Cassandra\ExecutionOptions([
158
-                  'arguments' => [
158
+                    'arguments' => [
159 159
                     'cache_id' => $item->getKey(),
160
-                  ],
160
+                    ],
161 161
                 ]);
162 162
                 $result = $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
163
-                  'DELETE FROM %s.%s WHERE cache_id = :cache_id;',
164
-                  self::CASSANDRA_KEY_SPACE,
165
-                  self::CASSANDRA_TABLE
163
+                    'DELETE FROM %s.%s WHERE cache_id = :cache_id;',
164
+                    self::CASSANDRA_KEY_SPACE,
165
+                    self::CASSANDRA_TABLE
166 166
                 )), $options);
167 167
 
168 168
                 /**
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
     {
187 187
         try {
188 188
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
189
-              'TRUNCATE %s.%s;',
190
-              self::CASSANDRA_KEY_SPACE, self::CASSANDRA_TABLE
189
+                'TRUNCATE %s.%s;',
190
+                self::CASSANDRA_KEY_SPACE, self::CASSANDRA_TABLE
191 191
             )));
192 192
 
193 193
             return true;
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
             $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
214 214
 
215 215
             $clusterBuilder = Cassandra::cluster()
216
-              ->withContactPoints($host)
217
-              ->withPort($port);
216
+                ->withContactPoints($host)
217
+                ->withPort($port);
218 218
 
219 219
             if(!empty($this->config['ssl']['enabled'])){
220 220
                 if(!empty($this->config['ssl']['verify'])){
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
              */
243 243
 
244 244
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
245
-              "CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };",
246
-              self::CASSANDRA_KEY_SPACE
245
+                "CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };",
246
+                self::CASSANDRA_KEY_SPACE
247 247
             )));
248 248
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf('USE %s;', self::CASSANDRA_KEY_SPACE)));
249 249
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf('
@@ -290,15 +290,15 @@  discard block
 block discarded – undo
290 290
     public function getStats()
291 291
     {
292 292
         $result = $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
293
-          'SELECT SUM(cache_length) as cache_size FROM %s.%s',
294
-          self::CASSANDRA_KEY_SPACE,
295
-          self::CASSANDRA_TABLE
293
+            'SELECT SUM(cache_length) as cache_size FROM %s.%s',
294
+            self::CASSANDRA_KEY_SPACE,
295
+            self::CASSANDRA_TABLE
296 296
         )));
297 297
 
298 298
         return (new driverStatistic())
299
-          ->setSize($result->first()[ 'cache_size' ])
300
-          ->setRawData([])
301
-          ->setData(implode(', ', array_keys($this->itemInstances)))
302
-          ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.');
299
+            ->setSize($result->first()[ 'cache_size' ])
300
+            ->setRawData([])
301
+            ->setData(implode(', ', array_keys($this->itemInstances)))
302
+            ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.');
303 303
     }
304 304
 }
305 305
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
          * Check for Cross-Driver type confusion
73 73
          */
74 74
         if ($item instanceof Item) {
75
-            try{
75
+            try {
76 76
                 $cacheData = $this->encode($this->driverPreWrap($item));
77 77
                 $options = new Cassandra\ExecutionOptions([
78 78
                   'arguments' => [
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                  * been really upserted
107 107
                  */
108 108
                 return $result instanceof Cassandra\Rows;
109
-            }catch(\Cassandra\Exception\InvalidArgumentException $e){
109
+            } catch (\Cassandra\Exception\InvalidArgumentException $e) {
110 110
                 throw new phpFastCacheInvalidArgumentException($e, 0, $e);
111 111
             }
112 112
         } else {
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
             );
133 133
             $results = $this->instance->execute(new Cassandra\SimpleStatement($query), $options);
134 134
 
135
-            if($results instanceof Cassandra\Rows && $results->count() === 1){
135
+            if ($results instanceof Cassandra\Rows && $results->count() === 1) {
136 136
                 return $this->decode($results->first()['cache_data']);
137
-            }else{
137
+            } else {
138 138
                 return null;
139 139
             }
140 140
         } catch (Cassandra\Exception $e) {
@@ -206,20 +206,20 @@  discard block
 block discarded – undo
206 206
         if ($this->instance instanceof CassandraSession) {
207 207
             throw new phpFastCacheLogicException('Already connected to Couchbase server');
208 208
         } else {
209
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
210
-            $port = isset($this->config[ 'port' ]) ? $this->config[ 'port' ] : 9042;
211
-            $timeout = isset($this->config[ 'timeout' ]) ? $this->config[ 'timeout' ] : 2;
212
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
213
-            $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
209
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
210
+            $port = isset($this->config['port']) ? $this->config['port'] : 9042;
211
+            $timeout = isset($this->config['timeout']) ? $this->config['timeout'] : 2;
212
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
213
+            $username = isset($this->config['username']) ? $this->config['username'] : '';
214 214
 
215 215
             $clusterBuilder = Cassandra::cluster()
216 216
               ->withContactPoints($host)
217 217
               ->withPort($port);
218 218
 
219
-            if(!empty($this->config['ssl']['enabled'])){
220
-                if(!empty($this->config['ssl']['verify'])){
219
+            if (!empty($this->config['ssl']['enabled'])) {
220
+                if (!empty($this->config['ssl']['verify'])) {
221 221
                     $sslBuilder = Cassandra::ssl()->withVerifyFlags(Cassandra::VERIFY_PEER_CERT);
222
-                }else{
222
+                } else {
223 223
                     $sslBuilder = Cassandra::ssl()->withVerifyFlags(Cassandra::VERIFY_NONE);
224 224
                 }
225 225
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
             $clusterBuilder->withConnectTimeout($timeout);
230 230
 
231
-            if($username){
231
+            if ($username) {
232 232
                 $clusterBuilder->withCredentials($username, $password);
233 233
             }
234 234
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
         )));
297 297
 
298 298
         return (new driverStatistic())
299
-          ->setSize($result->first()[ 'cache_size' ])
299
+          ->setSize($result->first()['cache_size'])
300 300
           ->setRawData([])
301 301
           ->setData(implode(', ', array_keys($this->itemInstances)))
302 302
           ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.');
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                  * been really upserted
107 107
                  */
108 108
                 return $result instanceof Cassandra\Rows;
109
-            }catch(\Cassandra\Exception\InvalidArgumentException $e){
109
+            } catch(\Cassandra\Exception\InvalidArgumentException $e){
110 110
                 throw new phpFastCacheInvalidArgumentException($e, 0, $e);
111 111
             }
112 112
         } else {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
             if($results instanceof Cassandra\Rows && $results->count() === 1){
136 136
                 return $this->decode($results->first()['cache_data']);
137
-            }else{
137
+            } else{
138 138
                 return null;
139 139
             }
140 140
         } catch (Cassandra\Exception $e) {
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             if(!empty($this->config['ssl']['enabled'])){
220 220
                 if(!empty($this->config['ssl']['verify'])){
221 221
                     $sslBuilder = Cassandra::ssl()->withVerifyFlags(Cassandra::VERIFY_PEER_CERT);
222
-                }else{
222
+                } else{
223 223
                     $sslBuilder = Cassandra::ssl()->withVerifyFlags(Cassandra::VERIFY_NONE);
224 224
                 }
225 225
 
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Couchdb/Driver.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
          * Check for Cross-Driver type confusion
71 71
          */
72 72
         if ($item instanceof Item) {
73
-            try{
73
+            try {
74 74
                 $this->instance->putDocument(['data' => $this->encode($this->driverPreWrap($item))], $item->getEncodedKey(), $this->getLatestDocumentRevision($item->getEncodedKey()));
75
-            }catch (CouchDBException $e){
75
+            } catch (CouchDBException $e) {
76 76
                 throw new phpFastCacheDriverException('Got error while trying to upsert a document: ' . $e->getMessage(), null, $e);
77 77
             }
78 78
             return true;
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
      */
89 89
     protected function driverRead(CacheItemInterface $item)
90 90
     {
91
-        try{
91
+        try {
92 92
             $response = $this->instance->findDocument($item->getEncodedKey());
93
-        }catch (CouchDBException $e){
93
+        } catch (CouchDBException $e) {
94 94
             throw new phpFastCacheDriverException('Got error while trying to get a document: ' . $e->getMessage(), null, $e);
95 95
         }
96 96
 
97
-        if($response->status === 404 || empty($response->body['data'])){
97
+        if ($response->status === 404 || empty($response->body['data'])) {
98 98
             return null;
99
-        }else if($response->status === 200){
99
+        } else if ($response->status === 200) {
100 100
             return $this->decode($response->body['data']);
101
-        }else{
101
+        } else {
102 102
             throw new phpFastCacheDriverException('Got unexpected HTTP status: ' . $response->status);
103 103
         }
104 104
     }
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
          * Check for Cross-Driver type confusion
116 116
          */
117 117
         if ($item instanceof Item) {
118
-            try{
118
+            try {
119 119
                 $this->instance->deleteDocument($item->getEncodedKey(), $this->getLatestDocumentRevision($item->getEncodedKey()));
120
-            }catch (CouchDBException $e){
120
+            } catch (CouchDBException $e) {
121 121
                 throw new phpFastCacheDriverException('Got error while trying to delete a document: ' . $e->getMessage(), null, $e);
122 122
             }
123 123
             return true;
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
      */
133 133
     protected function driverClear()
134 134
     {
135
-        try{
135
+        try {
136 136
             $this->instance->deleteDatabase($this->getDatabaseName());
137 137
             $this->createDatabase();
138
-        }catch (CouchDBException $e){
138
+        } catch (CouchDBException $e) {
139 139
             throw new phpFastCacheDriverException('Got error while trying to delete and recreate the database: ' . $e->getMessage(), null, $e);
140 140
         }
141 141
 
@@ -152,19 +152,19 @@  discard block
 block discarded – undo
152 152
         if ($this->instance instanceof CouchdbClient) {
153 153
             throw new phpFastCacheLogicException('Already connected to Couchdb server');
154 154
         } else {
155
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
156
-            $ssl = isset($this->config[ 'ssl' ]) ? $this->config[ 'ssl' ] : false;
157
-            $port = isset($this->config[ 'port' ]) ? $this->config[ 'port' ] : 5984;
158
-            $path = isset($this->config[ 'path' ]) ? $this->config[ 'path' ] : '/';
159
-            $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
160
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
161
-            $timeout = isset($this->config[ 'timeout' ]) ? $this->config[ 'timeout' ] : 10;
155
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
156
+            $ssl = isset($this->config['ssl']) ? $this->config['ssl'] : false;
157
+            $port = isset($this->config['port']) ? $this->config['port'] : 5984;
158
+            $path = isset($this->config['path']) ? $this->config['path'] : '/';
159
+            $username = isset($this->config['username']) ? $this->config['username'] : '';
160
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
161
+            $timeout = isset($this->config['timeout']) ? $this->config['timeout'] : 10;
162 162
 
163 163
             $url = ($ssl ? 'https://' : 'http://');
164
-            if($username)
164
+            if ($username)
165 165
             {
166 166
                 $url .= "{$username}";
167
-                if($password)
167
+                if ($password)
168 168
                 {
169 169
                     $url .= ":{$password}";
170 170
                 }
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
         $path = '/' . $this->getDatabaseName() . '/' . urlencode($docId);
195 195
 
196 196
         $response = $this->instance->getHttpClient()->request(
197
-          'GET',// At this moment HEAD requests are not working: https://github.com/doctrine/couchdb-client/issues/72
197
+          'GET', // At this moment HEAD requests are not working: https://github.com/doctrine/couchdb-client/issues/72
198 198
           $path,
199 199
           null,
200 200
           false
201 201
         );
202
-        if(!empty($response->headers['etag'])){
202
+        if (!empty($response->headers['etag'])) {
203 203
             return trim($response->headers['etag'], " '\"\t\n\r\0\x0B");
204
-        }else{
204
+        } else {
205 205
             return null;
206 206
         }
207 207
     }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      */
212 212
     protected function getDatabaseName()
213 213
     {
214
-        return isset($this->config[ 'database' ]) ? $this->config[ 'database' ] : 'phpfastcache';
214
+        return isset($this->config['database']) ? $this->config['database'] : 'phpfastcache';
215 215
     }
216 216
 
217 217
     /**
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      */
220 220
     protected function createDatabase()
221 221
     {
222
-        if(!in_array($this->instance->getDatabase(), $this->instance->getAllDatabases(), true)){
222
+        if (!in_array($this->instance->getDatabase(), $this->instance->getAllDatabases(), true)) {
223 223
             $this->instance->createDatabase($this->instance->getDatabase());
224 224
         }
225 225
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Apcu/Driver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -134,12 +134,12 @@
 block discarded – undo
134 134
     public function getStats()
135 135
     {
136 136
         $stats = (array) apcu_cache_info();
137
-        $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]);
137
+        $date = (new \DateTime())->setTimestamp($stats['start_time']);
138 138
 
139 139
         return (new driverStatistic())
140 140
           ->setData(implode(', ', array_keys($this->itemInstances)))
141
-          ->setInfo(sprintf("The APCU cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), $stats[ 'num_entries' ]))
141
+          ->setInfo(sprintf("The APCU cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), $stats['num_entries']))
142 142
           ->setRawData($stats)
143
-          ->setSize($stats[ 'mem_size' ]);
143
+          ->setSize($stats['mem_size']);
144 144
     }
145 145
 }
146 146
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Couchbase/Driver.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
         } else {
137 137
 
138 138
 
139
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
140
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
141
-            $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
142
-            $buckets = isset($this->config[ 'buckets' ]) ? $this->config[ 'buckets' ] : [
139
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
140
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
141
+            $username = isset($this->config['username']) ? $this->config['username'] : '';
142
+            $buckets = isset($this->config['buckets']) ? $this->config['buckets'] : [
143 143
               [
144 144
                 'bucket' => 'default',
145 145
                 'password' => '',
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
             $this->instance = new CouchbaseClient("couchbase://{$host}", $username, $password);
150 150
 
151 151
             foreach ($buckets as $bucket) {
152
-                $this->bucketCurrent = $this->bucketCurrent ?: $bucket[ 'bucket' ];
153
-                $this->setBucket($bucket[ 'bucket' ], $this->instance->openBucket($bucket[ 'bucket' ], $bucket[ 'password' ]));
152
+                $this->bucketCurrent = $this->bucketCurrent ?: $bucket['bucket'];
153
+                $this->setBucket($bucket['bucket'], $this->instance->openBucket($bucket['bucket'], $bucket['password']));
154 154
             }
155 155
         }
156 156
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     protected function getBucket()
164 164
     {
165
-        return $this->bucketInstances[ $this->bucketCurrent ];
165
+        return $this->bucketInstances[$this->bucketCurrent];
166 166
     }
167 167
 
168 168
     /**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
     protected function setBucket($bucketName, \CouchbaseBucket $CouchbaseBucket)
174 174
     {
175 175
         if (!array_key_exists($bucketName, $this->bucketInstances)) {
176
-            $this->bucketInstances[ $bucketName ] = $CouchbaseBucket;
176
+            $this->bucketInstances[$bucketName] = $CouchbaseBucket;
177 177
         } else {
178 178
             throw new phpFastCacheLogicException('A bucket instance with this name already exists.');
179 179
         }
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
         $info = $this->getBucket()->manager()->info();
194 194
 
195 195
         return (new driverStatistic())
196
-          ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
196
+          ->setSize($info['basicStats']['diskUsed'])
197 197
           ->setRawData($info)
198 198
           ->setData(implode(', ', array_keys($this->itemInstances)))
199
-          ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, 1) . "\n For more information see RawData.");
199
+          ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400, 1) . "\n For more information see RawData.");
200 200
     }
201 201
 }
202 202
\ No newline at end of file
Please login to merge, or discard this patch.