Test Failed
Branch final (67960f)
by Georges
02:28
created
src/phpFastCache/Drivers/Couchbase/Driver.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
             $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
141 141
             $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
142 142
             $buckets = isset($this->config[ 'buckets' ]) ? $this->config[ 'buckets' ] : [
143
-              [
143
+                [
144 144
                 'bucket' => 'default',
145 145
                 'password' => '',
146
-              ],
146
+                ],
147 147
             ];
148 148
 
149 149
             $this->instance = new CouchbaseClient("couchbase://{$host}", $username, $password);
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
         $info = $this->getBucket()->manager()->info();
194 194
 
195 195
         return (new DriverStatistic())
196
-          ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
197
-          ->setRawData($info)
198
-          ->setData(implode(', ', array_keys($this->itemInstances)))
199
-          ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400,
200
-              1) . "\n For more information see RawData.");
196
+            ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
197
+            ->setRawData($info)
198
+            ->setData(implode(', ', array_keys($this->itemInstances)))
199
+            ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400,
200
+                1) . "\n For more information see RawData.");
201 201
     }
202 202
 }
203 203
\ No newline at end of file
Please login to merge, or discard this 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,10 +193,10 @@  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,
199
+          ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400,
200 200
               1) . "\n For more information see RawData.");
201 201
     }
202 202
 }
203 203
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Zendshm/Driver.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,9 +147,9 @@
 block discarded – undo
147 147
     {
148 148
         $stats = (array)zend_shm_cache_info();
149 149
         return (new DriverStatistic())
150
-          ->setData(implode(', ', array_keys($this->itemInstances)))
151
-          ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats[ 'items_total' ]))
152
-          ->setRawData($stats)
153
-          ->setSize($stats[ 'memory_total' ]);
150
+            ->setData(implode(', ', array_keys($this->itemInstances)))
151
+            ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats[ 'items_total' ]))
152
+            ->setRawData($stats)
153
+            ->setSize($stats[ 'memory_total' ]);
154 154
     }
155 155
 }
156 156
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -145,11 +145,11 @@
 block discarded – undo
145 145
      */
146 146
     public function getStats()
147 147
     {
148
-        $stats = (array)zend_shm_cache_info();
148
+        $stats = (array) zend_shm_cache_info();
149 149
         return (new DriverStatistic())
150 150
           ->setData(implode(', ', array_keys($this->itemInstances)))
151
-          ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats[ 'items_total' ]))
151
+          ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats['items_total']))
152 152
           ->setRawData($stats)
153
-          ->setSize($stats[ 'memory_total' ]);
153
+          ->setSize($stats['memory_total']);
154 154
     }
155 155
 }
156 156
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Files/Driver.php 1 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/Couchdb/Driver.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         if ($item instanceof Item) {
73 73
             try {
74 74
                 $this->instance->putDocument(['data' => $this->encode($this->driverPreWrap($item))], $item->getEncodedKey(),
75
-                  $this->getLatestDocumentRevision($item->getEncodedKey()));
75
+                    $this->getLatestDocumentRevision($item->getEncodedKey()));
76 76
             } catch (CouchDBException $e) {
77 77
                 throw new phpFastCacheDriverException('Got error while trying to upsert a document: ' . $e->getMessage(), null, $e);
78 78
             }
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
             $url .= $path;
175 175
 
176 176
             $this->instance = CouchDBClient::create([
177
-              'dbname' => $this->getDatabaseName(),
178
-              'url' => $url,
179
-              'timeout' => $timeout,
177
+                'dbname' => $this->getDatabaseName(),
178
+                'url' => $url,
179
+                'timeout' => $timeout,
180 180
             ]);
181 181
 
182 182
             $this->createDatabase();
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
         $path = '/' . $this->getDatabaseName() . '/' . urlencode($docId);
194 194
 
195 195
         $response = $this->instance->getHttpClient()->request(
196
-          'HEAD',
197
-          $path,
198
-          null,
199
-          false
196
+            'HEAD',
197
+            $path,
198
+            null,
199
+            false
200 200
         );
