Completed
Push — v5 ( 1fb1de...9d8603 )
by Georges
02:47
created
src/phpFastCache/Cache/ItemBaseTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
     public function removeTag($tagName)
350 350
     {
351 351
         if (($key = array_search($tagName, $this->tags)) !== false) {
352
-            unset($this->tags[ $key ]);
352
+            unset($this->tags[$key]);
353 353
             $this->removedTags[] = $tagName;
354 354
         }
355 355
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
     final public function __debugInfo()
393 393
     {
394 394
         $info = get_object_vars($this);
395
-        $info[ 'driver' ] = 'object(' . get_class($info[ 'driver' ]) . ')';
395
+        $info['driver'] = 'object(' . get_class($info['driver']) . ')';
396 396
 
397 397
         return (array) $info;
398 398
     }
Please login to merge, or discard this patch.
src/phpFastCache/Cache/DriverBaseTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         if (is_array($config_name)) {
68 68
             $this->config = array_merge($this->config, $config_name);
69 69
         } else {
70
-            $this->config[ $config_name ] = $value;
70
+            $this->config[$config_name] = $value;
71 71
         }
72 72
     }
73 73
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function driverUnwrapData(array $wrapper)
186 186
     {
187
-        return $wrapper[ self::DRIVER_DATA_WRAPPER_INDEX ];
187
+        return $wrapper[self::DRIVER_DATA_WRAPPER_INDEX];
188 188
     }
189 189
 
