Passed
Push — v7 ( 41e516...4ee131 )
by Georges
01:39
created
lib/Phpfastcache/Drivers/Ssdb/Driver.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Drivers\Ssdb;
17 17
 
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
         try {
58 58
             $clientConfig = $this->getConfig();
59 59
 
60
-            $this->instance = new SimpleSSDB($clientConfig[ 'host' ], $clientConfig[ 'port' ], $clientConfig[ 'timeout' ]);
61
-            if (!empty($clientConfig[ 'password' ])) {
62
-                $this->instance->auth($clientConfig[ 'password' ]);
60
+            $this->instance = new SimpleSSDB($clientConfig['host'], $clientConfig['port'], $clientConfig['timeout']);
61
+            if (!empty($clientConfig['password'])) {
62
+                $this->instance->auth($clientConfig['password']);
63 63
             }
64 64
 
65 65
             if (!$this->instance) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
          * Data returned by Ssdb are very poorly formatted
147 147
          * using hardcoded offset of pair key-value :-(
148 148
          */
149
-        $stat->setInfo(\sprintf("Ssdb-server v%s with a total of %s call(s).\n For more information see RawData.", $info[ 2 ], $info[ 6 ]))
149
+        $stat->setInfo(\sprintf("Ssdb-server v%s with a total of %s call(s).\n For more information see RawData.", $info[2], $info[6]))
150 150
           ->setRawData($info)
151 151
           ->setData(\implode(', ', \array_keys($this->itemInstances)))
152 152
           ->setSize($this->instance->dbsize());
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface};
19 19
 use Phpfastcache\Entities\DriverStatistic;
20 20
 use Phpfastcache\Exceptions\{
21
-  PhpfastcacheInvalidArgumentException, PhpfastcacheDriverCheckException, PhpfastcacheDriverException
21
+    PhpfastcacheInvalidArgumentException, PhpfastcacheDriverCheckException, PhpfastcacheDriverException
22 22
 };
23 23
 use Phpfastcache\Util\ArrayObject;
24 24
 use phpssdb\Core\{SimpleSSDB, SSDBException};
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
          * using hardcoded offset of pair key-value :-(
148 148
          */
149 149
         $stat->setInfo(\sprintf("Ssdb-server v%s with a total of %s call(s).\n For more information see RawData.", $info[ 2 ], $info[ 6 ]))
150
-          ->setRawData($info)
151
-          ->setData(\implode(', ', \array_keys($this->itemInstances)))
152
-          ->setSize($this->instance->dbsize());
150
+            ->setRawData($info)
151
+            ->setData(\implode(', ', \array_keys($this->itemInstances)))
152
+            ->setSize($this->instance->dbsize());
153 153
 
154 154
         return $stat;
155 155
     }
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memstatic/Item.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Drivers\Memstatic;
17 17
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface;
20 20
 use Phpfastcache\Drivers\Memstatic\Driver as MemstaticDriver;
21 21
 use Phpfastcache\Exceptions\{
22
-  PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
22
+    PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
23 23
 };
24 24
 
25 25
 /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memstatic/Driver.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Drivers\Memstatic;
17 17
 
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
     protected function driverRead(CacheItemInterface $item)
61 61
     {
62 62
         $key = \md5($item->getKey());
63
-        if (isset($this->staticStack[ $key ])) {
64
-            return $this->staticStack[ $key ];
63
+        if (isset($this->staticStack[$key])) {
64
+            return $this->staticStack[$key];
65 65
         }
66 66
         return null;
67 67
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
          * Check for Cross-Driver type confusion
78 78
          */
79 79
         if ($item instanceof Item) {
80
-            $this->staticStack[ \md5($item->getKey()) ] = $this->driverPreWrap($item);
80
+            $this->staticStack[\md5($item->getKey())] = $this->driverPreWrap($item);
81 81
             return true;
82 82
         }
83 83
 
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
          */
97 97
         if ($item instanceof Item) {
98 98
             $key = \md5($item->getKey());
99
-            if (isset($this->staticStack[ $key ])) {
100
-                unset($this->staticStack[ $key ]);
99
+            if (isset($this->staticStack[$key])) {
100
+                unset($this->staticStack[$key]);
101 101
                 return true;
102 102
             }
103 103
             return false;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface};
19 19
 use Phpfastcache\Entities\DriverStatistic;
20 20
 use Phpfastcache\Exceptions\{
21
-  PhpfastcacheInvalidArgumentException
21
+    PhpfastcacheInvalidArgumentException
22 22
 };
23 23
 use Psr\Cache\CacheItemInterface;
24 24
 
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $stat = new DriverStatistic();
131 131
         $stat->setInfo('[Memstatic] A memory static driver')
132
-          ->setSize(mb_strlen(\serialize($this->staticStack)))
133
-          ->setData(\implode(', ', \array_keys($this->itemInstances)))
134
-          ->setRawData($this->staticStack);
132
+            ->setSize(mb_strlen(\serialize($this->staticStack)))
133
+            ->setData(\implode(', ', \array_keys($this->itemInstances)))
134
+            ->setRawData($this->staticStack);
135 135
 
136 136
         return $stat;
137 137
     }
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memcached/Item.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Drivers\Memcached;
17 17
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface;
20 20
 use Phpfastcache\Drivers\Memcached\Driver as MemcachedDriver;
21 21
 use Phpfastcache\Exceptions\{
22
-  PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
22
+    PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
23 23
 };
24 24
 
25 25
 /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memcached/Driver.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
                  */
153 153
                 if(!empty($server[ 'path' ]) && !$this->instance->addServer($server[ 'path' ], 0)){
154 154
                     $this->fallback = true;
155
-                }else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
155
+                } else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
156 156
                     $this->fallback = true;
157 157
                 }
158 158
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Drivers\Memcached;
17 17
 
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
                 /**
86 86
                  * If path is provided we consider it as an UNIX Socket
87 87
                  */
88
-                if(!empty($server[ 'path' ]) && !$this->instance->addServer($server[ 'path' ], 0)){
88
+                if (!empty($server['path']) && !$this->instance->addServer($server['path'], 0)) {
89 89
                     $this->fallback = true;
90
-                }else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) {
90
+                } else if (!empty($server['host']) && !$this->instance->addServer($server['host'], $server['port'])) {
91 91
                     $this->fallback = true;
92 92
                 }
93 93
 
94
-                if (!empty($server[ 'saslUser' ]) && !empty($server[ 'saslPassword' ])) {
95
-                    $this->instance->setSaslAuthData($server[ 'saslUser' ], $server[ 'saslPassword' ]);
94
+                if (!empty($server['saslUser']) && !empty($server['saslPassword'])) {
95
+                    $this->instance->setSaslAuthData($server['saslUser'], $server['saslPassword']);
96 96
                 }
97 97
 
98 98
             } catch (\Exception $e) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
          * any error if not connected ...
106 106
          */
107 107
         $version = $this->instance->getVersion();
108
-        if(!$version || $this->instance->getResultCode() !== MemcachedSoftware::RES_SUCCESS){
108
+        if (!$version || $this->instance->getResultCode() !== MemcachedSoftware::RES_SUCCESS) {
109 109
             throw new PhpfastcacheDriverException('Memcached seems to not be connected');
110 110
         }
111 111
         return true;
@@ -188,16 +188,16 @@  discard block
 block discarded – undo
188 188
     public function getStats(): DriverStatistic
189 189
     {
190 190
         $stats = current($this->instance->getStats());
191
-        $stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0);
192
-        $stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : $this->instance->getVersion());
193
-        $stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0);
191
+        $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0);
192
+        $stats['version'] = (isset($stats['version']) ? $stats['version'] : $this->instance->getVersion());
193
+        $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0);
194 194
 
