Completed
Pull Request — master (#215)
by Anthon
03:45
created
lib/Doctrine/Common/Cache/SQLite3Cache.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     /**
157 157
      * Find a single row by ID.
158 158
      *
159
-     * @param mixed $id
159
+     * @param string $id
160 160
      * @param bool $includeData
161 161
      *
162 162
      * @return array|null
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     /**
198 198
      * Gets an array of the fields in our table.
199 199
      *
200
-     * @return array
200
+     * @return string[]
201 201
      */
202 202
     private function getFields()
203 203
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $item = $this->findById($id);
90 90
 
91
-        if (!$item) {
91
+        if ( ! $item) {
92 92
             return false;
93 93
         }
94 94
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     {
168 168
         list($idField) = $fields = $this->getFields();
169 169
 
170
-        if (!$includeData) {
170
+        if ( ! $includeData) {
171 171
             $key = array_search(static::DATA_FIELD, $fields);
172 172
             unset($fields[$key]);
173 173
         }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/ApcCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
 
103 103
         // @TODO - Temporary fix @see https://github.com/krakjoe/apcu/pull/42
104 104
         if (PHP_VERSION_ID >= 50500) {
105
-            $info['num_hits']   = isset($info['num_hits'])   ? $info['num_hits']   : $info['nhits'];
105
+            $info['num_hits']   = isset($info['num_hits']) ? $info['num_hits'] : $info['nhits'];
106 106
             $info['num_misses'] = isset($info['num_misses']) ? $info['num_misses'] : $info['nmisses'];
107 107
             $info['start_time'] = isset($info['start_time']) ? $info['start_time'] : $info['stime'];
108 108
         }
Please login to merge, or discard this patch.
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/ChainCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
                 $value = $cacheProvider->doFetch($id);
64 64
 
65 65
                 // We populate all the previous cache layers (that are assumed to be faster)
66
-                for ($subKey = $key - 1 ; $subKey >= 0 ; $subKey--) {
66
+                for ($subKey = $key - 1; $subKey >= 0; $subKey--) {
67 67
                     $this->cacheProviders[$subKey]->doSave($id, $value);
68 68
                 }
69 69
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/FileCache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             // And there is a bug in PHP (https://bugs.php.net/bug.php?id=70943) with path lengths of 259.
145 145
             // So if the id in hex representation would surpass the limit, we use the hash instead. The prefix prevents
146 146
             // collisions between the hash and bin2hex.
147
-            $filename = '_' . $hash;
147
+            $filename = '_'.$hash;
148 148
         } else {
149 149
             $filename = bin2hex($id);
150 150
         }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     {
196 196
         $usage = 0;
197 197
         foreach ($this->getIterator() as $name => $file) {
198
-            if (! $file->isDir() && $this->isFilenameEndingWithExtension($name)) {
198
+            if ( ! $file->isDir() && $this->isFilenameEndingWithExtension($name)) {
199 199
                 $usage += $file->getSize();
200 200
             }
201 201
         }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     private function createPathIfNeeded($path)
221 221
     {
222 222
         if ( ! is_dir($path)) {
223
-            if (false === @mkdir($path, 0777 & (~$this->umask), true) && !is_dir($path)) {
223
+            if (false === @mkdir($path, 0777 & (~$this->umask), true) && ! is_dir($path)) {
224 224
                 return false;
225 225
             }
226 226
         }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/FilesystemCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,6 +106,6 @@
 block discarded – undo
106 106
         $data      = serialize($data);
107 107
         $filename  = $this->getFilename($id);
108 108
 
109
-        return $this->writeFile($filename, $lifeTime . PHP_EOL . $data);
109
+        return $this->writeFile($filename, $lifeTime.PHP_EOL.$data);
110 110
     }
111 111
 }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/PredisCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
         }
71 71
 
72 72
         // No lifetime, use MSET
73
-        $response = $this->client->mset(array_map(function ($value) {
73
+        $response = $this->client->mset(array_map(function($value) {
74 74
             return serialize($value);
75 75
         }, $keysAndValues));
76 76
 
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
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
 
96 96
             // Keys have lifetime, use SETEX for each of them
97 97
             foreach ($keysAndValues as $key => $value) {
98
-                if (!$this->redis->setex($key, $lifetime, $value)) {
98
+                if ( ! $this->redis->setex($key, $lifetime, $value)) {
99 99
                     $success = false;
100 100
                 }
101 101
             }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/PhpFileCache.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         parent::__construct($directory, $extension, $umask);
45 45
 
46
-        self::$emptyErrorHandler = function () {
46
+        self::$emptyErrorHandler = function() {
47 47
         };
48 48
     }
49 49
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $value = $this->includeFileForId($id);
56 56
 
57
-        if (! $value) {
57
+        if ( ! $value) {
58 58
             return false;
59 59
         }
60 60
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $value = $this->includeFileForId($id);
74 74
 
75
-        if (! $value) {
75
+        if ( ! $value) {
76 76
             return false;
77 77
         }
78 78
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $lifeTime = time() + $lifeTime;
89 89
         }
90 90
 
91
-        $filename  = $this->getFilename($id);
91
+        $filename = $this->getFilename($id);
92 92
 
93 93
         $value = [
94 94
             'lifetime'  => $lifeTime,
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
         restore_error_handler();
124 124
 
125
-        if (! isset($value['lifetime'])) {
125
+        if ( ! isset($value['lifetime'])) {
126 126
             return false;
127 127
         }
128 128
 
Please login to merge, or discard this patch.