190 190
     /**
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public function driverUnwrapTags(array $wrapper)
195 195
     {
196
-        return $wrapper[ self::DRIVER_TAGS_WRAPPER_INDEX ];
196
+        return $wrapper[self::DRIVER_TAGS_WRAPPER_INDEX];
197 197
     }
198 198
 
199 199
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     public function driverUnwrapTime(array $wrapper)
205 205
     {
206
-        return $wrapper[ self::DRIVER_TIME_WRAPPER_INDEX ];
206
+        return $wrapper[self::DRIVER_TIME_WRAPPER_INDEX];
207 207
     }
208 208
 
209 209
     /**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         foreach ($tagsItems as $tagsItem) {
258 258
             $data = (array) $tagsItem->get();
259 259
 
260
-            unset($data[ $item->getKey() ]);
260
+            unset($data[$item->getKey()]);
261 261
             $tagsItem->set($data);
262 262
 
263 263
             /**
Please login to merge, or discard this patch.
src/phpFastCache/Core/StandardPsr6StructureTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             throw new \InvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.', gettype($key)));
72 72
         }
73 73
 
74
-        return $this->itemInstances[ $key ];
74
+        return $this->itemInstances[$key];
75 75
     }
76 76
 
77 77
     /**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function setItem(CacheItemInterface $item)
83 83
     {
84 84
         if ($this->getClassNamespace() . '\\Item' === get_class($item)) {
85
-            $this->itemInstances[ $item->getKey() ] = $item;
85
+            $this->itemInstances[$item->getKey()] = $item;
86 86
 
87 87
             return $this;
88 88
         } else {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $collection = [];
101 101
         foreach ($keys as $key) {
102
-            $collection[ $key ] = $this->getItem($key);
102
+            $collection[$key] = $this->getItem($key);
103 103
         }
104 104
 
105 105
         return $collection;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function deleteItem($key)
138 138
     {
139 139
         if ($this->hasItem($key) && $this->driverDelete($this->getItem($key))) {
140
-            unset($this->itemInstances[ $key ]);
140
+            unset($this->itemInstances[$key]);
141 141
 
142 142
             return true;
143 143
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function save(CacheItemInterface $item)
172 172
     {
173 173
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
174
-            $this->itemInstances[ $item->getKey() ] = $item;
174
+            $this->itemInstances[$item->getKey()] = $item;
175 175
         }
176 176
 
177 177
         return $this->driverWrite($item) && $this->driverWriteTags($item);
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
     public function saveDeferred(CacheItemInterface $item)
185 185
     {
186 186
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
187
-            $this->itemInstances[ $item->getKey() ] = $item;
187
+            $this->itemInstances[$item->getKey()] = $item;
188 188
         }
189 189
 
190
-        return $this->deferredList[ $item->getKey() ] = $item;
190
+        return $this->deferredList[$item->getKey()] = $item;
191 191
     }
192 192
 
193 193
     /**
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         foreach ($this->deferredList as $key => $item) {
201 201
             $result = $this->save($item);
202 202
             if ($return !== false) {
203
-                unset($this->deferredList[ $key ]);
203
+                unset($this->deferredList[$key]);
204 204
                 $return = $result;
205 205
             }
206 206
         }
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
@@ -159,9 +159,9 @@
 block discarded – undo
159 159
         $date = (new \DateTime())->setTimestamp(time() - $info[ 'uptime_in_seconds' ]);
160 160
 
161 161
         return (new driverStatistic())
162
-          ->setData(implode(', ', array_keys($this->itemInstances)))
163
-          ->setRawData($info)
164
-          ->setSize($info[ 'used_memory' ])
165
-          ->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.", $info[ 'redis_version' ], $date->format(DATE_RFC2822)));
162
+            ->setData(implode(', ', array_keys($this->itemInstances)))
163
+            ->setRawData($info)
164
+            ->setSize($info[ 'used_memory' ])
165
+            ->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.", $info[ 'redis_version' ], $date->format(DATE_RFC2822)));
166 166
     }
167 167
 }
168 168
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
         } else {
123 123
             $this->instance = $this->instance ?: new RedisClient();
124 124
 
125
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
126
-            $port = isset($this->config[ 'port' ]) ? (int) $this->config[ 'port' ] : '6379';
127
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
128
-            $database = isset($this->config[ 'database' ]) ? $this->config[ 'database' ] : '';
129
-            $timeout = isset($this->config[ 'timeout' ]) ? $this->config[ 'timeout' ] : '';
125
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
126
+            $port = isset($this->config['port']) ? (int) $this->config['port'] : '6379';
127
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
128
+            $database = isset($this->config['database']) ? $this->config['database'] : '';
129
+            $timeout = isset($this->config['timeout']) ? $this->config['timeout'] : '';
130 130
 
131 131
             if (!$this->instance->connect($host, (int) $port, (int) $timeout)) {
132 132
                 return false;
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
     {
157 157
         // used_memory
158 158
         $info = $this->instance->info();
159
-        $date = (new \DateTime())->setTimestamp(time() - $info[ 'uptime_in_seconds' ]);
159
+        $date = (new \DateTime())->setTimestamp(time() - $info['uptime_in_seconds']);
160 160
 
161 161
         return (new driverStatistic())
162 162
           ->setData(implode(', ', array_keys($this->itemInstances)))
163 163
           ->setRawData($info)
164
-          ->setSize($info[ 'used_memory' ])
165
-          ->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.", $info[ 'redis_version' ], $date->format(DATE_RFC2822)));
164
+          ->setSize($info['used_memory'])
165
+          ->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.", $info['redis_version'], $date->format(DATE_RFC2822)));
166 166
     }
167 167
 }
168 168
\ No newline at end of file
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
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $servers = (!empty($this->config[ 'memcache' ]) && is_array($this->config[ 'memcache' ]) ? $this->config[ 'memcache' ] : []);
131 131
         if (count($servers) < 1) {
132 132
             $servers = [
133
-              ['127.0.0.1', 11211],
133
+                ['127.0.0.1', 11211],
134 134
             ];
135 135
         }
136 136
 
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
         $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);
161 161
 
162 162
         return (new driverStatistic())
163
-          ->setData(implode(', ', array_keys($this->itemInstances)))
164
-          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
165
-          ->setRawData($stats)
166
-          ->setSize($stats[ 'bytes' ]);
163
+            ->setData(implode(', ', array_keys($this->itemInstances)))
164
+            ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
165
+            ->setRawData($stats)
166
+            ->setSize($stats[ 'bytes' ]);
167 167
     }
168 168
 }
169 169
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     protected 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) {
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
     public function getStats()
158 158
     {
159 159
         $stats = (array) $this->instance->getStats();
160
-        $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);
160
+        $date = (new \DateTime())->setTimestamp(time() - $stats['uptime']);
161 161
 
162 162
         return (new driverStatistic())
163 163
           ->setData(implode(', ', array_keys($this->itemInstances)))
164
-          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
164
+          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822)))
165 165
           ->setRawData($stats)
166
-          ->setSize($stats[ 'bytes' ]);
166
+          ->setSize($stats['bytes']);
167 167
     }
168 168
 }
169 169
\ 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
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
         if ($item instanceof Item) {
79 79
             try {
80 80
                 $result = (array) $this->getCollection()->update(
81
-                  ['_id' => $item->getKey()],
82
-                  [
81
+                    ['_id' => $item->getKey()],
82
+                    [
83 83
                     '$set' => [
84
-                      self::DRIVER_TIME_WRAPPER_INDEX => ($item->getTtl() > 0 ? new MongoDate(time() + $item->getTtl()) : new MongoDate(time())),
85
-                      self::DRIVER_DATA_WRAPPER_INDEX => new MongoBinData($this->encode($item->get()), MongoBinData::BYTE_ARRAY),
86
-                      self::DRIVER_TAGS_WRAPPER_INDEX => new MongoBinData($this->encode($item->getTags()), MongoBinData::BYTE_ARRAY),
84
+                        self::DRIVER_TIME_WRAPPER_INDEX => ($item->getTtl() > 0 ? new MongoDate(time() + $item->getTtl()) : new MongoDate(time())),
85
+                        self::DRIVER_DATA_WRAPPER_INDEX => new MongoBinData($this->encode($item->get()), MongoBinData::BYTE_ARRAY),
86
+                        self::DRIVER_TAGS_WRAPPER_INDEX => new MongoBinData($this->encode($item->getTags()), MongoBinData::BYTE_ARRAY),
87 87
                     ],
88
-                  ],
89
-                  ['upsert' => true, 'multiple' => false]
88
+                    ],
89
+                    ['upsert' => true, 'multiple' => false]
90 90
                 );
91 91
             } catch (MongoCursorException $e) {
92 92
                 return false;
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
     protected function driverRead(CacheItemInterface $item)
106 106
     {
107 107
         $document = $this->getCollection()
108
-          ->findOne(['_id' => $item->getKey()],
108
+            ->findOne(['_id' => $item->getKey()],
109 109
             [self::DRIVER_DATA_WRAPPER_INDEX, self::DRIVER_TIME_WRAPPER_INDEX, self::DRIVER_TAGS_WRAPPER_INDEX  /*'d', 'e'*/]);
