@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->addExclusionStrategy(new VersionExclusionStrategy($this->attributes['version'])); |
79 | 79 | } |
80 | 80 | |
81 | - if (!empty($this->attributes['max_depth_checks'])) { |
|
81 | + if ( ! empty($this->attributes['max_depth_checks'])) { |
|
82 | 82 | $this->addExclusionStrategy(new DepthExclusionStrategy()); |
83 | 83 | } |
84 | 84 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | final protected function assertMutable(): void |
135 | 135 | { |
136 | - if (!$this->initialized) { |
|
136 | + if ( ! $this->initialized) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | { |
223 | 223 | $metadata = $this->metadataStack->pop(); |
224 | 224 | |
225 | - if (!$metadata instanceof PropertyMetadata) { |
|
225 | + if ( ! $metadata instanceof PropertyMetadata) { |
|
226 | 226 | throw new RuntimeException('Context metadataStack not working well'); |
227 | 227 | } |
228 | 228 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | { |
232 | 232 | $metadata = $this->metadataStack->pop(); |
233 | 233 | |
234 | - if (!$metadata instanceof ClassMetadata) { |
|
234 | + if ( ! $metadata instanceof ClassMetadata) { |
|
235 | 235 | throw new RuntimeException('Context metadataStack not working well'); |
236 | 236 | } |
237 | 237 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | public function getCurrentPath(): array |
245 | 245 | { |
246 | - if (!$this->metadataStack) { |
|
246 | + if ( ! $this->metadataStack) { |
|
247 | 247 | return []; |
248 | 248 | } |
249 | 249 |
@@ -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 | |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | $cloned = clone $propertyMetadata; |
221 | 221 | $cloned->setter = null; |
222 | 222 | $this->accessor->setValue($object, $cloned->defaultValue, $cloned, $this->context); |
223 | - } elseif (!$allowsNull && $this->context->getRequireAllRequiredProperties()) { |
|
224 | - throw new PropertyMissingException('Property ' . $propertyMetadata->name . ' is missing from data'); |
|
223 | + } elseif ( ! $allowsNull && $this->context->getRequireAllRequiredProperties()) { |
|
224 | + throw new PropertyMissingException('Property '.$propertyMetadata->name.' is missing from data'); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | { |
243 | 243 | $typeValue = $this->visitor->visitDiscriminatorMapProperty($data, $metadata); |
244 | 244 | |
245 | - if (!isset($metadata->discriminatorMap[$typeValue])) { |
|
245 | + if ( ! isset($metadata->discriminatorMap[$typeValue])) { |
|
246 | 246 | throw new LogicException(sprintf( |
247 | 247 | 'The type value "%s" does not exist in the discriminator map of class "%s". Available types: %s', |
248 | 248 | $typeValue, |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | private function reorderTypes(array $types): array |
61 | 61 | { |
62 | - uasort($types, static function ($a, $b) { |
|
62 | + uasort($types, static function($a, $b) { |
|
63 | 63 | $order = ['null' => 0, 'true' => 1, 'false' => 2, 'bool' => 3, 'int' => 4, 'float' => 5, 'string' => 6]; |
64 | 64 | |
65 | 65 | return ($order[$a['name']] ?? 7) <=> ($order[$b['name']] ?? 7); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | private function shouldTypeHint(?ReflectionType $reflectionType): bool |
152 | 152 | { |
153 | - if (!$reflectionType instanceof ReflectionNamedType) { |
|
153 | + if ( ! $reflectionType instanceof ReflectionNamedType) { |
|
154 | 154 | return false; |
155 | 155 | } |
156 | 156 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | private function shouldTypeHintUnion(?ReflectionType $reflectionType) |
169 | 169 | { |
170 | - if (!$reflectionType instanceof \ReflectionUnionType) { |
|
170 | + if ( ! $reflectionType instanceof \ReflectionUnionType) { |
|
171 | 171 | return false; |
172 | 172 | } |
173 | 173 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | private function matchSimpleType(mixed $data, array $type, Context $context): mixed |
100 | 100 | { |
101 | 101 | foreach ($type['params'][0] as $possibleType) { |
102 | - if ($this->isPrimitiveType($possibleType['name']) && !$this->testPrimitive($data, $possibleType['name'], $context->getFormat())) { |
|
102 | + if ($this->isPrimitiveType($possibleType['name']) && ! $this->testPrimitive($data, $possibleType['name'], $context->getFormat())) { |
|
103 | 103 | continue; |
104 | 104 | } |
105 | 105 |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | { |
21 | 21 | assert($doctrineMetadata instanceof ORMClassMetadata || $doctrineMetadata instanceof ODMClassMetadata); |
22 | 22 | if ( |
23 | - empty($classMetadata->discriminatorMap) && !$classMetadata->discriminatorDisabled |
|
24 | - && !empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
23 | + empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled |
|
24 | + && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
25 | 25 | ) { |
26 | 26 | $classMetadata->setDiscriminator( |
27 | 27 | $doctrineMetadata->discriminatorColumn['name'], |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy. |
50 | 50 | // On serialization, this would lead to only the supertype being serialized, and properties of subtypes |
51 | 51 | // being ignored. |
52 | - if ($targetMetadata instanceof ODMClassMetadata && !$targetMetadata->isInheritanceTypeNone()) { |
|
52 | + if ($targetMetadata instanceof ODMClassMetadata && ! $targetMetadata->isInheritanceTypeNone()) { |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
56 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
56 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
57 | 57 | $targetEntity = sprintf('ArrayCollection<%s>', $targetEntity); |
58 | 58 | } |
59 | 59 |