Completed
Push — V6 ( 3ff7d1...d91002 )
by Georges
02:25
created
src/phpFastCache/Drivers/Devfalse/Driver.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
     protected function driverRead(CacheItemInterface $item)
81 81
     {
82 82
         return [
83
-          self::DRIVER_DATA_WRAPPER_INDEX => false,
84
-          self::DRIVER_TAGS_WRAPPER_INDEX => [],
85
-          self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(),
83
+            self::DRIVER_DATA_WRAPPER_INDEX => false,
84
+            self::DRIVER_TAGS_WRAPPER_INDEX => [],
85
+            self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(),
86 86
         ];
87 87
     }
88 88
     /**
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
     {
132 132
         $stat = new DriverStatistic();
133 133
         $stat->setInfo('[Devfalse] A void info string')
134
-          ->setSize(0)
135
-          ->setData(implode(', ', array_keys($this->itemInstances)))
136
-          ->setRawData(false);
134
+            ->setSize(0)
135
+            ->setData(implode(', ', array_keys($this->itemInstances)))
136
+            ->setRawData(false);
137 137
 
138 138
         return $stat;
139 139
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Memcached/Driver.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
         $servers = (!empty($this->config[ 'servers' ]) && is_array($this->config[ 'servers' ]) ? $this->config[ 'servers' ] : []);
132 132
         if (count($servers) < 1) {
133 133
             $servers = [
134
-              [
134
+                [
135 135
                 'host' =>'127.0.0.1',
136 136
                 'port' => 11211,
137 137
                 'sasl_user' => false,
138 138
                 'sasl_password' => false
139
-              ],
139
+                ],
140 140
             ];
141 141
         }
142 142
 
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
         $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);
174 174
 
175 175
         return (new DriverStatistic())
176
-          ->setData(implode(', ', array_keys($this->itemInstances)))
177
-          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
178
-          ->setRawData($stats)
179
-          ->setSize($stats[ 'bytes' ]);
176
+            ->setData(implode(', ', array_keys($this->itemInstances)))
177
+            ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
178
+            ->setRawData($stats)
179
+            ->setSize($stats[ 'bytes' ]);
180 180
     }
181 181
 }
182 182
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     protected function driverConnect()
130 130
     {
131
-        $servers = (!empty($this->config[ 'servers' ]) && is_array($this->config[ 'servers' ]) ? $this->config[ 'servers' ] : []);
131
+        $servers = (!empty($this->config['servers']) && is_array($this->config['servers']) ? $this->config['servers'] : []);
132 132
         if (count($servers) < 1) {
133 133
             $servers = [
134 134
               [
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
                 if (!$this->instance->addServer($server['host'], $server['port'])) {
146 146
                     $this->fallback = true;
147 147
                 }
148
-                if(!empty($server[ 'sasl_user' ]) && !empty($server[ 'sasl_password'])){
149
-                    $this->instance->setSaslAuthData($server[ 'sasl_user' ], $server[ 'sasl_password']);
148
+                if (!empty($server['sasl_user']) && !empty($server['sasl_password'])) {
149
+                    $this->instance->setSaslAuthData($server['sasl_user'], $server['sasl_password']);
150 150
                 }
151 151
             } catch (\Exception $e) {
152 152
                 $this->fallback = true;
@@ -166,16 +166,16 @@  discard block
 block discarded – undo
166 166
     public function getStats()
167 167
     {
168 168
         $stats = (array) $this->instance->getStats();
169
-        $stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0);
170
-        $stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : 'UnknownVersion');
171
-        $stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0);
169
+        $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0);
170
+        $stats['version'] = (isset($stats['version']) ? $stats['version'] : 'UnknownVersion');
171
+        $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0);
172 172
 
173
-        $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);
173
+        $date = (new \DateTime())->setTimestamp(time() - $stats['uptime']);
174 174
 
175 175
         return (new DriverStatistic())
176 176
           ->setData(implode(', ', array_keys($this->itemInstances)))
177
-          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
177
+          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822)))
178 178
           ->setRawData($stats)
179
-          ->setSize($stats[ 'bytes' ]);
179
+          ->setSize($stats['bytes']);
180 180
     }
181 181
 }
182 182
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devnull/Driver.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -127,9 +127,9 @@
 block discarded – undo
127 127
     {
128 128
         $stat = new DriverStatistic();
129 129
         $stat->setInfo('[Devnull] A void info string')
130
-          ->setSize(0)
131
-          ->setData(implode(', ', array_keys($this->itemInstances)))
132
-          ->setRawData(null);
130
+            ->setSize(0)
131
+            ->setData(implode(', ', array_keys($this->itemInstances)))
132
+            ->setRawData(null);
133 133
 
134 134
         return $stat;
135 135
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Couchdb/Driver.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
             $url .= $path;
176 176
 
177 177
             $this->instance = CouchDBClient::create([
178
-              'dbname' => $this->getDatabaseName(),
179
-              'url' => $url,
180
-              'timeout' => $timeout
178
+                'dbname' => $this->getDatabaseName(),
179
+                'url' => $url,
180
+                'timeout' => $timeout
181 181
             ]);
182 182
 
183 183
             $this->createDatabase();
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
         $path = '/' . $this->getDatabaseName() . '/' . urlencode($docId);
195 195
 
196 196
         $response = $this->instance->getHttpClient()->request(
197
-          'GET',// At this moment HEAD requests are not working: https://github.com/doctrine/couchdb-client/issues/72
198
-          $path,
199
-          null,
200
-          false
197
+            'GET',// At this moment HEAD requests are not working: https://github.com/doctrine/couchdb-client/issues/72
198
+            $path,
199
+            null,
200
+            false
201 201
         );
202 202
         if(!empty($response->headers['etag'])){
203 203
             return trim($response->headers['etag'], " '\"\t\n\r\0\x0B");
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
         $info = $this->instance->getDatabaseInfo();
239 239
 
240 240
         return (new DriverStatistic())
241
-          ->setSize($info['sizes']['active'])
242
-          ->setRawData($info)
243
-          ->setData(implode(', ', array_keys($this->itemInstances)))
244
-          ->setInfo('Couchdb version ' . $this->instance->getVersion() . "\n For more information see RawData.");
241
+            ->setSize($info['sizes']['active'])
242
+            ->setRawData($info)
243
+            ->setData(implode(', ', array_keys($this->itemInstances)))
244
+            ->setInfo('Couchdb version ' . $this->instance->getVersion() . "\n For more information see RawData.");
245 245
     }
246 246
 }
247 247
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Memstatic/Driver.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 {
31 31
     use DriverBaseTrait;
32 32
 
33
-  /**
34
-   * @var array
35
-   */
33
+    /**
34
+     * @var array
35
+     */
36 36
     protected $staticStack = [];