110 110
 
111 111
         if ($document) {
112 112
             return [
113
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
114
-              self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
115
-              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->bin),
113
+                self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
114
+                self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
115
+                self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->bin),
116 116
             ];
117 117
         } else {
118 118
             return null;
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
              * @todo make an url builder
168 168
              */
169 169
             $this->instance = $this->instance ?: (new MongodbClient('mongodb://' .
170
-              ($username ?: '') .
171
-              ($password ? ":{$password}" : '') .
172
-              ($username ? '@' : '') . "{$host}" .
173
-              ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]))->phpFastCache;
170
+                ($username ?: '') .
171
+                ($password ? ":{$password}" : '') .
172
+                ($username ? '@' : '') . "{$host}" .
173
+                ($port != '27017' ? ":{$port}" : ''), ['connectTimeoutMS' => $timeout * 1000]))->phpFastCache;
174 174
             // $this->instance->Cache->createIndex([self::DRIVER_TIME_WRAPPER_INDEX => 1], ['expireAfterSeconds' => 0]);
175 175
         }
176 176
     }
@@ -196,25 +196,25 @@  discard block
 block discarded – undo
196 196
     public function getStats()
197 197
     {
198 198
         $serverStatus = $this->getCollection()->db->command([
199
-          'serverStatus' => 1,
200
-          'recordStats' => 0,
201
-          'repl' => 0,
202
-          'metrics' => 0,
199
+            'serverStatus' => 1,
200
+            'recordStats' => 0,
201
+            'repl' => 0,
202
+            'metrics' => 0,
203 203
         ]);
204 204
 
205 205
         $collStats = $this->getCollection()->db->command([
206
-          'collStats' => 'Cache',
207
-          'verbose' => true,
206
+            'collStats' => 'Cache',
207
+            'verbose' => true,
208 208
         ]);
209 209
 
210 210
         $stats = (new driverStatistic())
211
-          ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1) . "\n For more information see RawData.")
212
-          ->setSize((int) @$collStats[ 'size' ])
213
-          ->setData(implode(', ', array_keys($this->itemInstances)))
214
-          ->setRawData([
211
+            ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1) . "\n For more information see RawData.")
212
+            ->setSize((int) @$collStats[ 'size' ])
213
+            ->setData(implode(', ', array_keys($this->itemInstances)))
214
+            ->setRawData([
215 215
             'serverStatus' => $serverStatus,
216 216
             'collStats' => $collStats,
217
-          ]);
217
+            ]);
218 218
 
