Completed
Pull Request — master (#1234)
by Ivo
17:21 queued 02:20
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
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             $dateInterval = new \DateInterval($data);
265 265
             // milliseconds are only available from >=7.1
266 266
             if (isset($dateInterval->f)) {
267
-                $dateInterval->f= $f;
267
+                $dateInterval->f = $f;
268 268
             }
269 269
         } catch (\Throwable $e) {
270 270
             throw new RuntimeException(sprintf('Invalid dateinterval "%s", expected ISO 8601 format', $data), 0, $e);
@@ -298,15 +298,15 @@  discard block
 block discarded – undo
298 298
         $format = 'P';
299 299
 
300 300
         if (0 < $dateInterval->y) {
301
-            $format .= $dateInterval->y . 'Y';
301
+            $format .= $dateInterval->y.'Y';
302 302
         }
303 303
 
304 304
         if (0 < $dateInterval->m) {
305
-            $format .= $dateInterval->m . 'M';
305
+            $format .= $dateInterval->m.'M';
306 306
         }
307 307
 
308 308
         if (0 < $dateInterval->d) {
309
-            $format .= $dateInterval->d . 'D';
309
+            $format .= $dateInterval->d.'D';
310 310
         }
311 311
 
312 312
         if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) {
@@ -314,15 +314,15 @@  discard block
 block discarded – undo
314 314
         }
315 315
 
316 316
         if (0 < $dateInterval->h) {
317
-            $format .= $dateInterval->h . 'H';
317
+            $format .= $dateInterval->h.'H';
318 318
         }
319 319
 
320 320
         if (0 < $dateInterval->i) {
321
-            $format .= $dateInterval->i . 'M';
321
+            $format .= $dateInterval->i.'M';
322 322
         }
323 323
 
324 324
         if (0 < $dateInterval->s) {
325
-            $format .= $dateInterval->s . 'S';
325
+            $format .= $dateInterval->s.'S';
326 326
         }
327 327
 
328 328
         if ('P' === $format) {
Please login to merge, or discard this patch.