195
-        $date = (new \DateTime())->setTimestamp(\time() - $stats[ 'uptime' ]);
195
+        $date = (new \DateTime())->setTimestamp(\time() - $stats['uptime']);
196 196
 
197 197
         return (new DriverStatistic())
198 198
           ->setData(\implode(', ', \array_keys($this->itemInstances)))
199
-          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
199
+          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822)))
200 200
           ->setRawData($stats)
201
-          ->setSize((int)$stats[ 'bytes' ]);
201
+          ->setSize((int) $stats['bytes']);
202 202
     }
203 203
 }
204 204
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface};
21 21
 use Phpfastcache\Entities\DriverStatistic;
22 22
 use Phpfastcache\Exceptions\{
23
-  PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException
23
+    PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException
24 24
 };
25 25
 use Phpfastcache\Util\{ArrayObject, MemcacheDriverCollisionDetectorTrait};
26 26
 use Psr\Cache\CacheItemInterface;
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 
75 75
         if (\count($servers) < 1) {
76 76
             $servers = [
77
-              [
77
+                [
78 78
                 'host' => $this->getConfig()->getHost(),
79 79
                 'path' => $this->getConfig()->getPath(),
80 80
                 'port' => $this->getConfig()->getPort(),
81 81
                 'saslUser' => $this->getConfig()->getSaslUser() ?: false,
82 82
                 'saslPassword' => $this->getConfig()->getSaslPassword() ?: false,
83
-              ],
83
+                ],
84 84
             ];
85 85
         }
