Completed
Push — v5 ( b9ce74...ac98a5 )
by Georges
02:32
created
src/phpFastCache/Cache/DriverBaseTrait.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
 
116 116
 
117 117
     /**
118
-     * @param $file
118
+     * @param string $file
119 119
      * @return string
120 120
      * @throws \Exception
121 121
      */
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -214,9 +214,9 @@
 block discarded – undo
214 214
     public function driverPreWrap(ExtendedCacheItemInterface $item)
215 215
     {
216 216
         return [
217
-          self::DRIVER_DATA_WRAPPER_INDEX => $item->get(),
218
-          self::DRIVER_TIME_WRAPPER_INDEX => $item->getExpirationDate(),
219
-          self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(),
217
+            self::DRIVER_DATA_WRAPPER_INDEX => $item->get(),
218
+            self::DRIVER_TIME_WRAPPER_INDEX => $item->getExpirationDate(),
219
+            self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(),
220 220
         ];
221 221
     }
222 222
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         if (is_array($config_name)) {
66 66
             $this->config = array_merge($this->config, $config_name);
67 67
         } else {
68
-            $this->config[ $config_name ] = $value;
68
+            $this->config[$config_name] = $value;
69 69
         }
70 70
     }
71 71
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
      */
183 183
     public function driverUnwrapData(array $wrapper)
184 184
     {
185
-        return $wrapper[ self::DRIVER_DATA_WRAPPER_INDEX ];
185
+        return $wrapper[self::DRIVER_DATA_WRAPPER_INDEX];
186 186
     }
187 187
 
188 188
     /**
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function driverUnwrapTags(array $wrapper)
193 193
     {
194
-        return $wrapper[ self::DRIVER_TAGS_WRAPPER_INDEX ];
194
+        return $wrapper[self::DRIVER_TAGS_WRAPPER_INDEX];
195 195
     }
196 196
 
197 197
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      */
202 202
     public function driverUnwrapTime(array $wrapper)
203 203
     {
204
-        return $wrapper[ self::DRIVER_TIME_WRAPPER_INDEX ];
204
+        return $wrapper[self::DRIVER_TIME_WRAPPER_INDEX];
205 205
     }
206 206
 
207 207
     /**
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
         foreach ($tagsItems as $tagsItem) {
256 256
             $data = (array) $tagsItem->get();
257 257
 
258
-            unset($data[ $item->getKey() ]);
258
+            unset($data[$item->getKey()]);
259 259
             $tagsItem->set($data);
260 260
 
261 261
             /**
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
      */
307 307
     public static function isValidOption($optionName, $optionValue)
308 308
     {
309
-        if(!is_string($optionName))
309
+        if (!is_string($optionName))
310 310
         {
311 311
             throw new \InvalidArgumentException('$optionName must be a string');
312 312
         }
Please login to merge, or discard this patch.
src/phpFastCache/Entities/driverStatistic.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     protected $rawData;
45 45
 
46 46
     /**
47
-     * @return string|bool Return infos or false if no information available
47
+     * @return string Return infos or false if no information available
48 48
      */
49 49
     public function getInfo()
50 50
     {
@@ -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
     {
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Apc/Driver.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 
58 58
     /**
59 59
      * @param \Psr\Cache\CacheItemInterface $item
60
-     * @return mixed
60
+     * @return boolean
61 61
      * @throws \InvalidArgumentException
62 62
      */
63 63
     public function driverWrite(CacheItemInterface $item)
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -154,9 +154,9 @@
 block discarded – undo
154 154
         $stats = (array) apc_cache_info('user');
155 155
         $date = (new \DateTime())->setTimestamp($stats['start_time']);
156 156
         return (new driverStatistic())
157
-          ->setData(implode(', ', array_keys($this->itemInstances)))
158
-          ->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), $stats['num_entries']))
159
-          ->setRawData($stats)
160
-          ->setSize($stats['mem_size']);
157
+            ->setData(implode(', ', array_keys($this->itemInstances)))
158
+            ->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), $stats['num_entries']))
159
+            ->setRawData($stats)
160
+            ->setSize($stats['mem_size']);
161 161
     }
162 162
 }
163 163
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Util/Directory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,8 +83,8 @@
 block discarded – undo
83 83
 
84 84
         $files = new RecursiveIteratorIterator
85 85
         (
86
-          new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
87
-          RecursiveIteratorIterator::CHILD_FIRST
86
+            new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
87
+            RecursiveIteratorIterator::CHILD_FIRST
88 88
         );
89 89
         
90 90
         foreach ($files as $fileinfo) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@  discard block
 block discarded – undo
81 81
             return unlink($source);
82 82
         }
83 83
 
84
-        $files = new RecursiveIteratorIterator
85
-        (
84
+        $files = new RecursiveIteratorIterator(
86 85
           new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
87 86
           RecursiveIteratorIterator::CHILD_FIRST
88 87
         );
@@ -95,7 +94,7 @@  discard block
 block discarded – undo
95 94
                 if (self::rrmdir($fileinfo->getRealPath()) === false) {
96 95
                     return false;
97 96
                 }
98
-            } else if(unlink($fileinfo->getRealPath()) === false) {
97
+            } else if (unlink($fileinfo->getRealPath()) === false) {
99 98
                 return false;
100 99
             }
