Completed
Push — v5 ( 954df3...2bb146 )
by Georges
03:29
created
src/autoload.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         return;
28 28
     } else if (strpos($entity, 'Psr\Cache') === 0) {
29 29
         trigger_error('If you cannot use <b>composer</b>, you have to include manually the Psr\\Cache interfaces.<br />See: https://github.com/php-fig/cache/tree/master/src<br /> Called ' . $entity,
30
-          E_USER_ERROR);
30
+            E_USER_ERROR);
31 31
 
32 32
         return;
33 33
     }
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
 
43 43
 if (class_exists('Composer\Autoload\ClassLoader')) {
44 44
     trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.',
45
-      E_USER_WARNING);
45
+        E_USER_WARNING);
46 46
 }
47 47
\ 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
@@ -17,9 +17,9 @@
 block discarded – undo
17 17
 /**
18 18
  * Register Autoload
19 19
  */
20
-spl_autoload_register(function ($entity) {
20
+spl_autoload_register(function($entity) {
21 21
     $module = explode('\\', $entity, 2);
22
-    if (!in_array($module[ 0 ], ['phpFastCache', 'Psr'])) {
22
+    if (!in_array($module[0], ['phpFastCache', 'Psr'])) {
23 23
         /**
24 24
          * Not a part of phpFastCache file
25 25
          * then we return here.
Please login to merge, or discard this patch.
src/phpFastCache/Core/MemcacheDriverCollisionDetectorTrait.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
                 return true;
28 28
             } else if (constant($CONSTANT_NAME) !== $driverName) {
29 29
                 trigger_error('Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours',
30
-                  E_USER_WARNING);
30
+                    E_USER_WARNING);
31 31
 
32 32
                 return false;
33 33
             }
Please login to merge, or discard this patch.
src/phpFastCache/Cache/ItemBaseTrait.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -149,9 +149,9 @@
 block discarded – undo
149 149
         if (is_numeric($time)) {
150 150
             if ($time <= 0) {
151 151
                 /**
152
-                * 5 years, however memcached or memory cached will gone when u restart it
153
-                * just recommended for sqlite. files                
154
-                */
152
+                 * 5 years, however memcached or memory cached will gone when u restart it
153
+                 * just recommended for sqlite. files                
154
+                 */
155 155
                 $time = 30 * 24 * 3600 * 5;
156 156
             }
157 157
             $this->expirationDate = $this->expirationDate->add(new \DateInterval(sprintf('PT%dS', $time)));
Please login to merge, or discard this 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/Drivers/Predis/Driver.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -127,14 +127,14 @@
 block discarded – undo
127 127
     public function driverConnect()
128 128
     {
129 129
         $server = isset($this->config[ 'redis' ]) ? $this->config[ 'redis' ] : [
130
-          'host' => '127.0.0.1',
131
-          'port' => '6379',
132
-          'password' => '',
133
-          'database' => '',
130
+            'host' => '127.0.0.1',
131
+            'port' => '6379',
132
+            'password' => '',
133
+            'database' => '',
134 134
         ];
135 135
 
136 136
         $config = [
137
-          'host' => $server[ 'host' ],
137
+            'host' => $server[ 'host' ],
138 138
         ];
139 139
 
140 140
         $port = isset($server[ 'port' ]) ? $server[ 'port' ] : '';
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function driverConnect()
128 128
     {
129
-        $server = isset($this->config[ 'redis' ]) ? $this->config[ 'redis' ] : [
129
+        $server = isset($this->config['redis']) ? $this->config['redis'] : [
130 130
           'host' => '127.0.0.1',
131 131
           'port' => '6379',
132 132
           'password' => '',
@@ -134,32 +134,32 @@  discard block
 block discarded – undo
134 134
         ];
135 135
 
136 136
         $config = [
137
-          'host' => $server[ 'host' ],
137
+          'host' => $server['host'],
138 138
         ];
139 139
 
140
-        $port = isset($server[ 'port' ]) ? $server[ 'port' ] : '';
140
+        $port = isset($server['port']) ? $server['port'] : '';
141 141
         if ($port != '') {
142
-            $config[ 'port' ] = $port;
142
+            $config['port'] = $port;
143 143
         }
144 144
 
145
-        $password = isset($server[ 'password' ]) ? $server[ 'password' ] : '';
145
+        $password = isset($server['password']) ? $server['password'] : '';
146 146
         if ($password != '') {
147
-            $config[ 'password' ] = $password;
147
+            $config['password'] = $password;
148 148
         }
149 149
 
150
-        $database = isset($server[ 'database' ]) ? $server[ 'database' ] : '';
150
+        $database = isset($server['database']) ? $server['database'] : '';
151 151
         if ($database != '') {
152
-            $config[ 'database' ] = $database;
152
+            $config['database'] = $database;
153 153
         }
154 154
 
155
-        $timeout = isset($server[ 'timeout' ]) ? $server[ 'timeout' ] : '';
155
+        $timeout = isset($server['timeout']) ? $server['timeout'] : '';
156 156
         if ($timeout != '') {
157
-            $config[ 'timeout' ] = $timeout;
157
+            $config['timeout'] = $timeout;
158 158
         }
159 159
 
160
-        $read_write_timeout = isset($server[ 'read_write_timeout' ]) ? $server[ 'read_write_timeout' ] : '';
160
+        $read_write_timeout = isset($server['read_write_timeout']) ? $server['read_write_timeout'] : '';
161 161
         if ($read_write_timeout != '') {
162
-            $config[ 'read_write_timeout' ] = $read_write_timeout;
162
+            $config['read_write_timeout'] = $read_write_timeout;
163 163
         }
164 164
 
165 165
         $this->instance = new PredisClient($config);
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Memcache/Driver.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
         $servers = (!empty($this->config[ 'memcache' ]) && is_array($this->config[ 'memcache' ]) ? $this->config[ 'memcache' ] : []);
134 134
         if (count($servers) < 1) {
135 135
             $servers = [
136
-              ['127.0.0.1', 11211],
136
+                ['127.0.0.1', 11211],
137 137
             ];
138 138
         }
139 139
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $this->instance = new MemcacheSoftware();
53 53
             $this->driverConnect();
54 54
 
55
-            if (array_key_exists('compress_data', $config) && $config[ 'compress_data' ] === true) {
55
+            if (array_key_exists('compress_data', $config) && $config['compress_data'] === true) {
56 56
                 $this->memcacheFlags = MEMCACHE_COMPRESSED;
57 57
             }
58 58
         }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function driverConnect()
132 132
     {
133
-        $servers = (!empty($this->config[ 'memcache' ]) && is_array($this->config[ 'memcache' ]) ? $this->config[ 'memcache' ] : []);
133
+        $servers = (!empty($this->config['memcache']) && is_array($this->config['memcache']) ? $this->config['memcache'] : []);
134 134
         if (count($servers) < 1) {
135 135
             $servers = [
136 136
               ['127.0.0.1', 11211],
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
         foreach ($servers as $server) {
141 141
             try {
142
-                if (!$this->instance->addserver($server[ 0 ], $server[ 1 ])) {
142
+                if (!$this->instance->addserver($server[0], $server[1])) {
143 143
                     $this->fallback = true;
144 144
                 }
145 145
             } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Ssdb/Driver.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -144,10 +144,10 @@
 block discarded – undo
144 144
     public function driverConnect()
145 145
     {
146 146
         $server = isset($this->config[ 'ssdb' ]) ? $this->config[ 'ssdb' ] : [
147
-          'host' => "127.0.0.1",
148
-          'port' => 8888,
149
-          'password' => '',
150
-          'timeout' => 2000,
147
+            'host' => "127.0.0.1",
148
+            'port' => 8888,
149
+            'password' => '',
150
+            'timeout' => 2000,
151 151
         ];
152 152
 
153 153
         $host = $server[ 'host' ];
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -143,17 +143,17 @@
 block discarded – undo
143 143
      */
144 144
     public function driverConnect()
145 145
     {
146
-        $server = isset($this->config[ 'ssdb' ]) ? $this->config[ 'ssdb' ] : [
146
+        $server = isset($this->config['ssdb']) ? $this->config['ssdb'] : [
147 147
           'host' => "127.0.0.1",
148 148
           'port' => 8888,
149 149
           'password' => '',
150 150
           'timeout' => 2000,
151 151
         ];
152 152
 
153
-        $host = $server[ 'host' ];
154
-        $port = isset($server[ 'port' ]) ? (int) $server[ 'port' ] : 8888;
155
-        $password = isset($server[ 'password' ]) ? $server[ 'password' ] : '';
156
-        $timeout = !empty($server[ 'timeout' ]) ? (int) $server[ 'timeout' ] : 2000;
153
+        $host = $server['host'];
154
+        $port = isset($server['port']) ? (int) $server['port'] : 8888;
155
+        $password = isset($server['password']) ? $server['password'] : '';
156
+        $timeout = !empty($server['timeout']) ? (int) $server['timeout'] : 2000;
157 157
         $this->instance = new SimpleSSDB($host, $port, $timeout);
158 158
         if (!empty($password)) {
159 159
             $this->instance->auth($password);
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Redis/Driver.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -122,11 +122,11 @@
 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;
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devfalse/Driver.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,8 +140,8 @@
 block discarded – undo
140 140
     {
141 141
         $stat = new driverStatistic();
142 142
         $stat->setInfo('A void info string')
143
-          ->setSize(1337)
144
-          ->setData('A void data string');
143
+            ->setSize(1337)
144
+            ->setData('A void data string');
145 145
 
146 146
         return $stat;
147 147
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Cookie/Item.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             $this->driver->setItem($this);
43 43
         } else {
44 44
             throw new \InvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.',
45
-              gettype($key)));
45
+                gettype($key)));
46 46
         }
47 47
     }
48 48
 
Please login to merge, or discard this patch.