Completed
Pull Request — v6 (#615)
by Georges
128:37 queued 101:56
created
src/phpFastCache/Drivers/Files/Driver.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
     /**
62 62
      * @param \Psr\Cache\CacheItemInterface $item
63
-     * @return mixed
63
+     * @return boolean
64 64
      * @throws phpFastCacheInvalidArgumentException
65 65
      */
66 66
     protected function driverWrite(CacheItemInterface $item)
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     /**
147 147
      * @param string $optionName
148 148
      * @param mixed $optionValue
149
-     * @return bool
149
+     * @return boolean|null
150 150
      * @throws phpFastCacheInvalidArgumentException
151 151
      */
152 152
     public static function isValidOption($optionName, $optionValue)
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     }
180 180
 
181 181
     /**
182
-     * @return array
182
+     * @return string[]
183 183
      */
184 184
     public static function getValidOptions()
185 185
     {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     }
188 188
 
189 189
     /**
190
-     * @return array
190
+     * @return string[]
191 191
      */
192 192
     public static function getRequiredOptions()
193 193
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
              * Force write
77 77
              */
78 78
             try {
79
-                return $this->writefile($file_path, $data, $this->config[ 'secureFileManipulation' ]);
79
+                return $this->writefile($file_path, $data, $this->config['secureFileManipulation']);
80 80
             } catch (\Exception $e) {
81 81
                 return false;
82 82
             }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     protected function driverClear()
138 138
     {
139
-        return (bool)Directory::rrmdir($this->getPath(true));
139
+        return (bool) Directory::rrmdir($this->getPath(true));
140 140
     }
141 141
 
142 142
     /**
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Cookie/Item.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
             $this->driver->setItem($this);
44 44
         } else {
45 45
             throw new phpFastCacheInvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.',
46
-              gettype($key)));
46
+                gettype($key)));
47 47
         }
48 48
     }
49 49
 
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devfalse/Driver.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 
63 63
     /**
64 64
      * @param \Psr\Cache\CacheItemInterface $item
65
-     * @return mixed
65
+     * @return boolean
66 66
      * @throws phpFastCacheInvalidArgumentException
67 67
      */
68 68
     protected function driverWrite(CacheItemInterface $item)
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
     protected function driverRead(CacheItemInterface $item)
77 77
     {
78 78
         return [
79
-          self::DRIVER_DATA_WRAPPER_INDEX => false,
80
-          self::DRIVER_TAGS_WRAPPER_INDEX => [],
81
-          self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(),
79
+            self::DRIVER_DATA_WRAPPER_INDEX => false,
80
+            self::DRIVER_TAGS_WRAPPER_INDEX => [],
81
+            self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(),
82 82
         ];
83 83
     }