37 37
 
38 38
     /**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $key = md5($item->getKey());
88 88
         if(isset($this->staticStack[$key])){
89
-          return $this->staticStack[$key];
89
+            return $this->staticStack[$key];
90 90
         }
91 91
         return null;
92 92
     }
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
          * Check for Cross-Driver type confusion
103 103
          */
104 104
         if ($item instanceof Item) {
105
-          $key = md5($item->getKey());
106
-          if(isset($this->staticStack[$key])){
107
-              unset($this->staticStack[$key]);
108
-              return true;
109
-          }
110
-          return false;
105
+            $key = md5($item->getKey());
106
+            if(isset($this->staticStack[$key])){
107
+                unset($this->staticStack[$key]);
108
+                return true;
109
+            }
110
+            return false;
111 111
         } else {
112 112
             throw new phpFastCacheInvalidArgumentException('Cross-Driver type confusion detected');
113 113
         }
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
      */
119 119
     protected function driverClear()
120 120
     {
121
-      unset($this->staticStack);
122
-      $this->staticStack = [];
123
-      return true;
121
+        unset($this->staticStack);
122
+        $this->staticStack = [];
123
+        return true;
124 124
     }
125 125
 
126 126
     /**
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
     {
145 145
         $stat = new DriverStatistic();
146 146
         $stat->setInfo('[Memstatic] A memory static driver')
147
-          ->setSize(mb_strlen(serialize($this->staticStack)))
148
-          ->setData(implode(', ', array_keys($this->itemInstances)))
149
-          ->setRawData($this->staticStack);
147
+            ->setSize(mb_strlen(serialize($this->staticStack)))
148
+            ->setData(implode(', ', array_keys($this->itemInstances)))
149
+            ->setRawData($this->staticStack);
150 150
 
151 151
         return $stat;
152 152
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Couchbase/Driver.php 2 patches
Indentation   +6 added lines, -6 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,9 +193,9 @@  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, 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, 1) . "\n For more information see RawData.");
200 200
     }
201 201
 }
202 202
\ 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,9 +193,9 @@  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, 1) . "\n For more information see RawData.");
199
+          ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400, 1) . "\n For more information see RawData.");
200 200
     }
201 201
 }
202 202
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Apcu/Driver.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,9 +137,9 @@
 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), $stats[ 'num_entries' ]))
142
-          ->setRawData($stats)
143
-          ->setSize($stats[ 'mem_size' ]);
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), $stats[ 'num_entries' ]))
142
+            ->setRawData($stats)
143
+            ->setSize($stats[ 'mem_size' ]);
144 144
     }
145 145
 }
146 146
\ 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
@@ -134,12 +134,12 @@
 block discarded – undo
134 134
     public function getStats()
135 135
     {
136 136
         $stats = (array) apcu_cache_info();
137
-        $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]);
137
+        $date = (new \DateTime())->setTimestamp($stats['start_time']);
138 138
 
139 139
         return (new DriverStatistic())
140 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), $stats[ 'num_entries' ]))
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), $stats['num_entries']))
142 142
           ->setRawData($stats)
143
-          ->setSize($stats[ 'mem_size' ]);
143
+          ->setSize($stats['mem_size']);
144 144
     }
145 145
 }
146 146
\ No newline at end of file
Please login to merge, or discard this patch.