219 219
         return $stats;
220 220
     }
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
@@ -136,9 +136,9 @@
 block discarded – undo
136 136
         $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]);
137 137
 
138 138
         return (new driverStatistic())
139
-          ->setData(implode(', ', array_keys($this->itemInstances)))
140
-          ->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
-          ->setRawData($stats)
142
-          ->setSize($stats[ 'mem_size' ]);
139
+            ->setData(implode(', ', array_keys($this->itemInstances)))
140
+            ->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
+            ->setRawData($stats)
142
+            ->setSize($stats[ 'mem_size' ]);
143 143
     }
144 144
 }
145 145
\ 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
@@ -133,12 +133,12 @@
 block discarded – undo
133 133
     public function getStats()
134 134
     {
135 135
         $stats = (array) apc_cache_info('user');
136
-        $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]);
136
+        $date = (new \DateTime())->setTimestamp($stats['start_time']);
137 137
 
138 138
         return (new driverStatistic())
139 139
           ->setData(implode(', ', array_keys($this->itemInstances)))
140
-          ->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' ]))
140
+          ->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 141
           ->setRawData($stats)
142
-          ->setSize($stats[ 'mem_size' ]);
142
+          ->setSize($stats['mem_size']);
143 143
     }
144 144
 }
145 145
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Wincache/Driver.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -132,9 +132,9 @@
 block discarded – undo
132 132
         $date = (new \DateTime())->setTimestamp(time() - $info[ 'total_cache_uptime' ]);
133 133
 
134 134
         return (new driverStatistic())
135
-          ->setInfo(sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822)))
136
-          ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ])
137
-          ->setData(implode(', ', array_keys($this->itemInstances)))
138
-          ->setRawData($memInfo);
135
+            ->setInfo(sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822)))
136
+            ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ])
137
+            ->setData(implode(', ', array_keys($this->itemInstances)))
138
+            ->setRawData($memInfo);
139 139
     }
140 140
 }
141 141
\ 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
@@ -129,11 +129,11 @@
 block discarded – undo
129 129
     {
130 130
         $memInfo = wincache_ucache_meminfo();
131 131
         $info = wincache_ucache_info();
132
-        $date = (new \DateTime())->setTimestamp(time() - $info[ 'total_cache_uptime' ]);
132
+        $date = (new \DateTime())->setTimestamp(time() - $info['total_cache_uptime']);
133 133
 
134 134
         return (new driverStatistic())
135 135
           ->setInfo(sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822)))
136
-          ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ])
136
+          ->setSize($memInfo['memory_free'] - $memInfo['memory_total'])
137 137
           ->setData(implode(', ', array_keys($this->itemInstances)))
138 138
           ->setRawData($memInfo);
139 139
     }
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
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
             $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
143 143
             $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
144 144
             $buckets = isset($this->config[ 'buckets' ]) ? $this->config[ 'buckets' ] : [
145
-              [
145
+                [
146 146
                 'bucket' => 'default',
147 147
                 'password' => '',
148
-              ],
148
+                ],
149 149
             ];
150 150
 
151 151
             $this->instance = $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
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
         } else {
138 138
 
139 139
 
140
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
140
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
141 141
             //$port = isset($server[ 'port' ]) ? $server[ 'port' ] : '11211';
142
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
143
-            $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
144
-            $buckets = isset($this->config[ 'buckets' ]) ? $this->config[ 'buckets' ] : [
142
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
143
+            $username = isset($this->config['username']) ? $this->config['username'] : '';
144
+            $buckets = isset($this->config['buckets']) ? $this->config['buckets'] : [
145 145
               [
146 146
                 'bucket' => 'default',
147 147
                 'password' => '',
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
             $this->instance = $this->instance ?: new CouchbaseClient("couchbase://{$host}", $username, $password);
152 152
 
153 153
             foreach ($buckets as $bucket) {
154
-                $this->bucketCurrent = $this->bucketCurrent ?: $bucket[ 'bucket' ];
155
-                $this->setBucket($bucket[ 'bucket' ], $this->instance->openBucket($bucket[ 'bucket' ], $bucket[ 'password' ]));
154
+                $this->bucketCurrent = $this->bucketCurrent ?: $bucket['bucket'];
155
+                $this->setBucket($bucket['bucket'], $this->instance->openBucket($bucket['bucket'], $bucket['password']));
156 156
             }
157 157
         }
158 158
     }
@@ -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 \LogicException('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.