86 86
 
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
         $date = (new \DateTime())->setTimestamp(\time() - $stats[ 'uptime' ]);
198 198
 
199 199
         return (new DriverStatistic())
200
-          ->setData(\implode(', ', \array_keys($this->itemInstances)))
201
-          ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
202
-          ->setRawData($stats)
203
-          ->setSize((int)$stats[ 'bytes' ]);
200
+            ->setData(\implode(', ', \array_keys($this->itemInstances)))
201
+            ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
202
+            ->setRawData($stats)
203
+            ->setSize((int)$stats[ 'bytes' ]);
204 204
     }
205 205
 }
206 206
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Mongodb/Item.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Drivers\Mongodb;
17 17
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface;
20 20
 use Phpfastcache\Drivers\Mongodb\Driver as MongodbDriver;
21 21
 use Phpfastcache\Exceptions\{
22
-  PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
22
+    PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
23 23
 };
24 24
 
25 25
 /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Zendshm/Item.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
  * @author Lucas Brucksch <[email protected]>
11 11
  *
12 12
  */
13
-declare(strict_types=1);
13
+declare(strict_types = 1);
14 14
 
15 15
 namespace Phpfastcache\Drivers\Zendshm;
16 16
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface;
19 19
 use Phpfastcache\Drivers\Zendshm\Driver as ZendSHMDriver;
20 20
 use Phpfastcache\Exceptions\{
21
-  PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
21
+    PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
22 22
 };
23 23
 
24 24
 /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Zendshm/Driver.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @author Lucas Brucksch <[email protected]>
11 11
  *
12 12
  */
13
-declare(strict_types=1);
13
+declare(strict_types = 1);
14 14
 
15 15
 namespace Phpfastcache\Drivers\Zendshm;
16 16
 
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
      */
130 130
     public function getStats(): DriverStatistic
131 131
     {
132
-        $stats = (array)zend_shm_cache_info();
132
+        $stats = (array) zend_shm_cache_info();
133 133
         return (new DriverStatistic())
134 134
           ->setData(\implode(', ', \array_keys($this->itemInstances)))
135
-          ->setInfo(\sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats[ 'items_total' ]))
135
+          ->setInfo(\sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats['items_total']))
136 136
           ->setRawData($stats)
137
-          ->setSize($stats[ 'memory_total' ]);
137
+          ->setSize($stats['memory_total']);
138 138
     }
139 139
 }
140 140
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface};
18 18
 use Phpfastcache\Entities\DriverStatistic;
19 19
 use Phpfastcache\Exceptions\{
20
-  PhpfastcacheInvalidArgumentException
20
+    PhpfastcacheInvalidArgumentException
21 21
 };
22 22
 use Psr\Cache\CacheItemInterface;
23 23
 
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
     {
132 132
         $stats = (array)zend_shm_cache_info();
133 133
         return (new DriverStatistic())
134
-          ->setData(\implode(', ', \array_keys($this->itemInstances)))
135
-          ->setInfo(\sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats[ 'items_total' ]))
136
-          ->setRawData($stats)
137
-          ->setSize($stats[ 'memory_total' ]);
134
+            ->setData(\implode(', ', \array_keys($this->itemInstances)))
135
+            ->setInfo(\sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats[ 'items_total' ]))
136
+            ->setRawData($stats)
137
+            ->setSize($stats[ 'memory_total' ]);
138 138
     }
139 139
 }
140 140
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Leveldb/Item.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Drivers\Leveldb;
17 17
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface;
20 20
 use Phpfastcache\Drivers\Leveldb\Driver as LeveldbDriver;
21 21
 use Phpfastcache\Exceptions\{
22
-  PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
22
+    PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException
23 23
 };
24 24
 
25 25
 /**
Please login to merge, or discard this patch.