Completed
Pull Request — master (#251)
by Gabriel
10:22
created
lib/Doctrine/Common/Cache/ArrayCache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     protected function doFetch($id)
67 67
     {
68
-        if (! $this->doContains($id)) {
68
+        if ( ! $this->doContains($id)) {
69 69
             $this->missesCount += 1;
70 70
 
71 71
             return false;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     protected function doContains($id)
83 83
     {
84
-        if (! isset($this->data[$id])) {
84
+        if ( ! isset($this->data[$id])) {
85 85
             return false;
86 86
         }
87 87
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/RedisCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 
77 77
             // Keys have lifetime, use SETEX for each of them
78 78
             foreach ($keysAndValues as $key => $value) {
79
-                if (! $this->redis->setex($key, $lifetime, $value)) {
79
+                if ( ! $this->redis->setex($key, $lifetime, $value)) {
80 80
                     $success = false;
81 81
                 }
82 82
             }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/SQLite3Cache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $item = $this->findById($id);
80 80
 
81
-        if (! $item) {
81
+        if ( ! $item) {
82 82
             return false;
83 83
         }
84 84
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     {
157 157
         list($idField) = $fields = $this->getFields();
158 158
 
159
-        if (! $includeData) {
159
+        if ( ! $includeData) {
160 160
             $key = array_search(static::DATA_FIELD, $fields);
161 161
             unset($fields[$key]);
162 162
         }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/FileCache.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     public function __construct($directory, $extension = '', $umask = 0002)
71 71
     {
72 72
         // YES, this needs to be *before* createPathIfNeeded()
73
-        if (! is_int($umask)) {
73
+        if ( ! is_int($umask)) {
74 74
             throw new \InvalidArgumentException(sprintf(
75 75
                 'The umask parameter is required to be integer, was: %s',
76 76
                 gettype($umask)
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
         }
79 79
         $this->umask = $umask;
80 80
 
81
-        if (! $this->createPathIfNeeded($directory)) {
81
+        if ( ! $this->createPathIfNeeded($directory)) {
82 82
             throw new \InvalidArgumentException(sprintf(
83 83
                 'The directory "%s" does not exist and could not be created.',
84 84
                 $directory
85 85
             ));
86 86
         }
87 87
 
88
-        if (! is_writable($directory)) {
88
+        if ( ! is_writable($directory)) {
89 89
             throw new \InvalidArgumentException(sprintf(
90 90
                 'The directory "%s" is not writable.',
91 91
                 $directory
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             // And there is a bug in PHP (https://bugs.php.net/bug.php?id=70943) with path lengths of 259.
141 141
             // So if the id in hex representation would surpass the limit, we use the hash instead. The prefix prevents
142 142
             // collisions between the hash and bin2hex.
143
-            $filename = '_' . $hash;
143
+            $filename = '_'.$hash;
144 144
         } else {
145 145
             $filename = bin2hex($id);
146 146
         }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     {
192 192
         $usage = 0;
193 193
         foreach ($this->getIterator() as $name => $file) {
194
-            if (! $file->isDir() && $this->isFilenameEndingWithExtension($name)) {
194
+            if ( ! $file->isDir() && $this->isFilenameEndingWithExtension($name)) {
195 195
                 $usage += $file->getSize();
196 196
             }
197 197
         }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      */
215 215
     private function createPathIfNeeded(string $path) : bool
216 216
     {
217
-        if (! is_dir($path)) {
217
+        if ( ! is_dir($path)) {
218 218
             if (@mkdir($path, 0777 & (~$this->umask), true) === false && ! is_dir($path)) {
219 219
                 return false;
220 220
             }
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
     {
236 236
         $filepath = pathinfo($filename, PATHINFO_DIRNAME);
237 237
 
238
-        if (! $this->createPathIfNeeded($filepath)) {
238
+        if ( ! $this->createPathIfNeeded($filepath)) {
239 239
             return false;
240 240
         }
241 241
 
242
-        if (! is_writable($filepath)) {
242
+        if ( ! is_writable($filepath)) {
243 243
             return false;
244 244
         }
245 245
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/PhpFileCache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         parent::__construct($directory, $extension, $umask);
35 35
 
36
-        self::$emptyErrorHandler = function () {
36
+        self::$emptyErrorHandler = function() {
37 37
         };
38 38
     }
39 39
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
         restore_error_handler();
113 113
 
114
-        if (! isset($value['lifetime'])) {
114
+        if ( ! isset($value['lifetime'])) {
115 115
             return null;
116 116
         }
117 117
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/ExtMongoDBCache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 
6 6
 namespace Doctrine\Common\Cache;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                 ['_id' => $id],
101 101
                 [
102 102
                     '$set' => [
103
-                        MongoDBCache::EXPIRATION_FIELD => ($lifeTime > 0 ? new UTCDateTime((time() + $lifeTime) * 1000): null),
103
+                        MongoDBCache::EXPIRATION_FIELD => ($lifeTime > 0 ? new UTCDateTime((time() + $lifeTime) * 1000) : null),
104 104
                         MongoDBCache::DATA_FIELD => new Binary(serialize($data), Binary::TYPE_GENERIC),
105 105
                     ],
106 106
                 ],
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                 'recordStats' => 0,
159 159
                 'repl' => 0,
160 160
             ])->toArray()[0];
161
-            $uptime       = $serverStatus['uptime'] ?? null;
161
+            $uptime = $serverStatus['uptime'] ?? null;
162 162
         } catch (Exception $e) {
163 163
         }
164 164
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/FilesystemCache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $lifetime = -1;
37 37
         $filename = $this->getFilename($id);
38 38
 
39
-        if (! is_file($filename)) {
39
+        if ( ! is_file($filename)) {
40 40
             return false;
41 41
         }
42 42
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $lifetime = -1;
71 71
         $filename = $this->getFilename($id);
72 72
 
73
-        if (! is_file($filename)) {
73
+        if ( ! is_file($filename)) {
74 74
             return false;
75 75
         }
76 76
 
@@ -98,6 +98,6 @@  discard block
 block discarded – undo
98 98
         $data     = serialize($data);
99 99
         $filename = $this->getFilename($id);
100 100
 
101
-        return $this->writeFile($filename, $lifeTime . PHP_EOL . $data);
101
+        return $this->writeFile($filename, $lifeTime.PHP_EOL.$data);
102 102
     }
103 103
 }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/CacheProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         $success = true;
255 255
 
256 256
         foreach ($keysAndValues as $key => $value) {
257
-            if (! $this->doSave($key, $value, $lifetime)) {
257
+            if ( ! $this->doSave($key, $value, $lifetime)) {
258 258
                 $success = false;
259 259
             }
260 260
         }
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         $success = true;
287 287
 
288 288
         foreach ($keys as $key) {
289
-            if (! $this->doDelete($key)) {
289
+            if ( ! $this->doDelete($key)) {
290 290
                 $success = false;
291 291
             }
292 292
         }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/RiakCache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             $response = $this->bucket->get($id);
42 42
 
43 43
             // No objects found
44
-            if (! $response->hasObject()) {
44
+            if ( ! $response->hasObject()) {
45 45
                 return false;
46 46
             }
47 47
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $response = $this->bucket->get($id, $input);
84 84
 
85 85
             // No objects found
86
-            if (! $response->hasObject()) {
86
+            if ( ! $response->hasObject()) {
87 87
                 return false;
88 88
             }
89 89
 
Please login to merge, or discard this patch.