Passed
Push — v7 ( 38b5a4...6da60d )
by Georges
01:42
created
lib/Phpfastcache/Exceptions/phpFastCacheIOException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     public function __construct($message = "", $code = 0, $previous = null)
28 28
     {
29 29
         $lastError = error_get_last();
30
-        if($lastError){
30
+        if ($lastError) {
31 31
             $message .= "\n";
32 32
             $message .= "Additional information provided by error_get_last():\n";
33 33
             $message .= "{$lastError['message']} in {$lastError['file']} line {$lastError['line']}";
Please login to merge, or discard this patch.
lib/Phpfastcache/Api.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache;
17 17
 
@@ -64,29 +64,29 @@  discard block
 block discarded – undo
64 64
          */
65 65
         static $version;
66 66
 
67
-        if($version && $cacheable){
67
+        if ($version && $cacheable) {
68 68
             return $version;
69 69
         }
70 70
 
71
-        if(\function_exists('shell_exec')){
71
+        if (\function_exists('shell_exec')) {
72 72
             $stdout = shell_exec('git describe --abbrev=0 --tags');
73
-            if(\is_string($stdout)){
73
+            if (\is_string($stdout)) {
74 74
                 $version = \trim($stdout);
75 75
                 return $version;
76 76
             }
77 77
             throw new phpFastCacheLogicException('The git command used to retrieve the PhpFastCache version has failed.');
78 78
         }
79 79
 
80
-        if(!$fallbackOnChangelog){
80
+        if (!$fallbackOnChangelog) {
81 81
             throw new phpFastCacheLogicException('shell_exec is disabled therefore the PhpFastCache version cannot be retrieved.');
82 82
         }
83 83
 
84 84
         $changelogFilename = __DIR__ . '/../../CHANGELOG.md';
85
-        if(\file_exists($changelogFilename)){
85
+        if (\file_exists($changelogFilename)) {
86 86
             $versionPrefix = '## ';
87 87
             $changelog = \explode("\n", self::getPhpFastCacheChangelog());
88
-            foreach ($changelog as $line){
89
-                if(\strpos($line, $versionPrefix) === 0){
88
+            foreach ($changelog as $line) {
89
+                if (\strpos($line, $versionPrefix) === 0) {
90 90
                     $version = \trim(\str_replace($versionPrefix, '', $line));
91 91
                     return $version;
92 92
                 }
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
     {
105 105
         static $hash;
106 106
 
107
-        if($hash && $cacheable){
107
+        if ($hash && $cacheable) {
108 108
             return $hash;
109 109
         }
110 110
 
111
-        if(\function_exists('shell_exec')){
111
+        if (\function_exists('shell_exec')) {
112 112
             $stdout = shell_exec('git rev-parse --short HEAD');
113
-            if(\is_string($stdout)){
113
+            if (\is_string($stdout)) {
114 114
                 $hash = \trim($stdout);
115 115
                 return "#{$hash}";
116 116
             }
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
     public static function getPhpFastCacheChangelog(): string
209 209
     {
210 210
         $changelogFilename = __DIR__ . '/../../CHANGELOG.md';
211
-        if(\file_exists($changelogFilename)){
211
+        if (\file_exists($changelogFilename)) {
212 212
             $string = \str_replace(["\r\n", "\r"], "\n", \trim(file_get_contents($changelogFilename)));
213
-            if($string){
213
+            if ($string) {
214 214
                 return $string;
215 215
             }
216 216
             throw new phpFastCacheLogicException('Unable to retrieve the PhpFastCache changelog as it seems to be empty.');
Please login to merge, or discard this patch.
lib/Phpfastcache/Util/ClassNamespaceResolverTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Util;
17 17
 
Please login to merge, or discard this patch.
lib/Phpfastcache/Util/Directory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,8 +83,8 @@
 block discarded – undo
83 83
 
84 84
         $files = new RecursiveIteratorIterator
85 85
         (
86
-          new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
87
-          RecursiveIteratorIterator::CHILD_FIRST
86
+            new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
87
+            RecursiveIteratorIterator::CHILD_FIRST
88 88
         );
89 89
         
90 90
         foreach ($files as $fileinfo) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Util;
17 17
 
@@ -87,8 +87,7 @@  discard block
 block discarded – undo
87 87
             return unlink($source);
88 88
         }
89 89
 
90
-        $files = new RecursiveIteratorIterator
91
-        (
90
+        $files = new RecursiveIteratorIterator(
92 91
           new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
93 92
           RecursiveIteratorIterator::CHILD_FIRST
94 93
         );
@@ -138,8 +137,8 @@  discard block
 block discarded – undo
138 137
         /**
139 138
          * Allows to dereference char
140 139
          */
141
-        $__FILE__ = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc.
142
-        $prefix = $__FILE__[ 0 ] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '';
140
+        $__FILE__ = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__); // remove file protocols such as "phar://" etc.
141
+        $prefix = $__FILE__[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '';
143 142
         return $prefix . \implode(DIRECTORY_SEPARATOR, $absolutes);
144 143
     }
145 144
 }
146 145
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Phpfastcache/Util/MemcacheDriverCollisionDetectorTrait.php 2 patches
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Util;
17 17
 
Please login to merge, or discard this patch.
lib/Phpfastcache/Util/ArrayObject.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * Date: 01/10/2017
6 6
  * Time: 00:08
7 7
  */
8
-declare(strict_types=1);
8
+declare(strict_types = 1);
9 9
 
10 10
 namespace Phpfastcache\Util;
11 11
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function __construct(...$args)
34 34
     {
35
-        $this->array = (\count($args) === 1 && \is_array($args[ 0 ]) ? $args[ 0 ] : $args);
35
+        $this->array = (\count($args) === 1 && \is_array($args[0]) ? $args[0] : $args);
36 36
     }
37 37
 
38 38
     /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function current()
42 42
     {
43
-        return $this->array[ $this->position ];
43
+        return $this->array[$this->position];
44 44
     }
45 45
 
46 46
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function offsetGet($offset)
100 100
     {
101
-        return $this->array[ $offset ] ?? null;
101
+        return $this->array[$offset] ?? null;
102 102
     }
103 103
 
104 104
     /**
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         if ($offset === null) {
114 114
             $this->array[] = $value;
115 115
         } else {
116
-            $this->array[ $offset ] = $value;
116
+            $this->array[$offset] = $value;
117 117
         }
118 118
     }
119 119
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function offsetUnset($offset)
124 124
     {
125
-        unset($this->array[ $offset ]);
125
+        unset($this->array[$offset]);
126 126
     }
127 127
 
128 128
     /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Memcached/Config.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
16 16
      * @var array
17 17
      */
18 18
     protected $servers = [
19
-      [
19
+        [
20 20
         'host' => '127.0.0.1',
21 21
         'port' => 11211,
22 22
         'saslUser' => false,
23 23
         'saslPassword' => false,
24
-      ],
24
+        ],
25 25
     ];
26 26
 
27 27
     /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Util/Languages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Util;
17 17
 
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Predis/Driver.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface};
20 20
 use Phpfastcache\Entities\DriverStatistic;
21 21
 use Phpfastcache\Exceptions\{
22
-  phpFastCacheInvalidArgumentException, phpFastCacheDriverException
22
+    phpFastCacheInvalidArgumentException, phpFastCacheDriverException
23 23
 };
24 24
 use Phpfastcache\Util\ArrayObject;
25 25
 use Predis\Client as PredisClient;
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
     {
58 58
         if(!empty($this->config->getOption('path'))){
59 59
             $this->instance = new PredisClient([
60
-              'scheme' => 'unix',
61
-              'path' =>  $this->config->getOption('path')
60
+                'scheme' => 'unix',
61
+                'path' =>  $this->config->getOption('path')
62 62
             ]);
63 63
         }else{
64 64
             $this->instance = new PredisClient($this->getConfig()->getPredisConfigArray());
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
         $date = (isset($info[ 'Server' ][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info[ 'Server' ][ 'uptime_in_seconds' ]) : 'unknown date');
172 172
 
173 173
         return (new DriverStatistic())
174
-          ->setData(\implode(', ', \array_keys($this->itemInstances)))
175
-          ->setRawData($info)
176
-          ->setSize((int) $size)
177
-          ->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.",
174
+            ->setData(\implode(', ', \array_keys($this->itemInstances)))
175
+            ->setRawData($info)
176
+            ->setSize((int) $size)
177
+            ->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.",
178 178
             $version, $date->format(DATE_RFC2822)));
179 179
     }
180 180
 }
181 181
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * @author Georges.L (Geolim4)  <[email protected]>
13 13
  *
14 14
  */
15
-declare(strict_types=1);
15
+declare(strict_types = 1);
16 16
 
17 17
 namespace Phpfastcache\Drivers\Predis;
18 18
 
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
      */
56 56
     protected function driverConnect(): bool
57 57
     {
58
-        if(!empty($this->config->getOption('path'))){
58
+        if (!empty($this->config->getOption('path'))) {
59 59
             $this->instance = new PredisClient([
60 60
               'scheme' => 'unix',
61 61
               'path' =>  $this->config->getOption('path')
62 62
             ]);
63
-        }else{
63
+        } else {
64 64
             $this->instance = new PredisClient($this->getConfig()->getPredisConfigArray());
65 65
         }
66 66
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
              * @see https://redis.io/commands/expire
107 107
              */
108 108
             if ($ttl <= 0) {
109
-                return (bool)$this->instance->expire($item->getKey(), 0);
109
+                return (bool) $this->instance->expire($item->getKey(), 0);
110 110
             }
111 111
 
112 112
             return $this->instance->setex($item->getKey(), $ttl, $this->encode($this->driverPreWrap($item)))->getPayload() === 'OK';
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
     public function getStats(): DriverStatistic
167 167
     {
168 168
         $info = $this->instance->info();
169
-        $size = (isset($info[ 'Memory' ][ 'used_memory' ]) ? $info[ 'Memory' ][ 'used_memory' ] : 0);
170
-        $version = (isset($info[ 'Server' ][ 'redis_version' ]) ? $info[ 'Server' ][ 'redis_version' ] : 0);
171
-        $date = (isset($info[ 'Server' ][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info[ 'Server' ][ 'uptime_in_seconds' ]) : 'unknown date');
169
+        $size = (isset($info['Memory']['used_memory']) ? $info['Memory']['used_memory'] : 0);
170
+        $version = (isset($info['Server']['redis_version']) ? $info['Server']['redis_version'] : 0);
171
+        $date = (isset($info['Server']['uptime_in_seconds']) ? (new \DateTime())->setTimestamp(time() - $info['Server']['uptime_in_seconds']) : 'unknown date');
172 172
 
173 173
         return (new DriverStatistic())
174 174
           ->setData(\implode(', ', \array_keys($this->itemInstances)))
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
               'scheme' => 'unix',
61 61
               'path' =>  $this->config->getOption('path')
62 62
             ]);
63
-        }else{
63
+        } else{
64 64
             $this->instance = new PredisClient($this->getConfig()->getPredisConfigArray());
65 65
         }
66 66
 
Please login to merge, or discard this patch.