84 84
 
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
     {
129 129
         $stat = new DriverStatistic();
130 130
         $stat->setInfo('[Devfalse] A void info string')
131
-          ->setSize(0)
132
-          ->setData(implode(', ', array_keys($this->itemInstances)))
133
-          ->setRawData(false);
131
+            ->setSize(0)
132
+            ->setData(implode(', ', array_keys($this->itemInstances)))
133
+            ->setRawData(false);
134 134
 
135 135
         return $stat;
136 136
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devnull/Driver.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 
63 63
     /**
64 64
      * @param \Psr\Cache\CacheItemInterface $item
65
-     * @return mixed
65
+     * @return boolean
66 66
      * @throws phpFastCacheInvalidArgumentException
67 67
      */
68 68
     protected function driverWrite(CacheItemInterface $item)
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -127,9 +127,9 @@
 block discarded – undo
127 127
     {
128 128
         $stat = new DriverStatistic();
129 129
         $stat->setInfo('[Devnull] A void info string')
130
-          ->setSize(0)
131
-          ->setData(implode(', ', array_keys($this->itemInstances)))
132
-          ->setRawData(null);
130
+            ->setSize(0)
131
+            ->setData(implode(', ', array_keys($this->itemInstances)))
132
+            ->setRawData(null);
133 133
 
134 134
         return $stat;
135 135
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devtrue/Driver.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 
63 63
     /**
64 64
      * @param \Psr\Cache\CacheItemInterface $item
65
-     * @return mixed
65
+     * @return boolean
66 66
      * @throws phpFastCacheInvalidArgumentException
67 67
      */
68 68
     protected function driverWrite(CacheItemInterface $item)
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
     protected function driverRead(CacheItemInterface $item)
81 81
     {
82 82
         return [
83
-          self::DRIVER_DATA_WRAPPER_INDEX => true,
84
-          self::DRIVER_TAGS_WRAPPER_INDEX => [],
85
-          self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(),
83
+            self::DRIVER_DATA_WRAPPER_INDEX => true,
84
+            self::DRIVER_TAGS_WRAPPER_INDEX => [],
85
+            self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(),
86 86
         ];
87 87
     }
88 88
 
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
     {
133 133
         $stat = new DriverStatistic();
134 134
         $stat->setInfo('[Devtrue] A void info string')
135
-          ->setSize(0)
136
-          ->setData(implode(', ', array_keys($this->itemInstances)))
137
-          ->setRawData(true);
135
+            ->setSize(0)
136
+            ->setData(implode(', ', array_keys($this->itemInstances)))
137
+            ->setRawData(true);
138 138
 
139 139
         return $stat;
140 140
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Mongodb/Driver.php 3 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.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -96,22 +96,22 @@  discard block
 block discarded – undo
96 96
         if ($item instanceof Item) {
97 97
             try {
98 98
                 $set = [
99
-                  self::DRIVER_DATA_WRAPPER_INDEX => new Binary($this->encode($item->get()), Binary::TYPE_GENERIC),
100
-                  self::DRIVER_TAGS_WRAPPER_INDEX => new Binary($this->encode($item->getTags()), Binary::TYPE_GENERIC),
101
-                  self::DRIVER_EDATE_WRAPPER_INDEX => ($item->getTtl() > 0 ? new UTCDateTime((time() + $item->getTtl()) * 1000) : new UTCDateTime(time() * 1000)),
99
+                    self::DRIVER_DATA_WRAPPER_INDEX => new Binary($this->encode($item->get()), Binary::TYPE_GENERIC),
100
+                    self::DRIVER_TAGS_WRAPPER_INDEX => new Binary($this->encode($item->getTags()), Binary::TYPE_GENERIC),
101
+                    self::DRIVER_EDATE_WRAPPER_INDEX => ($item->getTtl() > 0 ? new UTCDateTime((time() + $item->getTtl()) * 1000) : new UTCDateTime(time() * 1000)),
102 102
                 ];
103 103
 
104 104
                 if(!empty($this->config[ 'itemDetailedDate' ])){
105 105
                     $set += [
106
-                      self::DRIVER_MDATE_WRAPPER_INDEX => ($item->getModificationDate() ? new UTCDateTime(($item->getModificationDate()->getTimestamp()) * 1000) : new UTCDateTime(time() * 1000)),
107
-                      self::DRIVER_CDATE_WRAPPER_INDEX => ($item->getCreationDate() ? new UTCDateTime(($item->getCreationDate()->getTimestamp()) * 1000) : new UTCDateTime(time() * 1000)),
106
+                        self::DRIVER_MDATE_WRAPPER_INDEX => ($item->getModificationDate() ? new UTCDateTime(($item->getModificationDate()->getTimestamp()) * 1000) : new UTCDateTime(time() * 1000)),
107
+                        self::DRIVER_CDATE_WRAPPER_INDEX => ($item->getCreationDate() ? new UTCDateTime(($item->getCreationDate()->getTimestamp()) * 1000) : new UTCDateTime(time() * 1000)),
108 108
                     ];
109 109
                 }
110 110
 
111 111
                 $result = (array)$this->getCollection()->updateOne(
112
-                  ['_id' => $item->getEncodedKey()],
113
-                  ['$set' => $set],
114
-                  ['upsert' => true, 'multiple' => false]
112
+                    ['_id' => $item->getEncodedKey()],
113
+                    ['$set' => $set],
114
+                    ['upsert' => true, 'multiple' => false]
115 115
                 );
116 116
             } catch (MongoDBException $e) {
117 117
                 throw new phpFastCacheDriverException('Got an exception while trying to write data to MongoDB server', null, $e);
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
 
134 134
         if ($document) {
135 135
             $return = [
136
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->getData()),
137
-              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->getData()),
138
-              self::DRIVER_EDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_EDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
136
+                self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->getData()),
137
+                self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->getData()),
138
+                self::DRIVER_EDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_EDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
139 139
             ];
140 140
 
141 141
             if(!empty($this->config[ 'itemDetailedDate' ])){
142 142
                 $return += [
143
-                  self::DRIVER_MDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_MDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
144
-                  self::DRIVER_CDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_CDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
143
+                    self::DRIVER_MDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_MDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
144
+                    self::DRIVER_CDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_CDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
145 145
                 ];
146 146
             }
147 147
 
@@ -281,15 +281,15 @@  discard block
 block discarded – undo
281 281
     public function getStats()
282 282
     {
283 283
         $serverStats = $this->instance->getManager()->executeCommand('phpFastCache', new Command([
284
-          'serverStatus' => 1,
285
-          'recordStats' => 0,
286
-          'repl' => 0,
287
-          'metrics' => 0,
284
+            'serverStatus' => 1,
285
+            'recordStats' => 0,
286
+            'repl' => 0,
287
+            'metrics' => 0,
288 288
         ]))->toArray()[ 0 ];
289 289
 
290 290
         $collectionStats = $this->instance->getManager()->executeCommand('phpFastCache', new Command([
291
-          'collStats' => (isset($this->config[ 'collectionName' ]) ? $this->config[ 'collectionName' ] : 'Cache'),
292
-          'verbose' => true,
291
+            'collStats' => (isset($this->config[ 'collectionName' ]) ? $this->config[ 'collectionName' ] : 'Cache'),
292
+            'verbose' => true,
293 293
         ]))->toArray()[ 0 ];
294 294
 
295 295
         $array_filter_recursive = function ($array, callable $callback = null) use (&$array_filter_recursive) {
@@ -318,14 +318,14 @@  discard block
 block discarded – undo
318 318
         $collectionStats = $array_filter_recursive($collectionStats, $callback);
319 319
 
320 320
         $stats = (new DriverStatistic())
321
-          ->setInfo('MongoDB version ' . $serverStats->version . ', Uptime (in days): ' . round($serverStats->uptime / 86400,
322
-              1) . "\n For more information see RawData.")
323
-          ->setSize($collectionStats->size)
324
-          ->setData(implode(', ', array_keys($this->itemInstances)))
325
-          ->setRawData([
321
+            ->setInfo('MongoDB version ' . $serverStats->version . ', Uptime (in days): ' . round($serverStats->uptime / 86400,
322
+                1) . "\n For more information see RawData.")
323
+            ->setSize($collectionStats->size)
324
+            ->setData(implode(', ', array_keys($this->itemInstances)))
325
+            ->setRawData([
326 326
             'serverStatus' => $serverStats,
327 327
             'collStats' => $collectionStats,
328
-          ]);
328
+            ]);
329 329
 
330 330
         return $stats;
331 331
     }
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
                   self::DRIVER_EDATE_WRAPPER_INDEX => ($item->getTtl() > 0 ? new UTCDateTime((time() + $item->getTtl()) * 1000) : new UTCDateTime(time() * 1000)),
102 102
                 ];
103 103
 
104
-                if(!empty($this->config[ 'itemDetailedDate' ])){
104
+                if (!empty($this->config['itemDetailedDate'])) {
105 105
                     $set += [
106 106
                       self::DRIVER_MDATE_WRAPPER_INDEX => ($item->getModificationDate() ? new UTCDateTime(($item->getModificationDate()->getTimestamp()) * 1000) : new UTCDateTime(time() * 1000)),
107 107
                       self::DRIVER_CDATE_WRAPPER_INDEX => ($item->getCreationDate() ? new UTCDateTime(($item->getCreationDate()->getTimestamp()) * 1000) : new UTCDateTime(time() * 1000)),
108 108
                     ];
109 109
                 }
110 110
 
111
-                $result = (array)$this->getCollection()->updateOne(
111
+                $result = (array) $this->getCollection()->updateOne(
112 112
                   ['_id' => $item->getEncodedKey()],
113 113
                   ['$set' => $set],
114 114
                   ['upsert' => true, 'multiple' => false]
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                 throw new phpFastCacheDriverException('Got an exception while trying to write data to MongoDB server', null, $e);
118 118
             }
119 119
 
120
-            return isset($result[ 'ok' ]) ? $result[ 'ok' ] == 1 : true;
120
+            return isset($result['ok']) ? $result['ok'] == 1 : true;
121 121
         } else {
122 122
             throw new phpFastCacheInvalidArgumentException('Cross-Driver type confusion detected');
123 123
         }
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
 
134 134
         if ($document) {
135 135
             $return = [
136
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->getData()),
137
-              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->getData()),
138
-              self::DRIVER_EDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_EDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
136
+              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[self::DRIVER_DATA_WRAPPER_INDEX]->getData()),
137
+              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[self::DRIVER_TAGS_WRAPPER_INDEX]->getData()),
138
+              self::DRIVER_EDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[self::DRIVER_EDATE_WRAPPER_INDEX]->toDateTime()->getTimestamp()),
139 139
             ];
