Test Failed
Branch final (67960f)
by Georges
02:28
created
src/phpFastCache/Entities/DriverStatistic.php 1 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/Apcu/Driver.php 1 patch
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 APCU 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 APCU 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.
src/phpFastCache/Drivers/Predis/Driver.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
         $config = isset($this->config[ 'predis' ]) ? $this->config[ 'predis' ] : [];
129 129
 
130 130
         $this->instance = new PredisClient(array_merge([
131
-          'host' => '127.0.0.1',
132
-          'port' => 6379,
133
-          'password' => null,
134
-          'database' => null,
131
+            'host' => '127.0.0.1',
132
+            'port' => 6379,
133
+            'password' => null,
134
+            'database' => null,
135 135
         ], $config));
136 136
 
137 137
         try {
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
         $date = (isset($info[ 'Server' ][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info[ 'Server' ][ 'uptime_in_seconds' ]) : 'unknown date');
175 175
 
176 176
         return (new DriverStatistic())
177
-          ->setData(implode(', ', array_keys($this->itemInstances)))
178
-          ->setRawData($info)
179
-          ->setSize($size)
180
-          ->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.",
177
+            ->setData(implode(', ', array_keys($this->itemInstances)))
178
+            ->setRawData($info)
179
+            ->setSize($size)
180
+            ->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.",
181 181
             $version, $date->format(DATE_RFC2822)));
182 182
     }
183 183
 }
184 184
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Zenddisk/Driver.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,9 +147,9 @@
 block discarded – undo
147 147
     {
148 148
         $stat = new DriverStatistic();
149 149
         $stat->setInfo('[ZendDisk] A void info string')
150
-          ->setSize(0)
151
-          ->setData(implode(', ', array_keys($this->itemInstances)))
152
-          ->setRawData(false);
150
+            ->setSize(0)
151
+            ->setData(implode(', ', array_keys($this->itemInstances)))
152
+            ->setRawData(false);
153 153
 
154 154
         return $stat;
155 155
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Cassandra/Driver.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -75,16 +75,16 @@  discard block
 block discarded – undo
75 75
             try {
76 76
                 $cacheData = $this->encode($this->driverPreWrap($item));
77 77
                 $options = new Cassandra\ExecutionOptions([
78
-                  'arguments' => [
78
+                    'arguments' => [
79 79
                     'cache_uuid' => new Cassandra\Uuid(),
80 80
                     'cache_id' => $item->getKey(),
81 81
                     'cache_data' => $cacheData,
82 82
                     'cache_creation_date' => new Cassandra\Timestamp((new \DateTime())->getTimestamp()),
83 83
                     'cache_expiration_date' => new Cassandra\Timestamp($item->getExpirationDate()->getTimestamp()),
84 84
                     'cache_length' => strlen($cacheData),
85
-                  ],
86
-                  'consistency' => Cassandra::CONSISTENCY_ALL,
87
-                  'serial_consistency' => Cassandra::CONSISTENCY_SERIAL,
85
+                    ],
86
+                    'consistency' => Cassandra::CONSISTENCY_ALL,
87
+                    'serial_consistency' => Cassandra::CONSISTENCY_SERIAL,
88 88
                 ]);
89 89
 
90 90
                 $query = sprintf('INSERT INTO %s.%s
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
     {
123 123
         try {
124 124
             $options = new Cassandra\ExecutionOptions([
125
-              'arguments' => ['cache_id' => $item->getKey()],
126
-              'page_size' => 1,
125
+                'arguments' => ['cache_id' => $item->getKey()],
126
+                'page_size' => 1,
127 127
             ]);
128 128
             $query = sprintf(
129
-              'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;',
130
-              self::CASSANDRA_KEY_SPACE,
131
-              self::CASSANDRA_TABLE
129
+                'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;',
130
+                self::CASSANDRA_KEY_SPACE,
131
+                self::CASSANDRA_TABLE
132 132
             );
133 133
             $results = $this->instance->execute(new Cassandra\SimpleStatement($query), $options);
134 134
 
@@ -155,14 +155,14 @@  discard block
 block discarded – undo
155 155
         if ($item instanceof Item) {
156 156
             try {
157 157
                 $options = new Cassandra\ExecutionOptions([
158
-                  'arguments' => [
158
+                    'arguments' => [
159 159
                     'cache_id' => $item->getKey(),
160
-                  ],
160
+                    ],
161 161
                 ]);
162 162
                 $result = $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
163
-                  'DELETE FROM %s.%s WHERE cache_id = :cache_id;',
164
-                  self::CASSANDRA_KEY_SPACE,
165
-                  self::CASSANDRA_TABLE
163
+                    'DELETE FROM %s.%s WHERE cache_id = :cache_id;',
164
+                    self::CASSANDRA_KEY_SPACE,
165
+                    self::CASSANDRA_TABLE
166 166
                 )), $options);
167 167
 
168 168
                 /**
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
     {
187 187
         try {
188 188
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
189
-              'TRUNCATE %s.%s;',
190
-              self::CASSANDRA_KEY_SPACE, self::CASSANDRA_TABLE
189
+                'TRUNCATE %s.%s;',
190
+                self::CASSANDRA_KEY_SPACE, self::CASSANDRA_TABLE
191 191
             )));
192 192
 
193 193
             return true;
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
             $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
214 214
 
215 215
             $clusterBuilder = Cassandra::cluster()
216
-              ->withContactPoints($host)
217
-              ->withPort($port);
216
+                ->withContactPoints($host)
217
+                ->withPort($port);
218 218
 
219 219
             if (!empty($this->config[ 'ssl' ][ 'enabled' ])) {
220 220
                 if (!empty($this->config[ 'ssl' ][ 'verify' ])) {
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
              */
243 243
 
244 244
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
245
-              "CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };",
246
-              self::CASSANDRA_KEY_SPACE
245
+                "CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };",
246
+                self::CASSANDRA_KEY_SPACE
247 247
             )));
248 248
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf('USE %s;', self::CASSANDRA_KEY_SPACE)));
249 249
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf('
@@ -290,15 +290,15 @@  discard block
 block discarded – undo
290 290
     public function getStats()
291 291
     {
292 292
         $result = $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
293
-          'SELECT SUM(cache_length) as cache_size FROM %s.%s',
294
-          self::CASSANDRA_KEY_SPACE,
295
-          self::CASSANDRA_TABLE
293
+            'SELECT SUM(cache_length) as cache_size FROM %s.%s',
294
+            self::CASSANDRA_KEY_SPACE,
295
+            self::CASSANDRA_TABLE
296 296
         )));