201 201
         if (!empty($response->headers[ 'etag' ])) {
202 202
             return trim($response->headers[ 'etag' ], " '\"\t\n\r\0\x0B");
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
         $info = $this->instance->getDatabaseInfo();
251 251
 
252 252
         return (new DriverStatistic())
253
-          ->setSize($info[ 'sizes' ][ 'active' ])
254
-          ->setRawData($info)
255
-          ->setData(implode(', ', array_keys($this->itemInstances)))
256
-          ->setInfo('Couchdb version ' . $this->instance->getVersion() . "\n For more information see RawData.");
253
+            ->setSize($info[ 'sizes' ][ 'active' ])
254
+            ->setRawData($info)
255
+            ->setData(implode(', ', array_keys($this->itemInstances)))
256
+            ->setInfo('Couchdb version ' . $this->instance->getVersion() . "\n For more information see RawData.");
257 257
     }
258 258
 }
259 259
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
             throw new phpFastCacheDriverException('Got error while trying to get a document: ' . $e->getMessage(), null, $e);
96 96
         }
97 97
 
98
-        if ($response->status === 404 || empty($response->body[ 'data' ])) {
98
+        if ($response->status === 404 || empty($response->body['data'])) {
99 99
             return null;
100 100
         } else if ($response->status === 200) {
101
-            return $this->decode($response->body[ 'data' ]);
101
+            return $this->decode($response->body['data']);
102 102
         } else {
103 103
             throw new phpFastCacheDriverException('Got unexpected HTTP status: ' . $response->status);
104 104
         }
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
         if ($this->instance instanceof CouchdbClient) {
154 154
             throw new phpFastCacheLogicException('Already connected to Couchdb server');
155 155
         } else {
156
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
157
-            $ssl = isset($this->config[ 'ssl' ]) ? $this->config[ 'ssl' ] : false;
158
-            $port = isset($this->config[ 'port' ]) ? $this->config[ 'port' ] : 5984;
159
-            $path = isset($this->config[ 'path' ]) ? $this->config[ 'path' ] : '/';
160
-            $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
161
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
162
-            $timeout = isset($this->config[ 'timeout' ]) ? $this->config[ 'timeout' ] : 10;
156
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
157
+            $ssl = isset($this->config['ssl']) ? $this->config['ssl'] : false;
158
+            $port = isset($this->config['port']) ? $this->config['port'] : 5984;
159
+            $path = isset($this->config['path']) ? $this->config['path'] : '/';
160
+            $username = isset($this->config['username']) ? $this->config['username'] : '';
161
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
162
+            $timeout = isset($this->config['timeout']) ? $this->config['timeout'] : 10;
163 163
 
164 164
             $url = ($ssl ? 'https://' : 'http://');
165 165
             if ($username) {
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
           null,
199 199
           false
200 200
         );
201
-        if (!empty($response->headers[ 'etag' ])) {
202
-            return trim($response->headers[ 'etag' ], " '\"\t\n\r\0\x0B");
201
+        if (!empty($response->headers['etag'])) {
202
+            return trim($response->headers['etag'], " '\"\t\n\r\0\x0B");
203 203
         }
204 204
 
205 205
         return null;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      */
211 211
     protected function getDatabaseName()
212 212
     {
213
-        return isset($this->config[ 'database' ]) ? $this->config[ 'database' ] : 'phpfastcache';
213
+        return isset($this->config['database']) ? $this->config['database'] : 'phpfastcache';
214 214
     }
215 215
 
216 216
     /**
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         $info = $this->instance->getDatabaseInfo();
251 251
 
252 252
         return (new DriverStatistic())
253
-          ->setSize($info[ 'sizes' ][ 'active' ])
253
+          ->setSize($info['sizes']['active'])
254 254
           ->setRawData($info)
255 255
           ->setData(implode(', ', array_keys($this->itemInstances)))
256 256
           ->setInfo('Couchdb version ' . $this->instance->getVersion() . "\n For more information see RawData.");
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Leveldb/Driver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
             $this->instance->close();
126 126
             $this->instance = null;
127 127
         }
128
-        $result = (bool)LeveldbClient::destroy($this->getLeveldbFile());
128
+        $result = (bool) LeveldbClient::destroy($this->getLeveldbFile());
129 129
         $this->driverConnect();
130 130
 
131 131
         return $result;
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Apc/Driver.php 1 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.
src/phpFastCache/Drivers/Devfalse/Driver.php 1 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/Memstatic/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('[Memstatic] A memory static driver')
143
-          ->setSize(mb_strlen(serialize($this->staticStack)))
144
-          ->setData(implode(', ', array_keys($this->itemInstances)))
145
-          ->setRawData($this->staticStack);
143
+            ->setSize(mb_strlen(serialize($this->staticStack)))
144
+            ->setData(implode(', ', array_keys($this->itemInstances)))
145
+            ->setRawData($this->staticStack);
146 146
 
147 147
         return $stat;
148 148
     }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
          * Check for Cross-Driver type confusion
69 69
          */
70 70
         if ($item instanceof Item) {
71
-            return $this->staticStack[ md5($item->getKey()) ] = $this->driverPreWrap($item);
71
+            return $this->staticStack[md5($item->getKey())] = $this->driverPreWrap($item);
72 72
         } else {
73 73
             throw new phpFastCacheInvalidArgumentException('Cross-Driver type confusion detected');
74 74
         }
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
     protected function driverRead(CacheItemInterface $item)
82 82
     {
83 83
         $key = md5($item->getKey());
84
-        if (isset($this->staticStack[ $key ])) {
85
-            return $this->staticStack[ $key ];
84
+        if (isset($this->staticStack[$key])) {
85
+            return $this->staticStack[$key];
86 86
         }
87 87
         return null;
88 88
     }
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
          */
100 100
         if ($item instanceof Item) {
101 101
             $key = md5($item->getKey());
102
-            if (isset($this->staticStack[ $key ])) {
103
-                unset($this->staticStack[ $key ]);
102
+            if (isset($this->staticStack[$key])) {
103
+                unset($this->staticStack[$key]);
104 104
                 return true;
105 105
             }
106 106
             return false;
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Redis/Driver.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -163,10 +163,10 @@
 block discarded – undo
163 163
         $date = (new \DateTime())->setTimestamp(time() - $info[ 'uptime_in_seconds' ]);
164 164
 
165 165
         return (new DriverStatistic())
166
-          ->setData(implode(', ', array_keys($this->itemInstances)))
167
-          ->setRawData($info)
168
-          ->setSize($info[ 'used_memory' ])
169
-          ->setInfo(sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.",
166
+            ->setData(implode(', ', array_keys($this->itemInstances)))
167
+            ->setRawData($info)
168
+            ->setSize($info[ 'used_memory' ])
169
+            ->setInfo(sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.",
170 170
             $info[ 'redis_version' ], $date->format(DATE_RFC2822)));
171 171
     }
172 172
 }
173 173
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -126,20 +126,20 @@  discard block
 block discarded – undo
126 126
         } else {
127 127
             $this->instance = $this->instance ?: new RedisClient();
128 128
 
129
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
130
-            $port = isset($this->config[ 'port' ]) ? (int)$this->config[ 'port' ] : '6379';
131
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
132
-            $database = isset($this->config[ 'database' ]) ? $this->config[ 'database' ] : '';
133
-            $timeout = isset($this->config[ 'timeout' ]) ? $this->config[ 'timeout' ] : '';
129
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
130
+            $port = isset($this->config['port']) ? (int) $this->config['port'] : '6379';
131
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
132
+            $database = isset($this->config['database']) ? $this->config['database'] : '';
133
+            $timeout = isset($this->config['timeout']) ? $this->config['timeout'] : '';
134 134
 
135
-            if (!$this->instance->connect($host, (int)$port, (int)$timeout)) {
135
+            if (!$this->instance->connect($host, (int) $port, (int) $timeout)) {
136 136
                 return false;
137 137
             } else {
138 138
                 if ($password && !$this->instance->auth($password)) {
139 139
                     return false;
140 140
                 }
141 141
                 if ($database) {
142
-                    $this->instance->select((int)$database);
142
+                    $this->instance->select((int) $database);
143 143
                 }
144 144
 
145 145
                 return true;
@@ -160,13 +160,13 @@  discard block
 block discarded – undo
160 160
     {
161 161
         // used_memory
162 162
         $info = $this->instance->info();
163
-        $date = (new \DateTime())->setTimestamp(time() - $info[ 'uptime_in_seconds' ]);
163
+        $date = (new \DateTime())->setTimestamp(time() - $info['uptime_in_seconds']);
164 164
 
165 165
         return (new DriverStatistic())
166 166
           ->setData(implode(', ', array_keys($this->itemInstances)))
167 167
           ->setRawData($info)
168
-          ->setSize($info[ 'used_memory' ])
168
+          ->setSize($info['used_memory'])
169 169
           ->setInfo(sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.",
170
-            $info[ 'redis_version' ], $date->format(DATE_RFC2822)));
170
+            $info['redis_version'], $date->format(DATE_RFC2822)));
171 171
     }
172 172
 }
173 173
\ No newline at end of file
Please login to merge, or discard this patch.