Completed
Push — v5 ( a234cb...4f37c0 )
by Georges
02:54
created
src/phpFastCache/Entities/driverStatistic.php 1 patch
Doc Comments   +4 added lines, -4 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
     {
@@ -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.
src/phpFastCache/Drivers/Xcache/Driver.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -154,10 +154,10 @@
 block discarded – undo
154 154
             $info = xcache_info(XC_TYPE_VAR, 0);
155 155
 
156 156
             return (new driverStatistic())
157
-              ->setSize(abs($info['size'] - $info['avail']))
158
-              ->setData(implode(', ', array_keys($this->itemInstances)))
159
-              ->setInfo(sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, str_replace(' ', ', ', XCACHE_MODULES)))
160
-              ->setRawData($info);
157
+                ->setSize(abs($info['size'] - $info['avail']))
158
+                ->setData(implode(', ', array_keys($this->itemInstances)))
159
+                ->setInfo(sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, str_replace(' ', ', ', XCACHE_MODULES)))
160
+                ->setRawData($info);
161 161
         }
162 162
         else
163 163
         {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
      */
150 150
     public function getStats()
151 151
     {
152
-        if(!ini_get('xcache.admin.enable_auth'))
152
+        if (!ini_get('xcache.admin.enable_auth'))
153 153
         {
154 154
             $info = xcache_info(XC_TYPE_VAR, 0);
155 155
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,8 +158,7 @@
 block discarded – undo
158 158
               ->setData(implode(', ', array_keys($this->itemInstances)))
159 159
               ->setInfo(sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, str_replace(' ', ', ', XCACHE_MODULES)))
160 160
               ->setRawData($info);
161
-        }
162
-        else
161
+        } else
163 162
         {
164 163
             throw new \RuntimeException("PhpFastCache is not able to read Xcache configuration. Please put this to your php.ini:\n
165 164
             [xcache.admin]
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Apcu/Driver.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -152,9 +152,9 @@
 block discarded – undo
152 152
         $stats = (array) apc_cache_info('user');
153 153
         $date = (new \DateTime())->setTimestamp($stats['start_time']);
154 154
         return (new driverStatistic())
155
-          ->setData(implode(', ', array_keys($this->itemInstances)))
156
-          ->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']))
157
-          ->setRawData($stats)
158
-          ->setSize($stats['mem_size']);
155
+            ->setData(implode(', ', array_keys($this->itemInstances)))
156
+            ->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']))
157
+            ->setRawData($stats)
158
+            ->setSize($stats['mem_size']);
159 159
     }
160 160
 }
161 161
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devfalse/Driver.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -140,9 +140,9 @@
 block discarded – undo
140 140
     {
141 141
         $stat = new driverStatistic();
142 142
         $stat->setInfo('[Devfalse] A void info string')
143
-          ->setSize(0)
144
-          ->setData(implode(', ', array_keys($this->itemInstances)))
145
-          ->setRawData(false);
143
+            ->setSize(0)
144
+            ->setData(implode(', ', array_keys($this->itemInstances)))
145
+            ->setRawData(false);
146 146
 
147 147
         return $stat;
148 148
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Memcached/Driver.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         $servers = (!empty($this->config[ 'memcache' ]) && is_array($this->config[ 'memcache' ]) ? $this->config[ 'memcache' ] : []);
132 132
         if (count($servers) < 1) {
133 133
             $servers = [
134
-              ['127.0.0.1', 11211],
134
+                ['127.0.0.1', 11211],
135 135
             ];
136 136
         }
137 137
 
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
         $stats = (array) $this->instance->getstats();
179 179
         $date = (new \DateTime())->setTimestamp(time() - $stats['uptime']);
180 180
         return (new driverStatistic())
181
-          ->setData(implode(', ', array_keys($this->itemInstances)))
182
-          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822)))
183
-          ->setRawData($stats)
184
-          ->setSize($stats['bytes']);
181
+            ->setData(implode(', ', array_keys($this->itemInstances)))
182
+            ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822)))
183
+            ->setRawData($stats)
184
+            ->setSize($stats['bytes']);
185 185
     }
186 186
 }
187 187
\ 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
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function driverConnect()
129 129
     {
130
-        $servers = (!empty($this->config[ 'memcache' ]) && is_array($this->config[ 'memcache' ]) ? $this->config[ 'memcache' ] : []);
130
+        $servers = (!empty($this->config['memcache']) && is_array($this->config['memcache']) ? $this->config['memcache'] : []);
131 131
         if (count($servers) < 1) {
132 132
             $servers = [
133 133
               ['127.0.0.1', 11211],
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
         foreach ($servers as $server) {
138 138
             try {
139
-                if (!$this->instance->addServer($server[ 0 ], $server[ 1 ])) {
139
+                if (!$this->instance->addServer($server[0], $server[1])) {
140 140
                     $this->fallback = true;
141 141
                 }
142 142
             } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devnull/Driver.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -140,9 +140,9 @@
 block discarded – undo
140 140
     {
141 141
         $stat = new driverStatistic();
142 142
         $stat->setInfo('[Devnull] A void info string')
143
-          ->setSize(0)
144
-          ->setData(implode(', ', array_keys($this->itemInstances)))
145
-          ->setRawData(null);
143
+            ->setSize(0)
144
+            ->setData(implode(', ', array_keys($this->itemInstances)))
145
+            ->setRawData(null);
146 146
 
147 147
         return $stat;
148 148
     }
Please login to merge, or discard this patch.
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.
src/phpFastCache/Drivers/Wincache/Driver.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -145,9 +145,9 @@
 block discarded – undo
145 145
     public function getStats()
146 146
     {
147 147
         return (new driverStatistic())
148
-          ->setInfo('There is currently no info available for this driver :/')
149
-          ->setSize(0)
150
-          ->setData(implode(', ', array_keys($this->itemInstances)))
151
-          ->setRawData(wincache_scache_info());
148
+            ->setInfo('There is currently no info available for this driver :/')
149
+            ->setSize(0)
150
+            ->setData(implode(', ', array_keys($this->itemInstances)))
151
+            ->setRawData(wincache_scache_info());
152 152
     }
153 153
 }
154 154
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Cache/ItemBaseTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function setHit($isHit)
116 116
     {
117
-        if(is_bool($isHit)){
117
+        if (is_bool($isHit)) {
118 118
             $this->isHit = $isHit;
119 119
             return $this;
120
-        }else{
120
+        } else {
121 121
             throw new \InvalidArgumentException('$isHit must be a boolean');
122 122
         }
123 123
     }
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
     public function removeTag($tagName)
370 370
     {
371 371
         if (($key = array_search($tagName, $this->tags)) !== false) {
372
-            unset($this->tags[ $key ]);
372
+            unset($this->tags[$key]);
373 373
             $this->removedTags[] = $tagName;
374 374
         }
375 375
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
     final public function __debugInfo()
416 416
     {
417 417
         $info = get_object_vars($this);
418
-        $info[ 'driver' ] = 'object(' . get_class($info[ 'driver' ]) . ')';
418
+        $info['driver'] = 'object(' . get_class($info['driver']) . ')';
419 419
 
420 420
         return (array) $info;
421 421
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -273,7 +273,7 @@
 block discarded – undo
273 273
         
274 274
         if (!is_dir($path)) {
275 275
             throw new phpFastCacheDriverException("Can't read PATH:" . $path, 94);
276
-        }else{
276
+        } else{
277 277
             $size = Directory::dirSize($path);
278 278
         }
279 279
 
Please login to merge, or discard this patch.