@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $this->addExclusionStrategy(new VersionExclusionStrategy($this->attributes['version'])); |
69 | 69 | } |
70 | 70 | |
71 | - if (!empty($this->attributes['max_depth_checks'])) { |
|
71 | + if ( ! empty($this->attributes['max_depth_checks'])) { |
|
72 | 72 | $this->addExclusionStrategy(new DepthExclusionStrategy()); |
73 | 73 | } |
74 | 74 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | private function assertMutable(): void |
117 | 117 | { |
118 | - if (!$this->initialized) { |
|
118 | + if ( ! $this->initialized) { |
|
119 | 119 | return; |
120 | 120 | } |
121 | 121 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | $metadata = $this->metadataStack->pop(); |
213 | 213 | |
214 | - if (!$metadata instanceof PropertyMetadata) { |
|
214 | + if ( ! $metadata instanceof PropertyMetadata) { |
|
215 | 215 | throw new RuntimeException('Context metadataStack not working well'); |
216 | 216 | } |
217 | 217 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | { |
221 | 221 | $metadata = $this->metadataStack->pop(); |
222 | 222 | |
223 | - if (!$metadata instanceof ClassMetadata) { |
|
223 | + if ( ! $metadata instanceof ClassMetadata) { |
|
224 | 224 | throw new RuntimeException('Context metadataStack not working well'); |
225 | 225 | } |
226 | 226 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function getCurrentPath(): array |
237 | 237 | { |
238 | - if (!$this->metadataStack) { |
|
238 | + if ( ! $this->metadataStack) { |
|
239 | 239 | return []; |
240 | 240 | } |
241 | 241 |
@@ -41,13 +41,13 @@ |
||
41 | 41 | */ |
42 | 42 | public function evaluate(string $expression, array $data = []) |
43 | 43 | { |
44 | - if (!is_string($expression)) { |
|
44 | + if ( ! is_string($expression)) { |
|
45 | 45 | return $expression; |
46 | 46 | } |
47 | 47 | |
48 | 48 | $context = $data + $this->context; |
49 | 49 | |
50 | - if (!array_key_exists($expression, $this->cache)) { |
|
50 | + if ( ! array_key_exists($expression, $this->cache)) { |
|
51 | 51 | $this->cache[$expression] = $this->expressionLanguage->parse($expression, array_keys($context)); |
52 | 52 | } |
53 | 53 |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | private function getAccessorStrategy(): AccessorStrategyInterface |
120 | 120 | { |
121 | - if (!$this->accessorStrategy) { |
|
121 | + if ( ! $this->accessorStrategy) { |
|
122 | 122 | $this->accessorStrategy = new DefaultAccessorStrategy($this->expressionEvaluator); |
123 | 123 | } |
124 | 124 | return $this->accessorStrategy; |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | |
155 | 155 | public function setCacheDir(string $dir): self |
156 | 156 | { |
157 | - if (!is_dir($dir)) { |
|
157 | + if ( ! is_dir($dir)) { |
|
158 | 158 | $this->createDir($dir); |
159 | 159 | } |
160 | - if (!is_writable($dir)) { |
|
160 | + if ( ! is_writable($dir)) { |
|
161 | 161 | throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir)); |
162 | 162 | } |
163 | 163 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | public function setMetadataDirs(array $namespacePrefixToDirMap): self |
279 | 279 | { |
280 | 280 | foreach ($namespacePrefixToDirMap as $dir) { |
281 | - if (!is_dir($dir)) { |
|
281 | + if ( ! is_dir($dir)) { |
|
282 | 282 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
283 | 283 | } |
284 | 284 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | */ |
317 | 317 | public function addMetadataDir(string $dir, string $namespacePrefix = ''): self |
318 | 318 | { |
319 | - if (!is_dir($dir)) { |
|
319 | + if ( ! is_dir($dir)) { |
|
320 | 320 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
321 | 321 | } |
322 | 322 | |
@@ -356,11 +356,11 @@ discard block |
||
356 | 356 | */ |
357 | 357 | public function replaceMetadataDir(string $dir, string $namespacePrefix = ''): self |
358 | 358 | { |
359 | - if (!is_dir($dir)) { |
|
359 | + if ( ! is_dir($dir)) { |
|
360 | 360 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
361 | 361 | } |
362 | 362 | |
363 | - if (!isset($this->metadataDirs[$namespacePrefix])) { |
|
363 | + if ( ! isset($this->metadataDirs[$namespacePrefix])) { |
|
364 | 364 | throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix)); |
365 | 365 | } |
366 | 366 | |
@@ -427,8 +427,8 @@ discard block |
||
427 | 427 | $annotationReader = new AnnotationReader(); |
428 | 428 | |
429 | 429 | if (null !== $this->cacheDir) { |
430 | - $this->createDir($this->cacheDir . '/annotations'); |
|
431 | - $annotationsCache = new FilesystemCache($this->cacheDir . '/annotations'); |
|
430 | + $this->createDir($this->cacheDir.'/annotations'); |
|
431 | + $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations'); |
|
432 | 432 | $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug); |
433 | 433 | } |
434 | 434 | } |
@@ -446,19 +446,19 @@ discard block |
||
446 | 446 | if ($this->metadataCache !== null) { |
447 | 447 | $metadataFactory->setCache($this->metadataCache); |
448 | 448 | } elseif (null !== $this->cacheDir) { |
449 | - $this->createDir($this->cacheDir . '/metadata'); |
|
450 | - $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata')); |
|
449 | + $this->createDir($this->cacheDir.'/metadata'); |
|
450 | + $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata')); |
|
451 | 451 | } |
452 | 452 | |
453 | - if (!$this->handlersConfigured) { |
|
453 | + if ( ! $this->handlersConfigured) { |
|
454 | 454 | $this->addDefaultHandlers(); |
455 | 455 | } |
456 | 456 | |
457 | - if (!$this->listenersConfigured) { |
|
457 | + if ( ! $this->listenersConfigured) { |
|
458 | 458 | $this->addDefaultListeners(); |
459 | 459 | } |
460 | 460 | |
461 | - if (!$this->visitorsAdded) { |
|
461 | + if ( ! $this->visitorsAdded) { |
|
462 | 462 | $this->addDefaultSerializationVisitors(); |
463 | 463 | $this->addDefaultDeserializationVisitors(); |
464 | 464 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | |
68 | 68 | public function visitArray($data, array $type): array |
69 | 69 | { |
70 | - if (!is_array($data)) { |
|
70 | + if ( ! is_array($data)) { |
|
71 | 71 | throw new RuntimeException(sprintf('Expected array, but got %s: %s', gettype($data), json_encode($data))); |
72 | 72 | } |
73 | 73 | |
74 | 74 | // If no further parameters were given, keys/values are just passed as is. |
75 | - if (!$type['params']) { |
|
75 | + if ( ! $type['params']) { |
|
76 | 76 | return $data; |
77 | 77 | } |
78 | 78 | |
@@ -130,15 +130,15 @@ discard block |
||
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
133 | - if (!is_array($data)) { |
|
133 | + if ( ! is_array($data)) { |
|
134 | 134 | throw new RuntimeException(sprintf('Invalid data %s (%s), expected "%s".', json_encode($data), $metadata->type['name'], $metadata->class)); |
135 | 135 | } |
136 | 136 | |
137 | - if (!array_key_exists($name, $data)) { |
|
137 | + if ( ! array_key_exists($name, $data)) { |
|
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
141 | - if (!$metadata->type) { |
|
141 | + if ( ! $metadata->type) { |
|
142 | 142 | throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->class, $metadata->name)); |
143 | 143 | } |
144 | 144 |
@@ -70,22 +70,22 @@ discard block |
||
70 | 70 | $class = $this->getReflection()->getDeclaringClass(); |
71 | 71 | |
72 | 72 | if (empty($getter)) { |
73 | - if ($class->hasMethod('get' . $this->name) && $class->getMethod('get' . $this->name)->isPublic()) { |
|
74 | - $getter = 'get' . $this->name; |
|
75 | - } elseif ($class->hasMethod('is' . $this->name) && $class->getMethod('is' . $this->name)->isPublic()) { |
|
76 | - $getter = 'is' . $this->name; |
|
77 | - } elseif ($class->hasMethod('has' . $this->name) && $class->getMethod('has' . $this->name)->isPublic()) { |
|
78 | - $getter = 'has' . $this->name; |
|
73 | + if ($class->hasMethod('get'.$this->name) && $class->getMethod('get'.$this->name)->isPublic()) { |
|
74 | + $getter = 'get'.$this->name; |
|
75 | + } elseif ($class->hasMethod('is'.$this->name) && $class->getMethod('is'.$this->name)->isPublic()) { |
|
76 | + $getter = 'is'.$this->name; |
|
77 | + } elseif ($class->hasMethod('has'.$this->name) && $class->getMethod('has'.$this->name)->isPublic()) { |
|
78 | + $getter = 'has'.$this->name; |
|
79 | 79 | } else { |
80 | - throw new InvalidMetadataException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get' . ucfirst($this->name), 'is' . ucfirst($this->name), 'has' . ucfirst($this->name), $this->class, $this->name)); |
|
80 | + throw new InvalidMetadataException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get'.ucfirst($this->name), 'is'.ucfirst($this->name), 'has'.ucfirst($this->name), $this->class, $this->name)); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | - if (empty($setter) && !$this->readOnly) { |
|
85 | - if ($class->hasMethod('set' . $this->name) && $class->getMethod('set' . $this->name)->isPublic()) { |
|
86 | - $setter = 'set' . $this->name; |
|
84 | + if (empty($setter) && ! $this->readOnly) { |
|
85 | + if ($class->hasMethod('set'.$this->name) && $class->getMethod('set'.$this->name)->isPublic()) { |
|
86 | + $setter = 'set'.$this->name; |
|
87 | 87 | } else { |
88 | - throw new InvalidMetadataException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set' . ucfirst($this->name), $this->class, $this->name)); |
|
88 | + throw new InvalidMetadataException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set'.ucfirst($this->name), $this->class, $this->name)); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | return is_array($type) |
105 | 105 | && $type['name'] === 'array' |
106 | 106 | && isset($type['params'][0]) |
107 | - && !isset($type['params'][1]); |
|
107 | + && ! isset($type['params'][1]); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | public static function isCollectionMap(?array $type = null): bool |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $this->xmlAttributeMap, |
173 | 173 | $this->maxDepth, |
174 | 174 | $parentStr |
175 | - ) = $unserialized; |
|
175 | + ) = $unserialized; |
|
176 | 176 | |
177 | 177 | if (isset($unserialized['xmlEntryNamespace'])) { |
178 | 178 | $this->xmlEntryNamespace = $unserialized['xmlEntryNamespace']; |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function setAccessorOrder(string $order, array $customOrder = []): void |
109 | 109 | { |
110 | - if (!in_array($order, [self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM], true)) { |
|
110 | + if ( ! in_array($order, [self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM], true)) { |
|
111 | 111 | throw new InvalidMetadataException(sprintf('The accessor order "%s" is invalid.', $order)); |
112 | 112 | } |
113 | 113 | |
114 | 114 | foreach ($customOrder as $name) { |
115 | - if (!is_string($name)) { |
|
115 | + if ( ! is_string($name)) { |
|
116 | 116 | throw new InvalidMetadataException(sprintf('$customOrder is expected to be a list of strings, but got element of value %s.', json_encode($name))); |
117 | 117 | } |
118 | 118 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | public function merge(MergeableInterface $object): void |
150 | 150 | { |
151 | - if (!$object instanceof ClassMetadata) { |
|
151 | + if ( ! $object instanceof ClassMetadata) { |
|
152 | 152 | throw new InvalidMetadataException('$object must be an instance of ClassMetadata.'); |
153 | 153 | } |
154 | 154 | parent::merge($object); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $this->discriminatorBaseClass, |
173 | 173 | $this->discriminatorBaseClass |
174 | 174 | )); |
175 | - } elseif (!$this->discriminatorFieldName && $object->discriminatorFieldName) { |
|
175 | + } elseif ( ! $this->discriminatorFieldName && $object->discriminatorFieldName) { |
|
176 | 176 | $this->discriminatorFieldName = $object->discriminatorFieldName; |
177 | 177 | $this->discriminatorMap = $object->discriminatorMap; |
178 | 178 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->discriminatorBaseClass = $object->discriminatorBaseClass; |
188 | 188 | } |
189 | 189 | |
190 | - if ($this->discriminatorMap && !$this->getReflection()->isAbstract()) { |
|
190 | + if ($this->discriminatorMap && ! $this->getReflection()->isAbstract()) { |
|
191 | 191 | if (false === $typeValue = array_search($this->name, $this->discriminatorMap, true)) { |
192 | 192 | throw new InvalidMetadataException(sprintf( |
193 | 193 | 'The sub-class "%s" is not listed in the discriminator of the base class "%s".', |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $this->discriminatorValue = $typeValue; |
200 | 200 | |
201 | 201 | if (isset($this->propertyMetadata[$this->discriminatorFieldName]) |
202 | - && !$this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata |
|
202 | + && ! $this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata |
|
203 | 203 | ) { |
204 | 204 | throw new InvalidMetadataException(sprintf( |
205 | 205 | 'The discriminator field name "%s" of the base-class "%s" conflicts with a regular property of the sub-class "%s".', |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | )); |
210 | 210 | } |
211 | 211 | |
212 | - $discriminatorProperty = new StaticPropertyMetadata( |
|
212 | + $discriminatorProperty = new StaticPropertyMetadata( |
|
213 | 213 | $this->name, |
214 | 214 | $this->discriminatorFieldName, |
215 | 215 | $typeValue, |
@@ -227,12 +227,12 @@ discard block |
||
227 | 227 | |
228 | 228 | public function registerNamespace(string $uri, ?string $prefix = null): void |
229 | 229 | { |
230 | - if (!is_string($uri)) { |
|
230 | + if ( ! is_string($uri)) { |
|
231 | 231 | throw new InvalidMetadataException(sprintf('$uri is expected to be a strings, but got value %s.', json_encode($uri))); |
232 | 232 | } |
233 | 233 | |
234 | 234 | if ($prefix !== null) { |
235 | - if (!is_string($prefix)) { |
|
235 | + if ( ! is_string($prefix)) { |
|
236 | 236 | throw new InvalidMetadataException(sprintf('$prefix is expected to be a strings, but got value %s.', json_encode($prefix))); |
237 | 237 | } |
238 | 238 | } else { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | - if (!$excludeAll) { |
|
138 | + if ( ! $excludeAll) { |
|
139 | 139 | foreach ($class->getProperties() as $property) { |
140 | 140 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
141 | 141 | continue; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } elseif ($annot instanceof Expose) { |
167 | 167 | $isExpose = true; |
168 | 168 | if (null !== $annot->if) { |
169 | - $propertyMetadata->excludeIf = '!(' . $annot->if . ')'; |
|
169 | + $propertyMetadata->excludeIf = '!('.$annot->if.')'; |
|
170 | 170 | } |
171 | 171 | } elseif ($annot instanceof Exclude) { |
172 | 172 | if (null !== $annot->if) { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | throw new InvalidMetadataException(sprintf( |
216 | 216 | 'Invalid group name "%s" on "%s", did you mean to create multiple groups?', |
217 | 217 | implode(', ', $propertyMetadata->groups), |
218 | - $propertyMetadata->class . '->' . $propertyMetadata->name |
|
218 | + $propertyMetadata->class.'->'.$propertyMetadata->name |
|
219 | 219 | )); |
220 | 220 | } |
221 | 221 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
240 | - if (!$propertyMetadata->serializedName) { |
|
240 | + if ( ! $propertyMetadata->serializedName) { |
|
241 | 241 | $propertyMetadata->serializedName = $this->namingStrategy->translateName($propertyMetadata); |
242 | 242 | } |
243 | 243 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | } |
249 | 249 | |
250 | - if ((ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude) |
|
250 | + if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude) |
|
251 | 251 | || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose) |
252 | 252 | ) { |
253 | 253 | $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $classMetadata = $this->delegate->loadMetadataForClass($class); |
69 | 69 | |
70 | 70 | // Abort if the given class is not a mapped entity |
71 | - if (!$doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) { |
|
71 | + if ( ! $doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) { |
|
72 | 72 | return $classMetadata; |
73 | 73 | } |
74 | 74 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | protected function tryLoadingDoctrineMetadata(string $className): ?DoctrineClassMetadata |
118 | 118 | { |
119 | - if (!$manager = $this->registry->getManagerForClass($className)) { |
|
119 | + if ( ! $manager = $this->registry->getManagerForClass($className)) { |
|
120 | 120 | return null; |
121 | 121 | } |
122 | 122 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | protected function normalizeFieldType($type): ?string |
131 | 131 | { |
132 | - if (!isset($this->fieldMapping[$type])) { |
|
132 | + if ( ! isset($this->fieldMapping[$type])) { |
|
133 | 133 | return null; |
134 | 134 | } |
135 | 135 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $config = Yaml::parse(file_get_contents($file)); |
44 | 44 | |
45 | - if (!isset($config[$name = $class->name])) { |
|
45 | + if ( ! isset($config[$name = $class->name])) { |
|
46 | 46 | throw new InvalidMetadataException(sprintf('Expected metadata for class %s to be defined in %s.', $class->name, $file)); |
47 | 47 | } |
48 | 48 | |
@@ -63,20 +63,20 @@ discard block |
||
63 | 63 | $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $methodName, $propertySettings['exp']); |
64 | 64 | unset($propertySettings['exp']); |
65 | 65 | } else { |
66 | - if (!$class->hasMethod($methodName)) { |
|
67 | - throw new InvalidMetadataException('The method ' . $methodName . ' not found in class ' . $class->name); |
|
66 | + if ( ! $class->hasMethod($methodName)) { |
|
67 | + throw new InvalidMetadataException('The method '.$methodName.' not found in class '.$class->name); |
|
68 | 68 | } |
69 | 69 | $virtualPropertyMetadata = new VirtualPropertyMetadata($name, $methodName); |
70 | 70 | } |
71 | 71 | |
72 | - $pName = !empty($propertySettings['name']) ? $propertySettings['name'] : $virtualPropertyMetadata->name; |
|
72 | + $pName = ! empty($propertySettings['name']) ? $propertySettings['name'] : $virtualPropertyMetadata->name; |
|
73 | 73 | |
74 | 74 | $propertiesMetadata[$pName] = $virtualPropertyMetadata; |
75 | 75 | $config['properties'][$pName] = $propertySettings; |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | - if (!$excludeAll) { |
|
79 | + if ( ! $excludeAll) { |
|
80 | 80 | foreach ($class->getProperties() as $property) { |
81 | 81 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
82 | 82 | continue; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | if (isset($pConfig['expose_if'])) { |
127 | - $pMetadata->excludeIf = '!(' . $pConfig['expose_if'] . ')'; |
|
127 | + $pMetadata->excludeIf = '!('.$pConfig['expose_if'].')'; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | if (isset($pConfig['serialized_name'])) { |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
235 | - if (!$pMetadata->serializedName) { |
|
235 | + if ( ! $pMetadata->serializedName) { |
|
236 | 236 | $pMetadata->serializedName = $this->namingStrategy->translateName($pMetadata); |
237 | 237 | } |
238 | 238 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | - if ((ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude) |
|
252 | + if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude) |
|
253 | 253 | || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose) |
254 | 254 | ) { |
255 | 255 | $metadata->addPropertyMetadata($pMetadata); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | |
282 | 282 | private function addClassProperties(ClassMetadata $metadata, array $config): void |
283 | 283 | { |
284 | - if (isset($config['custom_accessor_order']) && !isset($config['accessor_order'])) { |
|
284 | + if (isset($config['custom_accessor_order']) && ! isset($config['accessor_order'])) { |
|
285 | 285 | $config['accessor_order'] = 'custom'; |
286 | 286 | } |
287 | 287 | |
@@ -311,11 +311,11 @@ discard block |
||
311 | 311 | if (isset($config['discriminator']['disabled']) && true === $config['discriminator']['disabled']) { |
312 | 312 | $metadata->discriminatorDisabled = true; |
313 | 313 | } else { |
314 | - if (!isset($config['discriminator']['field_name'])) { |
|
314 | + if ( ! isset($config['discriminator']['field_name'])) { |
|
315 | 315 | throw new InvalidMetadataException('The "field_name" attribute must be set for discriminators.'); |
316 | 316 | } |
317 | 317 | |
318 | - if (!isset($config['discriminator']['map']) || !is_array($config['discriminator']['map'])) { |
|
318 | + if ( ! isset($config['discriminator']['map']) || ! is_array($config['discriminator']['map'])) { |
|
319 | 319 | throw new InvalidMetadataException('The "map" attribute must be set, and be an array for discriminators.'); |
320 | 320 | } |
321 | 321 | $groups = $config['discriminator']['groups'] ?? []; |
@@ -340,13 +340,13 @@ discard block |
||
340 | 340 | { |
341 | 341 | if (is_string($config)) { |
342 | 342 | $config = [$config]; |
343 | - } elseif (!is_array($config)) { |
|
343 | + } elseif ( ! is_array($config)) { |
|
344 | 344 | throw new InvalidMetadataException(sprintf('callback methods expects a string, or an array of strings that represent method names, but got %s.', json_encode($config['pre_serialize']))); |
345 | 345 | } |
346 | 346 | |
347 | 347 | $methods = []; |
348 | 348 | foreach ($config as $name) { |
349 | - if (!$class->hasMethod($name)) { |
|
349 | + if ( ! $class->hasMethod($name)) { |
|
350 | 350 | throw new InvalidMetadataException(sprintf('The method %s does not exist in class %s.', $name, $class->name)); |
351 | 351 | } |
352 | 352 |