140 140
 
141
-            if(!empty($this->config[ 'itemDetailedDate' ])){
141
+            if (!empty($this->config['itemDetailedDate'])) {
142 142
                 $return += [
143
-                  self::DRIVER_MDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_MDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
144
-                  self::DRIVER_CDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_CDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
143
+                  self::DRIVER_MDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[self::DRIVER_MDATE_WRAPPER_INDEX]->toDateTime()->getTimestamp()),
144
+                  self::DRIVER_CDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[self::DRIVER_CDATE_WRAPPER_INDEX]->toDateTime()->getTimestamp()),
145 145
                 ];
146 146
             }
147 147
 
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
         if ($this->instance instanceof \MongoDB\Driver\Manager) {
192 192
             throw new LogicException('Already connected to Mongodb server');
193 193
         } else {
194
-            $timeout = isset($this->config[ 'timeout' ]) ? $this->config[ 'timeout' ] * 1000 : 3000;
195
-            $collectionName = isset($this->config[ 'collectionName' ]) ? $this->config[ 'collectionName' ] : 'Cache';
196
-            $databaseName = isset($this->config[ 'databaseName' ]) ? $this->config[ 'databaseName' ] : 'phpFastCache';
194
+            $timeout = isset($this->config['timeout']) ? $this->config['timeout'] * 1000 : 3000;
195
+            $collectionName = isset($this->config['collectionName']) ? $this->config['collectionName'] : 'Cache';
196
+            $databaseName = isset($this->config['databaseName']) ? $this->config['databaseName'] : 'phpFastCache';
197 197
 
198 198
             $this->instance = $this->instance ?: (new Client($this->buildConnectionURI($databaseName), ['connectTimeoutMS' => $timeout]));
199 199
             $this->database = $this->database ?: $this->instance->selectDatabase($databaseName);
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
      */
235 235
     protected function buildConnectionURI($databaseName = '')
236 236
     {
237
-        $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
238
-        $port = isset($this->config[ 'port' ]) ? $this->config[ 'port' ] : '27017';
239
-        $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
240
-        $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
237
+        $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
238
+        $port = isset($this->config['port']) ? $this->config['port'] : '27017';
239
+        $password = isset($this->config['password']) ? $this->config['password'] : '';
240
+        $username = isset($this->config['username']) ? $this->config['username'] : '';
241 241
 
242 242
         $parts = [
243 243
             'mongodb://',
@@ -276,14 +276,14 @@  discard block
 block discarded – undo
276 276
           'recordStats' => 0,
277 277
           'repl' => 0,
278 278
           'metrics' => 0,
279
-        ]))->toArray()[ 0 ];
279
+        ]))->toArray()[0];
280 280
 
