@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function getFilters() |
21 | 21 | { |
22 | 22 | return [ |
23 | - new TwigFilter($this->serializationFunctionsPrefix . 'serialize', [SerializerRuntimeHelper::class, 'serialize']), |
|
23 | + new TwigFilter($this->serializationFunctionsPrefix.'serialize', [SerializerRuntimeHelper::class, 'serialize']), |
|
24 | 24 | ]; |
25 | 25 | } |
26 | 26 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function getFunctions() |
33 | 33 | { |
34 | 34 | return [ |
35 | - new TwigFunction($this->serializationFunctionsPrefix . 'serialization_context', '\JMS\Serializer\SerializationContext::create'), |
|
35 | + new TwigFunction($this->serializationFunctionsPrefix.'serialization_context', '\JMS\Serializer\SerializationContext::create'), |
|
36 | 36 | ]; |
37 | 37 | } |
38 | 38 | } |
@@ -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 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | $propertyMetadata = $context->getMetadataStack()->top(); |
122 | - if (!$propertyMetadata instanceof PropertyMetadata) { |
|
122 | + if ( ! $propertyMetadata instanceof PropertyMetadata) { |
|
123 | 123 | return $elements; |
124 | 124 | } |
125 | 125 | |
@@ -137,18 +137,18 @@ discard block |
||
137 | 137 | && $classMetadata->isCollectionValuedAssociation($propertyMetadata->name) |
138 | 138 | ) { |
139 | 139 | $existingCollection = $classMetadata->getFieldValue($currentObject, $propertyMetadata->name); |
140 | - if (!$existingCollection instanceof OrmPersistentCollection) { |
|
140 | + if ( ! $existingCollection instanceof OrmPersistentCollection) { |
|
141 | 141 | return $elements; |
142 | 142 | } |
143 | 143 | |
144 | 144 | foreach ($elements as $element) { |
145 | - if (!$existingCollection->contains($element)) { |
|
145 | + if ( ! $existingCollection->contains($element)) { |
|
146 | 146 | $existingCollection->add($element); |
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | 150 | foreach ($existingCollection as $collectionElement) { |
151 | - if (!$elements->contains($collectionElement)) { |
|
151 | + if ( ! $elements->contains($collectionElement)) { |
|
152 | 152 | $existingCollection->removeElement($collectionElement); |
153 | 153 | } |
154 | 154 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $relativeDepth = 0; |
29 | 29 | |
30 | 30 | foreach ($context->getMetadataStack() as $metadata) { |
31 | - if (!$metadata instanceof PropertyMetadata) { |
|
31 | + if ( ! $metadata instanceof PropertyMetadata) { |
|
32 | 32 | continue; |
33 | 33 | } |
34 | 34 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return null; |
50 | 50 | } |
51 | 51 | |
52 | - if (! is_string($data)) { |
|
52 | + if ( ! is_string($data)) { |
|
53 | 53 | throw NonVisitableTypeException::fromDataAndType($data, $type); |
54 | 54 | } |
55 | 55 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | return null; |
66 | 66 | } |
67 | 67 | |
68 | - if (! is_bool($data)) { |
|
68 | + if ( ! is_bool($data)) { |
|
69 | 69 | throw NonVisitableTypeException::fromDataAndType($data, $type); |
70 | 70 | } |
71 | 71 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | return null; |
82 | 82 | } |
83 | 83 | |
84 | - if (! is_int($data)) { |
|
84 | + if ( ! is_int($data)) { |
|
85 | 85 | throw NonVisitableTypeException::fromDataAndType($data, $type); |
86 | 86 | } |
87 | 87 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return null; |
98 | 98 | } |
99 | 99 | |
100 | - if (! is_float($data)) { |
|
100 | + if ( ! is_float($data)) { |
|
101 | 101 | throw NonVisitableTypeException::fromDataAndType($data, $type); |
102 | 102 | } |
103 | 103 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | 'direction' => GraphNavigatorInterface::DIRECTION_DESERIALIZATION, |
71 | 71 | 'format' => $format, |
72 | 72 | 'type' => $class, |
73 | - 'method' => 'deserializeUidFrom' . ucfirst($format), |
|
73 | + 'method' => 'deserializeUidFrom'.ucfirst($format), |
|
74 | 74 | ]; |
75 | 75 | } |
76 | 76 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, |
44 | 44 | 'type' => FormInterface::class, |
45 | 45 | 'format' => $format, |
46 | - 'method' => 'serializeFormTo' . ucfirst($format), |
|
46 | + 'method' => 'serializeFormTo'.ucfirst($format), |
|
47 | 47 | ]; |
48 | 48 | $methods[] = [ |
49 | 49 | 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | public function __construct(?object $translator = null, string $translationDomain = 'validators') |
59 | 59 | { |
60 | - if (null !== $translator && (!$translator instanceof TranslatorInterface && !$translator instanceof TranslatorContract)) { |
|
60 | + if (null !== $translator && ( ! $translator instanceof TranslatorInterface && ! $translator instanceof TranslatorContract)) { |
|
61 | 61 | throw new \InvalidArgumentException(sprintf( |
62 | 62 | 'The first argument passed to %s must be instance of %s or %s, %s given', |
63 | 63 | self::class, |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | protected function setDiscriminator(DoctrineClassMetadata $doctrineMetadata, ClassMetadata $classMetadata): void |
23 | 23 | { |
24 | 24 | if ( |
25 | - empty($classMetadata->discriminatorMap) && !$classMetadata->discriminatorDisabled |
|
26 | - && !empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
25 | + empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled |
|
26 | + && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
27 | 27 | ) { |
28 | 28 | $classMetadata->setDiscriminator( |
29 | 29 | $doctrineMetadata->discriminatorColumn['name'], |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy. |
52 | 52 | // On serialization, this would lead to only the supertype being serialized, and properties of subtypes |
53 | 53 | // being ignored. |
54 | - if ($targetMetadata instanceof ClassMetadataInfo && !$targetMetadata->isInheritanceTypeNone()) { |
|
54 | + if ($targetMetadata instanceof ClassMetadataInfo && ! $targetMetadata->isInheritanceTypeNone()) { |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
58 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
58 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
59 | 59 | $targetEntity = sprintf('ArrayCollection<%s>', $targetEntity); |
60 | 60 | } |
61 | 61 |