Completed
Pull Request — final (#490)
by Georges
02:21
created
src/phpFastCache/Core/Pool/DriverBaseTrait.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         if (is_array($config_name)) {
60 60
             $this->config = array_merge($this->config, $config_name);
61 61
         } else {
62
-            $this->config[ $config_name ] = $value;
62
+            $this->config[$config_name] = $value;
63 63
         }
64 64
     }
65 65
 
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function getConfigOption($optionName)
79 79
     {
80
-        if (isset($this->config[ $optionName ])) {
81
-            return $this->config[ $optionName ];
80
+        if (isset($this->config[$optionName])) {
81
+            return $this->config[$optionName];
82 82
         } else {
83 83
             return null;
84 84
         }
@@ -149,16 +149,16 @@  discard block
 block discarded – undo
149 149
           self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(),
150 150
         ];
151 151
 
152
-        if ($this->config[ 'itemDetailedDate' ]) {
153
-            $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = new \DateTime();
152
+        if ($this->config['itemDetailedDate']) {
153
+            $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = new \DateTime();
154 154
             /**
155 155
              * If the creation date exists
156 156
              * reuse it else set a new Date
157 157
              */
158
-            $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = $item->getCreationDate() ?: new \DateTime();
158
+            $wrap[self::DRIVER_CDATE_WRAPPER_INDEX] = $item->getCreationDate() ?: new \DateTime();
159 159
         } else {
160
-            $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = null;
161
-            $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = null;
160
+            $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = null;
161
+            $wrap[self::DRIVER_CDATE_WRAPPER_INDEX] = null;
162 162
         }
163 163
 
164 164
         return $wrap;
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public function driverUnwrapData(array $wrapper)
172 172
     {
173
-        return $wrapper[ self::DRIVER_DATA_WRAPPER_INDEX ];
173
+        return $wrapper[self::DRIVER_DATA_WRAPPER_INDEX];
174 174
     }
175 175
 
176 176
     /**
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      */
180 180
     public function driverUnwrapTags(array $wrapper)
181 181
     {
182
-        return $wrapper[ self::DRIVER_TAGS_WRAPPER_INDEX ];
182
+        return $wrapper[self::DRIVER_TAGS_WRAPPER_INDEX];
183 183
     }
184 184
 
185 185
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      */
190 190
     public function driverUnwrapEdate(array $wrapper)
191 191
     {
192
-        return $wrapper[ self::DRIVER_EDATE_WRAPPER_INDEX ];
192
+        return $wrapper[self::DRIVER_EDATE_WRAPPER_INDEX];
193 193
     }
194 194
 
195 195
     /**
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
      */
199 199
     public function driverUnwrapCdate(array $wrapper)
200 200
     {
201
-        return $wrapper[ self::DRIVER_CDATE_WRAPPER_INDEX ];
201
+        return $wrapper[self::DRIVER_CDATE_WRAPPER_INDEX];
202 202
     }
203 203
 
204 204
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      */
209 209
     public function driverUnwrapMdate(array $wrapper)
210 210
     {
211
-        return $wrapper[ self::DRIVER_MDATE_WRAPPER_INDEX ];
211
+        return $wrapper[self::DRIVER_MDATE_WRAPPER_INDEX];
212 212
     }
213 213
 
214 214
     /**
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      */
217 217
     public function getDriverName()
218 218
     {
219
-        if(!$this->driverName){
219
+        if (!$this->driverName) {
220 220
             $this->driverName = ucfirst(substr(strrchr((new \ReflectionObject($this))->getNamespaceName(), '\\'), 1));
221 221
         }
222 222
         return $this->driverName;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             throw new phpFastCacheLogicException('Trying to set tag(s) to an Tag item index: ' . $item->getKey());
239 239
         }
240 240
 
241
-        if(!$item->getTags() && !$item->getRemovedTags())
241
+        if (!$item->getTags() && !$item->getRemovedTags())
242 242
         {
243 243
             return true;
244 244
         }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
              * that has slow performances
259 259
              */
260 260
 
261
-            $tagsItem->set(array_merge((array)$data, [$item->getKey() => $expTimestamp]));
261
+            $tagsItem->set(array_merge((array) $data, [$item->getKey() => $expTimestamp]));
262 262
 
263 263
             /**
264 264
              * Set the expiration date
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
         $tagsItems = $this->getItems($this->getTagKeys($item->getRemovedTags()));
281 281
 
282 282
         foreach ($tagsItems as $tagsItem) {
283
-            $data = (array)$tagsItem->get();
283
+            $data = (array) $tagsItem->get();
284 284
 
285
-            unset($data[ $item->getKey() ]);
285
+            unset($data[$item->getKey()]);
286 286
             $tagsItem->set($data);
287 287
 
288 288
             /**
Please login to merge, or discard this patch.