281 281
         $collectionStats = $this->instance->getManager()->executeCommand('phpFastCache', new Command([
282
-          'collStats' => (isset($this->config[ 'collectionName' ]) ? $this->config[ 'collectionName' ] : 'Cache'),
282
+          'collStats' => (isset($this->config['collectionName']) ? $this->config['collectionName'] : 'Cache'),
283 283
           'verbose' => true,
284
-        ]))->toArray()[ 0 ];
284
+        ]))->toArray()[0];
285 285
 
286
-        $array_filter_recursive = function ($array, callable $callback = null) use (&$array_filter_recursive) {
286
+        $array_filter_recursive = function($array, callable $callback = null) use (&$array_filter_recursive) {
287 287
             $array = $callback($array);
288 288
 
289 289
             if (is_object($array) || is_array($array)) {
@@ -295,12 +295,12 @@  discard block
 block discarded – undo
295 295
             return $array;
296 296
         };
297 297
 
298
-        $callback = function ($item) {
298
+        $callback = function($item) {
299 299
             /**
300 300
              * Remove unserializable properties
301 301
              */
302 302
             if ($item instanceof \MongoDB\BSON\UTCDateTime) {
303
-                return (string)$item;
303
+                return (string) $item;
304 304
             }
305 305
             return $item;
306 306
         };
Please login to merge, or discard this patch.
src/phpFastCache/Entities/DriverStatistic.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     }
53 53
 
54 54
     /**
55
-     * @return int|bool Return size in octet or false if no information available
55
+     * @return string Return size in octet or false if no information available
56 56
      */
57 57
     public function getSize()
58 58
     {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     }
61 61
 
62 62
     /**
63
-     * @return mixed
63
+     * @return string
64 64
      */
65 65
     public function getData()
66 66
     {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     /**
71
-     * @param $info
71
+     * @param string $info
72 72
      * @return $this
73 73
      */
74 74
     public function setInfo($info)
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -123,10 +123,10 @@
 block discarded – undo
123 123
     public function getPublicDesc()
124 124
     {
125 125
         return [
126
-          'Info' => 'Cache Information',
127
-          'Size' => 'Cache Size',
128
-          'Data' => 'Cache items keys',
129
-          'RawData' => 'Cache raw data',
126
+            'Info' => 'Cache Information',
127
+            'Size' => 'Cache Size',
128
+            'Data' => 'Cache items keys',
129
+            'RawData' => 'Cache raw data',
130 130
         ];
131 131
     }
132 132
 }
133 133
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Wincache/Driver.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -133,9 +133,9 @@
 block discarded – undo
133 133
         $date = (new \DateTime())->setTimestamp(time() - $info[ 'total_cache_uptime' ]);
134 134
 
135 135
         return (new DriverStatistic())
136
-          ->setInfo(sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822)))
137
-          ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ])
138
-          ->setData(implode(', ', array_keys($this->itemInstances)))
139
-          ->setRawData($memInfo);
136
+            ->setInfo(sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822)))
137
+            ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ])
138
+            ->setData(implode(', ', array_keys($this->itemInstances)))
139
+            ->setRawData($memInfo);
140 140
     }
