Completed
Pull Request — master (#1219)
by Talha Zekeriya
14:36
created
src/Handler/DateHandler.php 1 patch
Spacing   +10 added lines, -10 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
 
@@ -289,15 +289,15 @@  discard block
 block discarded – undo
289 289
         $format = 'P';
290 290
 
291 291
         if (0 < $dateInterval->y) {
292
-            $format .= $dateInterval->y . 'Y';
292
+            $format .= $dateInterval->y.'Y';
293 293
         }
294 294
 
295 295
         if (0 < $dateInterval->m) {
296
-            $format .= $dateInterval->m . 'M';
296
+            $format .= $dateInterval->m.'M';
297 297
         }
298 298
 
299 299
         if (0 < $dateInterval->d) {
300
-            $format .= $dateInterval->d . 'D';
300
+            $format .= $dateInterval->d.'D';
301 301
         }
302 302
 
303 303
         if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) {
@@ -305,15 +305,15 @@  discard block
 block discarded – undo
305 305
         }
306 306
 
307 307
         if (0 < $dateInterval->h) {
308
-            $format .= $dateInterval->h . 'H';
308
+            $format .= $dateInterval->h.'H';
309 309
         }
310 310
 
311 311
         if (0 < $dateInterval->i) {
312
-            $format .= $dateInterval->i . 'M';
312
+            $format .= $dateInterval->i.'M';
313 313
         }
314 314
 
315 315
         if (0 < $dateInterval->s) {
316
-            $format .= $dateInterval->s . 'S';
316
+            $format .= $dateInterval->s.'S';
317 317
         }
318 318
 
319 319
         if ('P' === $format) {
Please login to merge, or discard this patch.
src/Type/Parser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         $this->lexer->moveNext();
38 38
 
39
-        if (!$this->lexer->token) {
39
+        if ( ! $this->lexer->token) {
40 40
             throw new SyntaxError(
41 41
                 'Syntax error, unexpected end of stream'
42 42
             );
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                 return $this->visitArrayType();
58 58
             }
59 59
             return $this->visitSimpleType();
60
-        } elseif (!$this->root && Lexer::T_ARRAY_START === $this->lexer->token['type']) {
60
+        } elseif ( ! $this->root && Lexer::T_ARRAY_START === $this->lexer->token['type']) {
61 61
             return $this->visitArrayType();
62 62
         }
63 63
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $this->match(Lexer::T_TYPE_START);
85 85
 
86 86
         $params = [];
87
-        if (!$this->lexer->isNextToken(Lexer::T_TYPE_END)) {
87
+        if ( ! $this->lexer->isNextToken(Lexer::T_TYPE_END)) {
88 88
             while (true) {
89 89
                 $params[] = $this->visit();
90 90
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
          */
110 110
 
111 111
         $params = [];
112
-        if (!$this->lexer->isNextToken(Lexer::T_ARRAY_END)) {
112
+        if ( ! $this->lexer->isNextToken(Lexer::T_ARRAY_END)) {
113 113
             while (true) {
114 114
                 $params[] = $this->visit();
115 115
                 if ($this->lexer->isNextToken(Lexer::T_ARRAY_END)) {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
     private function match(int $token): void
126 126
     {
127
-        if (!$this->lexer->lookahead) {
127
+        if ( ! $this->lexer->lookahead) {
128 128
             throw new SyntaxError(
129 129
                 sprintf('Syntax error, unexpected end of stream, expected %s', $this->getConstant($token))
130 130
             );
Please login to merge, or discard this patch.