297 297
 
298 298
         return (new DriverStatistic())
299
-          ->setSize($result->first()[ 'cache_size' ])
300
-          ->setRawData([])
301
-          ->setData(implode(', ', array_keys($this->itemInstances)))
302
-          ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.');
299
+            ->setSize($result->first()[ 'cache_size' ])
300
+            ->setRawData([])
301
+            ->setData(implode(', ', array_keys($this->itemInstances)))
302
+            ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.');
303 303
     }
304 304
 }
305 305
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Memcache/Driver.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
         $servers = (!empty($this->config[ 'servers' ]) && is_array($this->config[ 'servers' ]) ? $this->config[ 'servers' ] : []);
134 134
         if (count($servers) < 1) {
135 135
             $servers = [
136
-              [
136
+                [
137 137
                 'host' => '127.0.0.1',
138 138
                 'port' => 11211,
139 139
                 'sasl_user' => false,
140 140
                 'sasl_password' => false,
141
-              ],
141
+                ],
142 142
             ];
143 143
         }
144 144
 
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
         $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);
176 176
 
177 177
         return (new DriverStatistic())
178
-          ->setData(implode(', ', array_keys($this->itemInstances)))
179
-          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
180
-          ->setRawData($stats)
181
-          ->setSize($stats[ 'bytes' ]);
178
+            ->setData(implode(', ', array_keys($this->itemInstances)))
179
+            ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
180
+            ->setRawData($stats)
181
+            ->setSize($stats[ 'bytes' ]);
182 182
     }
183 183
 }
