@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | $driver = new AnnotationDriver($annotationReader, $this->propertyNamingStrategy, $this->typeParser); |
52 | 52 | |
53 | - if (!empty($metadataDirs)) { |
|
53 | + if ( ! empty($metadataDirs)) { |
|
54 | 54 | $fileLocator = new FileLocator($metadataDirs); |
55 | 55 | $driver = new DriverChain([ |
56 | 56 | new YamlDriver($fileLocator, $this->propertyNamingStrategy, $this->typeParser, $this->expressionEvaluator), |
@@ -47,7 +47,7 @@ discard block |
||
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 |
||
55 | 55 | 'type' => \DateTimeInterface::class, |
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 | $methods[] = [ |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | private function parseDateTime($data, array $type, bool $immutable = false): \DateTimeInterface |
233 | 233 | { |
234 | - $timezone = !empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone; |
|
234 | + $timezone = ! empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone; |
|
235 | 235 | $formats = $this->getDeserializationFormats($type); |
236 | 236 | |
237 | 237 | $formatTried = []; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | throw new RuntimeException(sprintf( |
257 | 257 | 'Invalid datetime "%s", expected one of the format %s.', |
258 | 258 | $data, |
259 | - '"' . implode('", "', $formatTried) . '"' |
|
259 | + '"'.implode('", "', $formatTried).'"' |
|
260 | 260 | )); |
261 | 261 | } |
262 | 262 | |
@@ -304,15 +304,15 @@ discard block |
||
304 | 304 | $format = 'P'; |
305 | 305 | |
306 | 306 | if (0 < $dateInterval->y) { |
307 | - $format .= $dateInterval->y . 'Y'; |
|
307 | + $format .= $dateInterval->y.'Y'; |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | if (0 < $dateInterval->m) { |
311 | - $format .= $dateInterval->m . 'M'; |
|
311 | + $format .= $dateInterval->m.'M'; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | if (0 < $dateInterval->d) { |
315 | - $format .= $dateInterval->d . 'D'; |
|
315 | + $format .= $dateInterval->d.'D'; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) { |
@@ -320,15 +320,15 @@ discard block |
||
320 | 320 | } |
321 | 321 | |
322 | 322 | if (0 < $dateInterval->h) { |
323 | - $format .= $dateInterval->h . 'H'; |
|
323 | + $format .= $dateInterval->h.'H'; |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | if (0 < $dateInterval->i) { |
327 | - $format .= $dateInterval->i . 'M'; |
|
327 | + $format .= $dateInterval->i.'M'; |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | if (0 < $dateInterval->s) { |
331 | - $format .= $dateInterval->s . 'S'; |
|
331 | + $format .= $dateInterval->s.'S'; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | if ('P' === $format) { |
@@ -25,7 +25,7 @@ |
||
25 | 25 | All the other cases should work as expected. |
26 | 26 | The alternative here is to use the explicit syntax Groups(groups=['value' => '...']) |
27 | 27 | */ |
28 | - if (count($values) > 0 && ((!isset($values['value']) && !isset($values['groups'])) || count($values) > 1) && 0 === count($groups)) { |
|
28 | + if (count($values) > 0 && (( ! isset($values['value']) && ! isset($values['groups'])) || count($values) > 1) && 0 === count($groups)) { |
|
29 | 29 | $vars['groups'] = $values; |
30 | 30 | $vars['values'] = []; |
31 | 31 | } |
@@ -57,9 +57,9 @@ |
||
57 | 57 | { |
58 | 58 | $path = implode('.', $this->getCurrentPath()); |
59 | 59 | if (isset($this->persistentCollections[$path])) { |
60 | - $return = $this->persistentCollections[$path]; |
|
61 | - unset($this->persistentCollections[$path]); |
|
62 | - return $return; |
|
60 | + $return = $this->persistentCollections[$path]; |
|
61 | + unset($this->persistentCollections[$path]); |
|
62 | + return $return; |
|
63 | 63 | } |
64 | 64 | return null; |
65 | 65 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | // Locate possible ObjectManager |
69 | 69 | $objectManager = $this->managerRegistry->getManagerForClass($metadata->name); |
70 | 70 | |
71 | - if (!$objectManager) { |
|
71 | + if ( ! $objectManager) { |
|
72 | 72 | // No ObjectManager found, proceed with normal deserialization |
73 | 73 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
74 | 74 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | // Managed entity, check for proxy load |
85 | - if (!is_array($data) && !(is_object($data) && 'SimpleXMLElement' === get_class($data))) { |
|
85 | + if ( ! is_array($data) && ! (is_object($data) && 'SimpleXMLElement' === get_class($data))) { |
|
86 | 86 | // Single identifier, load proxy |
87 | 87 | return $objectManager->getReference($metadata->name, $data); |
88 | 88 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | foreach ($classMetadata->getIdentifierFieldNames() as $name) { |
95 | 95 | // Avoid calling objectManager->find if some identification properties are excluded |
96 | - if (!isset($metadata->propertyMetadata[$name])) { |
|
96 | + if ( ! isset($metadata->propertyMetadata[$name])) { |
|
97 | 97 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
98 | 98 | } |
99 | 99 | |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
105 | 105 | } |
106 | 106 | |
107 | - if (is_array($data) && !array_key_exists($propertyMetadata->serializedName, $data)) { |
|
107 | + if (is_array($data) && ! array_key_exists($propertyMetadata->serializedName, $data)) { |
|
108 | 108 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
109 | - } elseif (is_object($data) && !property_exists($data, $propertyMetadata->serializedName)) { |
|
109 | + } elseif (is_object($data) && ! property_exists($data, $propertyMetadata->serializedName)) { |
|
110 | 110 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
111 | 111 | } |
112 | 112 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $reflectionProperty = $classMetadata->getReflectionClass()->getProperty($associationName); |
153 | 153 | $reflectionProperty->setAccessible(true); |
154 | 154 | $collection = $reflectionProperty->getValue($object); |
155 | - if (!$collection instanceof PersistentCollection) { |
|
155 | + if ( ! $collection instanceof PersistentCollection) { |
|
156 | 156 | continue; |
157 | 157 | } |
158 | 158 | $associationPath = $path; |
@@ -102,9 +102,9 @@ |
||
102 | 102 | |
103 | 103 | if ($collection = $context->removePersistentCollectionForCurrentPath()) { |
104 | 104 | foreach ($elements as $element) { |
105 | - if (!$collection->contains($element)) { |
|
106 | - $collection->add($element); |
|
107 | - } |
|
105 | + if (!$collection->contains($element)) { |
|
106 | + $collection->add($element); |
|
107 | + } |
|
108 | 108 | } |
109 | 109 | foreach ($collection as $collectionElement) { |
110 | 110 | if (!$elements->contains($collectionElement)) { |
@@ -102,12 +102,12 @@ |
||
102 | 102 | |
103 | 103 | if ($collection = $context->removePersistentCollectionForCurrentPath()) { |
104 | 104 | foreach ($elements as $element) { |
105 | - if (!$collection->contains($element)) { |
|
105 | + if ( ! $collection->contains($element)) { |
|
106 | 106 | $collection->add($element); |
107 | 107 | } |
108 | 108 | } |
109 | 109 | foreach ($collection as $collectionElement) { |
110 | - if (!$elements->contains($collectionElement)) { |
|
110 | + if ( ! $elements->contains($collectionElement)) { |
|
111 | 111 | $collection->removeElement($collectionElement); |
112 | 112 | } |
113 | 113 | } |