Completed
Pull Request — master (#1234)
by Ivo
14:07
created
src/Handler/DateHandler.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                     'type' => $type,
48 48
                     'format' => $format,
49 49
                     'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION,
50
-                    'method' => 'serialize' . $type,
50
+                    'method' => 'serialize'.$type,
51 51
                 ];
52 52
             }
53 53
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                 'type' => 'DateTimeInterface',
56 56
                 'direction' => GraphNavigatorInterface::DIRECTION_DESERIALIZATION,
57 57
                 'format' => $format,
58
-                'method' => 'deserializeDateTimeFrom' . ucfirst($format),
58
+                'method' => 'deserializeDateTimeFrom'.ucfirst($format),
59 59
             ];
60 60
         }
61 61
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
      */
224 224
     private function parseDateTime($data, array $type, bool $immutable = false): \DateTimeInterface
225 225
     {
226
-        $timezone = !empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone;
226
+        $timezone = ! empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone;
227 227
         $formats = $this->getDeserializationFormats($type);
228 228
 
229 229
         $formatTried = [];
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         throw new RuntimeException(sprintf(
249 249
             'Invalid datetime "%s", expected one of the format %s.',
250 250
             $data,
251
-            '"' . implode('", "', $formatTried) . '"'
251
+            '"'.implode('", "', $formatTried).'"'
252 252
         ));
253 253
     }
254 254
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                 $f = (float) $match[0];
263 263
             }
264 264
             $dateInterval = new \DateInterval($data);
265
-            $dateInterval->f= $f;
265
+            $dateInterval->f = $f;
266 266
         } catch (\Throwable $e) {
267 267
             throw new RuntimeException(sprintf('Invalid dateinterval "%s", expected ISO 8601 format', $data), 0, $e);
268 268
         }
@@ -295,15 +295,15 @@  discard block
 block discarded – undo
295 295
         $format = 'P';
296 296
 
297 297
         if (0 < $dateInterval->y) {
298
-            $format .= $dateInterval->y . 'Y';
298
+            $format .= $dateInterval->y.'Y';
299 299
         }
300 300
 
301 301
         if (0 < $dateInterval->m) {
302
-            $format .= $dateInterval->m . 'M';
302
+            $format .= $dateInterval->m.'M';
303 303
         }
304 304
 
305 305
         if (0 < $dateInterval->d) {
306
-            $format .= $dateInterval->d . 'D';
306
+            $format .= $dateInterval->d.'D';
307 307
         }
308 308
 
309 309
         if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) {
@@ -311,15 +311,15 @@  discard block
 block discarded – undo
311 311
         }
312 312
 
313 313
         if (0 < $dateInterval->h) {
314
-            $format .= $dateInterval->h . 'H';
314
+            $format .= $dateInterval->h.'H';
315 315
         }
316 316
 
317 317
         if (0 < $dateInterval->i) {
318
-            $format .= $dateInterval->i . 'M';
318
+            $format .= $dateInterval->i.'M';
319 319
         }
320 320
 
321 321
         if (0 < $dateInterval->s) {
322
-            $format .= $dateInterval->s . 'S';
322
+            $format .= $dateInterval->s.'S';
323 323
         }
324 324
 
325 325
         if ('P' === $format) {
Please login to merge, or discard this patch.