141 141
 }
142 142
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,11 +130,11 @@
 block discarded – undo
130 130
     {
131 131
         $memInfo = wincache_ucache_meminfo();
132 132
         $info = wincache_ucache_info();
133
-        $date = (new \DateTime())->setTimestamp(time() - $info[ 'total_cache_uptime' ]);
133
+        $date = (new \DateTime())->setTimestamp(time() - $info['total_cache_uptime']);
134 134
 
135 135
         return (new DriverStatistic())
136 136
           ->setInfo(sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822)))
137
-          ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ])
137
+          ->setSize($memInfo['memory_free'] - $memInfo['memory_total'])
138 138
           ->setData(implode(', ', array_keys($this->itemInstances)))
139 139
           ->setRawData($memInfo);
140 140
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Apc/Driver.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,10 +137,10 @@
 block discarded – undo
137 137
         $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]);
138 138
 
139 139
         return (new DriverStatistic())
140
-          ->setData(implode(', ', array_keys($this->itemInstances)))
141
-          ->setInfo(sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822),
140
+            ->setData(implode(', ', array_keys($this->itemInstances)))
141
+            ->setInfo(sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822),
142 142
             $stats[ 'num_entries' ]))
143
-          ->setRawData($stats)
144
-          ->setSize($stats[ 'mem_size' ]);
143
+            ->setRawData($stats)
144
+            ->setSize($stats[ 'mem_size' ]);
145 145
     }
146 146
 }
147 147
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -133,14 +133,14 @@
 block discarded – undo
133 133
      */
134 134
     public function getStats()
135 135
     {
136
-        $stats = (array)apc_cache_info('user');
137
-        $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]);
136
+        $stats = (array) apc_cache_info('user');
137
+        $date = (new \DateTime())->setTimestamp($stats['start_time']);
138 138
 
139 139
         return (new DriverStatistic())
140 140
           ->setData(implode(', ', array_keys($this->itemInstances)))
141 141
           ->setInfo(sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822),
142
-            $stats[ 'num_entries' ]))
142
+            $stats['num_entries']))
143 143
           ->setRawData($stats)
144
-          ->setSize($stats[ 'mem_size' ]);
144
+          ->setSize($stats['mem_size']);
145 145
     }
146 146
 }
147 147
\ No newline at end of file
Please login to merge, or discard this patch.