184 184
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Mongodb/Driver.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
         if ($item instanceof Item) {
89 89
             try {
90 90
                 $result = (array)$this->getCollection()->updateOne(
91
-                  ['_id' => $item->getEncodedKey()],
92
-                  [
91
+                    ['_id' => $item->getEncodedKey()],
92
+                    [
93 93
                     '$set' => [
94
-                      self::DRIVER_DATA_WRAPPER_INDEX => new Binary($this->encode($item->get()), Binary::TYPE_GENERIC),
95
-                      self::DRIVER_TAGS_WRAPPER_INDEX => new Binary($this->encode($item->getTags()), Binary::TYPE_GENERIC),
96
-                      self::DRIVER_EDATE_WRAPPER_INDEX => ($item->getTtl() > 0 ? new UTCDateTime((time() + $item->getTtl()) * 1000) : new UTCDateTime(time() * 1000)),
94
+                        self::DRIVER_DATA_WRAPPER_INDEX => new Binary($this->encode($item->get()), Binary::TYPE_GENERIC),
95
+                        self::DRIVER_TAGS_WRAPPER_INDEX => new Binary($this->encode($item->getTags()), Binary::TYPE_GENERIC),
96
+                        self::DRIVER_EDATE_WRAPPER_INDEX => ($item->getTtl() > 0 ? new UTCDateTime((time() + $item->getTtl()) * 1000) : new UTCDateTime(time() * 1000)),
97 97
                     ],
98
-                  ],
99
-                  ['upsert' => true, 'multiple' => false]
98
+                    ],
99
+                    ['upsert' => true, 'multiple' => false]
100 100
                 );
101 101
             } catch (MongoDBException $e) {
102 102
                 throw new phpFastCacheDriverException('Got an exception while trying to write data to MongoDB server', null, $e);
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 
119 119
         if ($document) {
120 120
             return [
121
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->getData()),
122
-              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->getData()),
123
-              self::DRIVER_EDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_EDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
121
+                self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->getData()),
122
+                self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->getData()),
123
+                self::DRIVER_EDATE_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_EDATE_WRAPPER_INDEX ]->toDateTime()->getTimestamp()),
124 124
             ];
125 125
         } else {
126 126
             return null;
@@ -191,10 +191,10 @@  discard block
 block discarded – undo
191 191
              * @todo make an url builder
192 192
              */
193 193
             $this->instance = $this->instance ?: (new MongodbManager('mongodb://' .
194
-              ($username ?: '') .
195
-              ($password ? ":{$password}" : '') .
196
-              ($username ? '@' : '') . "{$host}" .
197
-              ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]));
194
+                ($username ?: '') .
195
+                ($password ? ":{$password}" : '') .
196
+                ($username ? '@' : '') . "{$host}" .
197
+                ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]));
198 198
             $this->collection = $this->collection ?: new Collection($this->instance, $databaseName, $collectionName);
199 199
 
200 200
             return true;
@@ -222,15 +222,15 @@  discard block
 block discarded – undo
222 222
     public function getStats()
223 223
     {
224 224
         $serverStats = $this->instance->executeCommand('phpFastCache', new Command([
225
-          'serverStatus' => 1,
226
-          'recordStats' => 0,
227
-          'repl' => 0,
228
-          'metrics' => 0,
225
+            'serverStatus' => 1,
226
+            'recordStats' => 0,
227
+            'repl' => 0,
228
+            'metrics' => 0,
229 229
         ]))->toArray()[ 0 ];
230 230
 
231 231
         $collectionStats = $this->instance->executeCommand('phpFastCache', new Command([
232
-          'collStats' => (isset($this->config[ 'collectionName' ]) ? $this->config[ 'collectionName' ] : 'Cache'),
233
-          'verbose' => true,
232
+            'collStats' => (isset($this->config[ 'collectionName' ]) ? $this->config[ 'collectionName' ] : 'Cache'),
233
+            'verbose' => true,
234 234
         ]))->toArray()[ 0 ];
235 235
 
236 236
         $array_filter_recursive = function ($array, callable $callback = null) use (&$array_filter_recursive) {
@@ -259,14 +259,14 @@  discard block
 block discarded – undo
259 259
         $collectionStats = $array_filter_recursive($collectionStats, $callback);
260 260
 
261 261
         $stats = (new DriverStatistic())
262
-          ->setInfo('MongoDB version ' . $serverStats->version . ', Uptime (in days): ' . round($serverStats->uptime / 86400,
263
-              1) . "\n For more information see RawData.")
264
-          ->setSize($collectionStats->size)
265
-          ->setData(implode(', ', array_keys($this->itemInstances)))
266
-          ->setRawData([
262
+            ->setInfo('MongoDB version ' . $serverStats->version . ', Uptime (in days): ' . round($serverStats->uptime / 86400,
263
+                1) . "\n For more information see RawData.")
264
+            ->setSize($collectionStats->size)
265
+            ->setData(implode(', ', array_keys($this->itemInstances)))
266
+            ->setRawData([
267 267
             'serverStatus' => $serverStats,
268 268
             'collStats' => $collectionStats,
269
-          ]);
269
+            ]);
270 270
 
271 271
         return $stats;
272 272
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Couchbase/Driver.php 1 patch
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.
src/phpFastCache/Drivers/Zendshm/Driver.php 1 patch
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.