101 100
         }
Please login to merge, or discard this patch.
src/phpFastCache/CacheManager.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
      * @var array
53 53
      */
54 54
     public static $config = [
55
-      'default_chmod' => 0777, // 0777 recommended
56
-      'fallback' => 'files', //Fall back when old driver is not support
57
-      'securityKey' => 'auto',
58
-      'htaccess' => true,
59
-      'path' => '',// if not set will be the value of sys_get_temp_dir()
60
-      "limited_memory_each_object" => 4096, // maximum size (bytes) of object store in memory
61
-      "compress_data" => false, // compress stored data, if the backend supports it
55
+        'default_chmod' => 0777, // 0777 recommended
56
+        'fallback' => 'files', //Fall back when old driver is not support
57
+        'securityKey' => 'auto',
58
+        'htaccess' => true,
59
+        'path' => '',// if not set will be the value of sys_get_temp_dir()
60
+        "limited_memory_each_object" => 4096, // maximum size (bytes) of object store in memory
61
+        "compress_data" => false, // compress stored data, if the backend supports it
62 62
     ];
63 63
 
64 64
     /**
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
             $class = self::getNamespacePath() . $driver . '\Driver';
87 87
             self::$instances[ $instance ] = new $class($config);
88 88
         } else {
89
-           // trigger_error('[' . $driver . '] Calling CacheManager::getInstance for already instanced drivers is a bad practice and have a significant impact on performances.
90
-           // See https://github.com/PHPSocialNetwork/phpfastcache/wiki/[V5]-Why-calling-getInstance%28%29-each-time-is-a-bad-practice-%3F');
89
+            // trigger_error('[' . $driver . '] Calling CacheManager::getInstance for already instanced drivers is a bad practice and have a significant impact on performances.
90
+            // See https://github.com/PHPSocialNetwork/phpfastcache/wiki/[V5]-Why-calling-getInstance%28%29-each-time-is-a-bad-practice-%3F');
91 91
         }
92 92
 
93 93
         return self::$instances[ $instance ];
@@ -175,21 +175,21 @@  discard block
 block discarded – undo
175 175
     public static function getStaticSystemDrivers()
176 176
     {
177 177
         return [
178
-          'Sqlite',
179
-          'Files',
180
-          'Apc',
181
-          'Apcu',
182
-          'Memcache',
183
-          'Memcached',
184
-          'Couchbase',
185
-          'Mongodb',
186
-          'Predis',
187
-          'Redis',
188
-          'Ssdb',
189
-          'Leveldb',
190
-          'Wincache',
191
-          'Xcache',
192
-          'Devnull',
178
+            'Sqlite',
179
+            'Files',
180
+            'Apc',
181
+            'Apcu',
182
+            'Memcache',
183
+            'Memcached',
184
+            'Couchbase',
185
+            'Mongodb',
186
+            'Predis',
187
+            'Redis',
188
+            'Ssdb',
189
+            'Leveldb',
190
+            'Wincache',
191
+            'Xcache',
192
+            'Devnull',
193 193
         ];
194 194
     }
195 195
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
       'fallback' => 'files', //Fall back when old driver is not support
57 57
       'securityKey' => 'auto',
58 58
       'htaccess' => true,
59
-      'path' => '',// if not set will be the value of sys_get_temp_dir()
59
+      'path' => '', // if not set will be the value of sys_get_temp_dir()
60 60
       "limited_memory_each_object" => 4096, // maximum size (bytes) of object store in memory
61 61
       "compress_data" => false, // compress stored data, if the backend supports it
62 62
     ];
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
         }
83 83
 
84 84
         $instance = crc32($driver . serialize($config));
85
-        if (!isset(self::$instances[ $instance ])) {
85
+        if (!isset(self::$instances[$instance])) {
86 86
             $class = self::getNamespacePath() . $driver . '\Driver';
87
-            self::$instances[ $instance ] = new $class($config);
87
+            self::$instances[$instance] = new $class($config);
88 88
         } else {
89 89
            // trigger_error('[' . $driver . '] Calling CacheManager::getInstance for already instanced drivers is a bad practice and have a significant impact on performances.
90 90
            // See https://github.com/PHPSocialNetwork/phpfastcache/wiki/[V5]-Why-calling-getInstance%28%29-each-time-is-a-bad-practice-%3F');
91 91
         }
92 92
 
93
-        return self::$instances[ $instance ];
93
+        return self::$instances[$instance];
94 94
     }
95 95
 
96 96
     /**
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      */
124 124
     public static function __callStatic($name, $arguments)
125 125
     {
126
-        $options = (array_key_exists(0, $arguments) && is_array($arguments) ? $arguments[ 0 ] : []);
126
+        $options = (array_key_exists(0, $arguments) && is_array($arguments) ? $arguments[0] : []);
127 127
 
128 128
         return self::getInstance($name, $options);
129 129
     }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         if (is_array($name)) {
166 166
             self::$config = array_merge(self::$config, $name);
167 167
         } else {
168
-            self::$config[ $name ] = $value;
168
+            self::$config[$name] = $value;
169 169
         }
170 170
     }
171 171
 
Please login to merge, or discard this patch.