Completed
Push — 2.0 ( a52f91...c9f4d8 )
by Marco
12:16
created
src/Comodojo/Cache/Providers/PhpRedis.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
 
32 32
     public function __construct(
33 33
         $server = '127.0.0.1',
34
-        $port=6379,
35
-        $timeout=0,
36
-        LoggerInterface $logger=null
34
+        $port = 6379,
35
+        $timeout = 0,
36
+        LoggerInterface $logger = null
37 37
     ) {
38 38
 
39 39
         if ( empty($server) ) {
Please login to merge, or discard this patch.
src/Comodojo/Cache/Components/AbstractStackManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 
85 85
         if ( $enabled === true ) {
86 86
 
87
-            foreach($this as $id => $provider) $result[$id] = $provider[0];
87
+            foreach ( $this as $id => $provider ) $result[$id] = $provider[0];
88 88
 
89 89
         } else {
90 90
 
91
-            foreach($this->getInnerIterator() as $id => $provider) $result[$id] = $provider[0];
91
+            foreach ( $this->getInnerIterator() as $id => $provider ) $result[$id] = $provider[0];
92 92
 
93 93
         }
94 94
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
         $result = [];
167 167
 
168
-        foreach($this as $id => $provider) $result[$id] = $provider[1];
168
+        foreach ( $this as $id => $provider ) $result[$id] = $provider[1];
169 169
 
170 170
         return $result;
171 171
 
Please login to merge, or discard this patch.
src/Comodojo/Cache/Drivers/FilesystemXattr.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         if ( $ttl == null || $ttl == 0 ) {
66 66
             $ttl = 0;
67 67
         } else {
68
-            $ttl = time()+intval($ttl);
68
+            $ttl = time() + intval($ttl);
69 69
         }
70 70
 
71 71
         $cached = @file_put_contents($cacheFile, $value, LOCK_EX);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
         $result = [];
126 126
 
127
-        foreach ($keys as $key) {
127
+        foreach ( $keys as $key ) {
128 128
             $result[$key] = $this->get($key, $namespace);
129 129
         }
130 130
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
         $result = [];
138 138
 
139
-        foreach ($key_values as $key => $value) {
139
+        foreach ( $key_values as $key => $value ) {
140 140
             $result[] = $this->set($key, $namespace, $value, $ttl);
141 141
         }
142 142
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
         $result = [];
150 150
 
151
-        foreach ($keys as $key) {
151
+        foreach ( $keys as $key ) {
152 152
             $result[] = $this->delete($key, $namespace);
153 153
         }
154 154
 
Please login to merge, or discard this patch.
src/Comodojo/Cache/Drivers/FilesystemGhost.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         if ( $ttl == null || $ttl == 0 ) {
67 67
             $ttl = 0;
68 68
         } else {
69
-            $ttl = time()+intval($ttl);
69
+            $ttl = time() + intval($ttl);
70 70
         }
71 71
 
72 72
         $cached = @file_put_contents($cacheFile, $value, LOCK_EX);
Please login to merge, or discard this patch.
src/Comodojo/Cache/Drivers/Apc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         $return = [];
121 121
 
122
-        foreach ($data as $scoped_key => $value) {
122
+        foreach ( $data as $scoped_key => $value ) {
123 123
             $key = substr($scoped_key, strlen("$scope-"));
124 124
             $return[$key] = $value;
125 125
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         $shadowNames = [];
142 142
 
143
-        foreach ($key_values as $key => $value) {
143
+        foreach ( $key_values as $key => $value ) {
144 144
             $shadowNames["$scope-$key"] = $value;
145 145
         }
146 146
 
Please login to merge, or discard this patch.
src/Comodojo/Cache/Drivers/Apcu.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         $return = [];
121 121
 
122
-        foreach ($data as $scoped_key => $value) {
122
+        foreach ( $data as $scoped_key => $value ) {
123 123
             $key = substr($scoped_key, strlen("$scope-"));
124 124
             $return[$key] = $value;
125 125
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         $shadowNames = [];
142 142
 
143
-        foreach ($key_values as $key => $value) {
143
+        foreach ( $key_values as $key => $value ) {
144 144
             $shadowNames["$scope-$key"] = $value;
145 145
         }
146 146
 
Please login to merge, or discard this patch.
src/Comodojo/Cache/Drivers/Memory.php 2 patches
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@  discard block
 block discarded – undo
39 39
     public function get($key, $namespace) {
40 40
 
41 41
         return $this->checkMemory($key, $namespace) ?
42
-            $this->data[$namespace][$key]['data'] :
43
-            null;
42
+            $this->data[$namespace][$key]['data'] : null;
44 43
 
45 44
     }
46 45
 
@@ -94,7 +93,7 @@  discard block
 block discarded – undo
94 93
 
95 94
         $result = [];
96 95
 
97
-        foreach ($keys as $key) {
96
+        foreach ( $keys as $key ) {
98 97
             $result[$key] = $this->get($key, $namespace);
99 98
         }
100 99
 
@@ -106,7 +105,7 @@  discard block
 block discarded – undo
106 105
 
107 106
         $result = [];
108 107
 
109
-        foreach ($key_values as $key => $value) {
108
+        foreach ( $key_values as $key => $value ) {
110 109
             $result[$key] = $this->set($key, $namespace, $value, $ttl);
111 110
         }
112 111
 
@@ -118,7 +117,7 @@  discard block
 block discarded – undo
118 117
 
119 118
         $result = [];
120 119
 
121
-        foreach ($keys as $key) {
120
+        foreach ( $keys as $key ) {
122 121
             $result[] = $this->delete($key, $namespace);
123 122
         }
124 123
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -156,12 +156,10 @@
 block discarded – undo
156 156
         $time = new DateTime('now');
157 157
 
158 158
         if ( !array_key_exists($namespace, $this->data)
159
-            || !array_key_exists($key, $this->data[$namespace]) )
160
-        {
159
+            || !array_key_exists($key, $this->data[$namespace]) ) {
161 160
             return false;
162 161
         } else if ( $this->data[$namespace][$key]['expire'] === 0
163
-            || $this->data[$namespace][$key]['expire'] > $time )
164
-        {
162
+            || $this->data[$namespace][$key]['expire'] > $time ) {
165 163
             return true;
166 164
         } else {
167 165
             unset($this->data[$namespace][$key]);
Please login to merge, or discard this patch.
src/Comodojo/Cache/Drivers/Memcached.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             return "$scope-$key";
122 122
         }, $keys);
123 123
 
124
-        if (version_compare(phpversion(), '7.0.0', '<')) {
124
+        if ( version_compare(phpversion(), '7.0.0', '<') ) {
125 125
             $data = $this->getInstance()->getMulti($keyscope, $null = null, MemcachedInstance::GET_PRESERVE_ORDER);
126 126
         } else {
127 127
             $data = $this->getInstance()->getMulti($keyscope, MemcachedInstance::GET_PRESERVE_ORDER);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
         $return = [];
131 131
 
132
-        foreach ($data as $scoped_key => $value) {
132
+        foreach ( $data as $scoped_key => $value ) {
133 133
             $key = substr($scoped_key, strlen("$scope-"));
134 134
             $return[$key] = $value;
135 135
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         $shadowNames = [];
152 152
 
153
-        foreach ($key_values as $key => $value) {
153
+        foreach ( $key_values as $key => $value ) {
154 154
             $shadowNames["$scope-$key"] = $value;
155 155
         }
156 156
 
Please login to merge, or discard this patch.
src/Comodojo/Cache/Drivers/PhpRedis.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
         $result = [];
177 177
 
178
-        foreach ($keys as $key) {
178
+        foreach ( $keys as $key ) {
179 179
             $result[$key] = $this->get($key, $namespace);
180 180
         }
181 181
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
         $result = [];
190 190
 
191
-        foreach ($key_values as $key => $value) {
191
+        foreach ( $key_values as $key => $value ) {
192 192
             $result[] = $this->set($key, $namespace, $value, $ttl);
193 193
         }
194 194
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         $result = [];
203 203
 
204
-        foreach ($keys as $key) {
204
+        foreach ( $keys as $key ) {
205 205
             $result[] = $this->delete($key, $namespace);
206 206
         }
207 207
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             $objects = $instance->dbSize();
241 241
             $stats = $instance->info();
242 242
 
243
-        } catch (RedisException $re ) {
243
+        } catch (RedisException $re) {
244 244
 
245 245
             throw $re;
246 246
 
Please login to merge, or discard this patch.