@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | 'type' => $type, |
| 52 | 52 | 'format' => $format, |
| 53 | 53 | 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, |
| 54 | - 'method' => 'serialize' . $type, |
|
| 54 | + 'method' => 'serialize'.$type, |
|
| 55 | 55 | ]; |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | private function parseDateTime($data, array $type, bool $immutable = false): \DateTimeInterface |
| 231 | 231 | { |
| 232 | - $timezone = !empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone; |
|
| 232 | + $timezone = ! empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone; |
|
| 233 | 233 | $formats = $this->getDeserializationFormats($type); |
| 234 | 234 | |
| 235 | 235 | $formatTried = []; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | throw new RuntimeException(sprintf( |
| 255 | 255 | 'Invalid datetime "%s", expected one of the format %s.', |
| 256 | 256 | $data, |
| 257 | - '"' . implode('", "', $formatTried) . '"' |
|
| 257 | + '"'.implode('", "', $formatTried).'"' |
|
| 258 | 258 | )); |
| 259 | 259 | } |
| 260 | 260 | |
@@ -300,15 +300,15 @@ discard block |
||
| 300 | 300 | $format = 'P'; |
| 301 | 301 | |
| 302 | 302 | if (0 < $dateInterval->y) { |
| 303 | - $format .= $dateInterval->y . 'Y'; |
|
| 303 | + $format .= $dateInterval->y.'Y'; |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | if (0 < $dateInterval->m) { |
| 307 | - $format .= $dateInterval->m . 'M'; |
|
| 307 | + $format .= $dateInterval->m.'M'; |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | if (0 < $dateInterval->d) { |
| 311 | - $format .= $dateInterval->d . 'D'; |
|
| 311 | + $format .= $dateInterval->d.'D'; |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) { |
@@ -316,15 +316,15 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | if (0 < $dateInterval->h) { |
| 319 | - $format .= $dateInterval->h . 'H'; |
|
| 319 | + $format .= $dateInterval->h.'H'; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | if (0 < $dateInterval->i) { |
| 323 | - $format .= $dateInterval->i . 'M'; |
|
| 323 | + $format .= $dateInterval->i.'M'; |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | if (0 < $dateInterval->s) { |
| 327 | - $format .= $dateInterval->s . 'S'; |
|
| 327 | + $format .= $dateInterval->s.'S'; |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | if ('P' === $format) { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $tokenNode = $element->getChild(0); |
| 38 | 38 | |
| 39 | - if (!$tokenNode->isToken()) { |
|
| 39 | + if ( ! $tokenNode->isToken()) { |
|
| 40 | 40 | return $tokenNode->accept($this); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | return $value; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - return str_replace($escapeChar . $escapeChar, $escapeChar, $value); |
|
| 68 | + return str_replace($escapeChar.$escapeChar, $escapeChar, $value); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | private function visitCompoundType(TreeNode $element, ?int &$handle, ?int $eldnah): array |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | return [ |
| 77 | 77 | 'name' => $nameToken->getValueValue(), |
| 78 | 78 | 'params' => array_map( |
| 79 | - function (TreeNode $node) use ($handle, $eldnah) { |
|
| 79 | + function(TreeNode $node) use ($handle, $eldnah) { |
|
| 80 | 80 | return $node->accept($this, $handle, $eldnah); |
| 81 | 81 | }, |
| 82 | 82 | $parameters |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | private function visitArrayType(TreeNode $node, ?int &$handle, ?int $eldnah): array |
| 88 | 88 | { |
| 89 | 89 | return array_map( |
| 90 | - function (TreeNode $child) { |
|
| 90 | + function(TreeNode $child) { |
|
| 91 | 91 | return $child->accept($this); |
| 92 | 92 | }, |
| 93 | 93 | $node->getChildren() |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $this->addExclusionStrategy(new VersionExclusionStrategy($this->attributes['version'])); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - if (!empty($this->attributes['max_depth_checks'])) { |
|
| 82 | + if ( ! empty($this->attributes['max_depth_checks'])) { |
|
| 83 | 83 | $this->addExclusionStrategy(new DepthExclusionStrategy()); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | final protected function assertMutable(): void |
| 134 | 134 | { |
| 135 | - if (!$this->initialized) { |
|
| 135 | + if ( ! $this->initialized) { |
|
| 136 | 136 | return; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | { |
| 209 | 209 | $metadata = $this->metadataStack->pop(); |
| 210 | 210 | |
| 211 | - if (!$metadata instanceof PropertyMetadata) { |
|
| 211 | + if ( ! $metadata instanceof PropertyMetadata) { |
|
| 212 | 212 | throw new RuntimeException('Context metadataStack not working well'); |
| 213 | 213 | } |
| 214 | 214 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | { |
| 218 | 218 | $metadata = $this->metadataStack->pop(); |
| 219 | 219 | |
| 220 | - if (!$metadata instanceof ClassMetadata) { |
|
| 220 | + if ( ! $metadata instanceof ClassMetadata) { |
|
| 221 | 221 | throw new RuntimeException('Context metadataStack not working well'); |
| 222 | 222 | } |
| 223 | 223 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | public function getCurrentPath(): array |
| 234 | 234 | { |
| 235 | - if (!$this->metadataStack) { |
|
| 235 | + if ( ! $this->metadataStack) { |
|
| 236 | 236 | return []; |
| 237 | 237 | } |
| 238 | 238 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | throw new NonStringCastableTypeException($value); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if (is_object($value) && !method_exists($value, '__toString')) { |
|
| 59 | + if (is_object($value) && ! method_exists($value, '__toString')) { |
|
| 60 | 60 | throw new NonStringCastableTypeException($value); |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | protected function assertValueCanBeCastToInt($value): void |
| 71 | 71 | { |
| 72 | - if (is_object($value) && !$value instanceof \SimpleXMLElement) { |
|
| 72 | + if (is_object($value) && ! $value instanceof \SimpleXMLElement) { |
|
| 73 | 73 | throw new NonIntCastableTypeException($value); |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | protected function assertValueCanCastToFloat($value): void |
| 84 | 84 | { |
| 85 | - if (is_object($value) && !$value instanceof \SimpleXMLElement) { |
|
| 85 | + if (is_object($value) && ! $value instanceof \SimpleXMLElement) { |
|
| 86 | 86 | throw new NonFloatCastableTypeException($value); |
| 87 | 87 | } |
| 88 | 88 | } |