@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | $propertyMetadata = $context->getMetadataStack()->top(); |
84 | 84 | $finalType = null; |
85 | 85 | if (null !== $propertyMetadata->unionDiscriminatorField) { |
86 | - if (!array_key_exists($propertyMetadata->unionDiscriminatorField, $data)) { |
|
86 | + if ( ! array_key_exists($propertyMetadata->unionDiscriminatorField, $data)) { |
|
87 | 87 | throw new NonVisitableTypeException("Union Discriminator Field '$propertyMetadata->unionDiscriminatorField' not found in data1"); |
88 | 88 | } |
89 | 89 | |
90 | 90 | $lkup = $data[$propertyMetadata->unionDiscriminatorField]; |
91 | - if (!empty($propertyMetadata->unionDiscriminatorMap)) { |
|
91 | + if ( ! empty($propertyMetadata->unionDiscriminatorMap)) { |
|
92 | 92 | if (array_key_exists($lkup, $propertyMetadata->unionDiscriminatorMap)) { |
93 | 93 | $finalType = [ |
94 | 94 | 'name' => $propertyMetadata->unionDiscriminatorMap[$lkup], |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $visitor->setRequireAllRequiredProperties($this->requireAllProperties); |
115 | 115 | } |
116 | 116 | |
117 | - if ($this->isPrimitiveType($possibleType['name']) && (is_array($data) || !$this->testPrimitive($data, $possibleType['name'], $context->getFormat()))) { |
|
117 | + if ($this->isPrimitiveType($possibleType['name']) && (is_array($data) || ! $this->testPrimitive($data, $possibleType['name'], $context->getFormat()))) { |
|
118 | 118 | continue; |
119 | 119 | } |
120 | 120 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $alternativeName = null; |
147 | 147 | |
148 | 148 | foreach ($type['params'] as $possibleType) { |
149 | - if ($this->isPrimitiveType($possibleType['name']) && !$this->testPrimitive($data, $possibleType['name'], $context->getFormat())) { |
|
149 | + if ($this->isPrimitiveType($possibleType['name']) && ! $this->testPrimitive($data, $possibleType['name'], $context->getFormat())) { |
|
150 | 150 | continue; |
151 | 151 | } |
152 | 152 |
@@ -61,20 +61,20 @@ discard block |
||
61 | 61 | { |
62 | 62 | $self = $this; |
63 | 63 | if ($type['params']) { |
64 | - uasort($type['params'], static function ($a, $b) use ($self) { |
|
64 | + uasort($type['params'], static function($a, $b) use ($self) { |
|
65 | 65 | if (\class_exists($a['name']) && \class_exists($b['name'])) { |
66 | 66 | $aMetadata = $self->loadMetadataForClass(new \ReflectionClass($a['name'])); |
67 | 67 | $bMetadata = $self->loadMetadataForClass(new \ReflectionClass($b['name'])); |
68 | 68 | $aRequiredPropertyCount = 0; |
69 | 69 | $bRequiredPropertyCount = 0; |
70 | 70 | foreach ($aMetadata->propertyMetadata as $propertyMetadata) { |
71 | - if ($propertyMetadata->type && !$self->allowsNull($propertyMetadata->type)) { |
|
71 | + if ($propertyMetadata->type && ! $self->allowsNull($propertyMetadata->type)) { |
|
72 | 72 | $aRequiredPropertyCount++; |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | 76 | foreach ($bMetadata->propertyMetadata as $propertyMetadata) { |
77 | - if ($propertyMetadata->type && !$self->allowsNull($propertyMetadata->type)) { |
|
77 | + if ($propertyMetadata->type && ! $self->allowsNull($propertyMetadata->type)) { |
|
78 | 78 | $bRequiredPropertyCount++; |
79 | 79 | } |
80 | 80 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | private function shouldTypeHint(?ReflectionType $reflectionType): bool |
199 | 199 | { |
200 | - if (!$reflectionType instanceof ReflectionNamedType) { |
|
200 | + if ( ! $reflectionType instanceof ReflectionNamedType) { |
|
201 | 201 | return false; |
202 | 202 | } |
203 | 203 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | private function shouldTypeHintUnion(?ReflectionType $reflectionType) |
216 | 216 | { |
217 | - if (!$reflectionType instanceof \ReflectionUnionType) { |
|
217 | + if ( ! $reflectionType instanceof \ReflectionUnionType) { |
|
218 | 218 | return false; |
219 | 219 | } |
220 | 220 |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | $metadata = $this->metadataFactory->getMetadataForClass($type['name']); |
172 | 172 | \assert($metadata instanceof ClassMetadata); |
173 | 173 | |
174 | - if ($metadata->usingExpression && !$this->expressionExclusionStrategy) { |
|
174 | + if ($metadata->usingExpression && ! $this->expressionExclusionStrategy) { |
|
175 | 175 | throw new ExpressionLanguageRequiredException(sprintf('To use conditional exclude/expose in %s you must configure the expression language.', $metadata->name)); |
176 | 176 | } |
177 | 177 | |
178 | - if (!empty($metadata->discriminatorMap) && $type['name'] === $metadata->discriminatorBaseClass) { |
|
178 | + if ( ! empty($metadata->discriminatorMap) && $type['name'] === $metadata->discriminatorBaseClass) { |
|
179 | 179 | $metadata = $this->resolveMetadata($data, $metadata); |
180 | 180 | } |
181 | 181 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $cloned = clone $propertyMetadata; |
222 | 222 | $cloned->setter = null; |
223 | 223 | $this->accessor->setValue($object, $cloned->defaultValue, $cloned, $this->context); |
224 | - } elseif (!$allowsNull && $this->visitor->getRequireAllRequiredProperties()) { |
|
224 | + } elseif ( ! $allowsNull && $this->visitor->getRequireAllRequiredProperties()) { |
|
225 | 225 | $this->visitor->endVisitingObject($metadata, $data, $type); |
226 | 226 | |
227 | 227 | throw new PropertyMissingException("Property $propertyMetadata->name is missing from data "); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | { |
266 | 266 | $typeValue = $this->visitor->visitDiscriminatorMapProperty($data, $metadata); |
267 | 267 | |
268 | - if (!isset($metadata->discriminatorMap[$typeValue])) { |
|
268 | + if ( ! isset($metadata->discriminatorMap[$typeValue])) { |
|
269 | 269 | throw new LogicException(sprintf( |
270 | 270 | 'The type value "%s" does not exist in the discriminator map of class "%s". Available types: %s', |
271 | 271 | $typeValue, |