@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | private function getAccessorStrategy(): AccessorStrategyInterface |
216 | 216 | { |
217 | - if (!$this->accessorStrategy) { |
|
217 | + if ( ! $this->accessorStrategy) { |
|
218 | 218 | $this->accessorStrategy = new DefaultAccessorStrategy($this->expressionEvaluator); |
219 | 219 | } |
220 | 220 | |
@@ -251,11 +251,11 @@ discard block |
||
251 | 251 | |
252 | 252 | public function setCacheDir(string $dir): self |
253 | 253 | { |
254 | - if (!is_dir($dir)) { |
|
254 | + if ( ! is_dir($dir)) { |
|
255 | 255 | $this->createDir($dir); |
256 | 256 | } |
257 | 257 | |
258 | - if (!is_writable($dir)) { |
|
258 | + if ( ! is_writable($dir)) { |
|
259 | 259 | throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir)); |
260 | 260 | } |
261 | 261 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | public function setMetadataDirs(array $namespacePrefixToDirMap): self |
378 | 378 | { |
379 | 379 | foreach ($namespacePrefixToDirMap as $dir) { |
380 | - if (!is_dir($dir)) { |
|
380 | + if ( ! is_dir($dir)) { |
|
381 | 381 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
382 | 382 | } |
383 | 383 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public function addMetadataDir(string $dir, string $namespacePrefix = ''): self |
417 | 417 | { |
418 | - if (!is_dir($dir)) { |
|
418 | + if ( ! is_dir($dir)) { |
|
419 | 419 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
420 | 420 | } |
421 | 421 | |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | */ |
455 | 455 | public function replaceMetadataDir(string $dir, string $namespacePrefix = ''): self |
456 | 456 | { |
457 | - if (!is_dir($dir)) { |
|
457 | + if ( ! is_dir($dir)) { |
|
458 | 458 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
459 | 459 | } |
460 | 460 | |
461 | - if (!isset($this->metadataDirs[$namespacePrefix])) { |
|
461 | + if ( ! isset($this->metadataDirs[$namespacePrefix])) { |
|
462 | 462 | throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix)); |
463 | 463 | } |
464 | 464 | |
@@ -553,23 +553,23 @@ discard block |
||
553 | 553 | if (null !== $this->metadataCache) { |
554 | 554 | $metadataFactory->setCache($this->metadataCache); |
555 | 555 | } elseif (null !== $this->cacheDir) { |
556 | - $this->createDir($this->cacheDir . '/metadata'); |
|
557 | - $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata')); |
|
556 | + $this->createDir($this->cacheDir.'/metadata'); |
|
557 | + $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata')); |
|
558 | 558 | } |
559 | 559 | |
560 | - if (!$this->handlersConfigured) { |
|
560 | + if ( ! $this->handlersConfigured) { |
|
561 | 561 | $this->addDefaultHandlers(); |
562 | 562 | } |
563 | 563 | |
564 | - if (!$this->listenersConfigured) { |
|
564 | + if ( ! $this->listenersConfigured) { |
|
565 | 565 | $this->addDefaultListeners(); |
566 | 566 | } |
567 | 567 | |
568 | - if (!$this->serializationVisitorsAdded) { |
|
568 | + if ( ! $this->serializationVisitorsAdded) { |
|
569 | 569 | $this->addDefaultSerializationVisitors(); |
570 | 570 | } |
571 | 571 | |
572 | - if (!$this->deserializationVisitorsAdded) { |
|
572 | + if ( ! $this->deserializationVisitorsAdded) { |
|
573 | 573 | $this->addDefaultDeserializationVisitors(); |
574 | 574 | } |
575 | 575 | |
@@ -635,12 +635,12 @@ discard block |
||
635 | 635 | private function decorateAnnotationReader(Reader $annotationReader): Reader |
636 | 636 | { |
637 | 637 | if (null !== $this->cacheDir) { |
638 | - $this->createDir($this->cacheDir . '/annotations'); |
|
638 | + $this->createDir($this->cacheDir.'/annotations'); |
|
639 | 639 | if (class_exists(FilesystemAdapter::class)) { |
640 | - $annotationsCache = new FilesystemAdapter('', 0, $this->cacheDir . '/annotations'); |
|
640 | + $annotationsCache = new FilesystemAdapter('', 0, $this->cacheDir.'/annotations'); |
|
641 | 641 | $annotationReader = new PsrCachedReader($annotationReader, $annotationsCache, $this->debug); |
642 | 642 | } elseif (class_exists(FilesystemCache::class) && class_exists(CachedReader::class)) { |
643 | - $annotationsCache = new FilesystemCache($this->cacheDir . '/annotations'); |
|
643 | + $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations'); |
|
644 | 644 | $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug); |
645 | 645 | } |
646 | 646 | } |
@@ -74,7 +74,7 @@ |
||
74 | 74 | { |
75 | 75 | $reflectionType = $propertyReflection->getType(); |
76 | 76 | |
77 | - if (!($reflectionType instanceof \ReflectionNamedType)) { |
|
77 | + if ( ! ($reflectionType instanceof \ReflectionNamedType)) { |
|
78 | 78 | return null; |
79 | 79 | } |
80 | 80 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | $type = $event->getType(); |
15 | 15 | |
16 | - if (isset($type['name']) && ('enum' === $type['name'] || !is_a($type['name'], \UnitEnum::class, true))) { |
|
16 | + if (isset($type['name']) && ('enum' === $type['name'] || ! is_a($type['name'], \UnitEnum::class, true))) { |
|
17 | 17 | return; |
18 | 18 | } |
19 | 19 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function visitDouble(float $data, array $type) |
72 | 72 | { |
73 | 73 | $precision = $type['params'][0] ?? null; |
74 | - if (!is_int($precision)) { |
|
74 | + if ( ! is_int($precision)) { |
|
75 | 75 | return $data; |
76 | 76 | } |
77 | 77 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $rs = isset($type['params'][1]) ? new \ArrayObject() : []; |
95 | 95 | |
96 | - $isList = isset($type['params'][0]) && !isset($type['params'][1]); |
|
96 | + $isList = isset($type['params'][0]) && ! isset($type['params'][1]); |
|
97 | 97 | |
98 | 98 | $elType = $this->getElementType($type); |
99 | 99 | foreach ($data as $k => $v) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
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 | \assert($objectManager instanceof EntityManagerInterface || $objectManager instanceof DocumentManagerInterface); |
87 | 87 | |
88 | 88 | // Single identifier, load proxy |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | foreach ($classMetadata->getIdentifierFieldNames() as $name) { |
97 | 97 | // Avoid calling objectManager->find if some identification properties are excluded |
98 | - if (!isset($metadata->propertyMetadata[$name])) { |
|
98 | + if ( ! isset($metadata->propertyMetadata[$name])) { |
|
99 | 99 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
100 | 100 | } |
101 | 101 | |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
107 | 107 | } |
108 | 108 | |
109 | - if (is_array($data) && !array_key_exists($propertyMetadata->serializedName, $data)) { |
|
109 | + if (is_array($data) && ! array_key_exists($propertyMetadata->serializedName, $data)) { |
|
110 | 110 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
111 | - } elseif (is_object($data) && !property_exists($data, $propertyMetadata->serializedName)) { |
|
111 | + } elseif (is_object($data) && ! property_exists($data, $propertyMetadata->serializedName)) { |
|
112 | 112 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
113 | 113 | } |
114 | 114 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function loadMetadataForClass(\ReflectionClass $class): ?BaseClassMetadata |
26 | 26 | { |
27 | 27 | $classMetadata = new ClassMetadata($name = $class->name); |
28 | - $fileResource = $class->getFilename(); |
|
28 | + $fileResource = $class->getFilename(); |
|
29 | 29 | if (false !== $fileResource) { |
30 | 30 | $classMetadata->fileResources[] = $fileResource; |
31 | 31 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $propertyMetadata = new PropertyMetadata($name, $property->getName()); |
39 | 39 | |
40 | - if (!$propertyMetadata->serializedName) { |
|
40 | + if ( ! $propertyMetadata->serializedName) { |
|
41 | 41 | $propertyMetadata->serializedName = $this->namingStrategy->translateName($propertyMetadata); |
42 | 42 | } |
43 | 43 |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function setAccessorOrder(string $order, array $customOrder = []): void |
169 | 169 | { |
170 | - if (!in_array($order, [self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM], true)) { |
|
170 | + if ( ! in_array($order, [self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM], true)) { |
|
171 | 171 | throw new InvalidMetadataException(sprintf('The accessor order "%s" is invalid.', $order)); |
172 | 172 | } |
173 | 173 | |
174 | 174 | foreach ($customOrder as $name) { |
175 | - if (!\is_string($name)) { |
|
175 | + if ( ! \is_string($name)) { |
|
176 | 176 | throw new InvalidMetadataException(sprintf('$customOrder is expected to be a list of strings, but got element of value %s.', json_encode($name))); |
177 | 177 | } |
178 | 178 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | public function merge(MergeableInterface $object): void |
211 | 211 | { |
212 | - if (!$object instanceof ClassMetadata) { |
|
212 | + if ( ! $object instanceof ClassMetadata) { |
|
213 | 213 | throw new InvalidMetadataException('$object must be an instance of ClassMetadata.'); |
214 | 214 | } |
215 | 215 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $this->discriminatorBaseClass, |
243 | 243 | $this->discriminatorBaseClass, |
244 | 244 | )); |
245 | - } elseif (!$this->discriminatorFieldName && $object->discriminatorFieldName) { |
|
245 | + } elseif ( ! $this->discriminatorFieldName && $object->discriminatorFieldName) { |
|
246 | 246 | $this->discriminatorFieldName = $object->discriminatorFieldName; |
247 | 247 | $this->discriminatorMap = $object->discriminatorMap; |
248 | 248 | } |
@@ -269,12 +269,12 @@ discard block |
||
269 | 269 | |
270 | 270 | public function registerNamespace(string $uri, ?string $prefix = null): void |
271 | 271 | { |
272 | - if (!\is_string($uri)) { |
|
272 | + if ( ! \is_string($uri)) { |
|
273 | 273 | throw new InvalidMetadataException(sprintf('$uri is expected to be a strings, but got value %s.', json_encode($uri))); |
274 | 274 | } |
275 | 275 | |
276 | 276 | if (null !== $prefix) { |
277 | - if (!\is_string($prefix)) { |
|
277 | + if ( ! \is_string($prefix)) { |
|
278 | 278 | throw new InvalidMetadataException(sprintf('$prefix is expected to be a strings, but got value %s.', json_encode($prefix))); |
279 | 279 | } |
280 | 280 | } else { |
@@ -352,8 +352,8 @@ discard block |
||
352 | 352 | { |
353 | 353 | if ( |
354 | 354 | $this->discriminatorMap |
355 | - && !$this->getReflection()->isAbstract() |
|
356 | - && !$this->getReflection()->isInterface() |
|
355 | + && ! $this->getReflection()->isAbstract() |
|
356 | + && ! $this->getReflection()->isInterface() |
|
357 | 357 | ) { |
358 | 358 | if (false === $typeValue = array_search($this->name, $this->discriminatorMap, true)) { |
359 | 359 | throw new InvalidMetadataException(sprintf( |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | |
368 | 368 | if ( |
369 | 369 | isset($this->propertyMetadata[$this->discriminatorFieldName]) |
370 | - && !$this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata |
|
370 | + && ! $this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata |
|
371 | 371 | ) { |
372 | 372 | throw new InvalidMetadataException(sprintf( |
373 | 373 | 'The discriminator field name "%s" of the base-class "%s" conflicts with a regular property of the sub-class "%s".', |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getAllClassNames(): array |
72 | 72 | { |
73 | - if (!$this->locator instanceof AdvancedFileLocatorInterface) { |
|
73 | + if ( ! $this->locator instanceof AdvancedFileLocatorInterface) { |
|
74 | 74 | throw new RuntimeException( |
75 | 75 | sprintf( |
76 | 76 | 'Locator "%s" must be an instance of "AdvancedFileLocatorInterface".', |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | $config = Yaml::parseFile($file, Yaml::PARSE_CONSTANT); |
95 | 95 | |
96 | - if (!isset($config[$name = $class->name])) { |
|
96 | + if ( ! isset($config[$name = $class->name])) { |
|
97 | 97 | throw new InvalidMetadataException( |
98 | 98 | sprintf('Expected metadata for class %s to be defined in %s.', $class->name, $file), |
99 | 99 | ); |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | ); |
131 | 131 | unset($propertySettings['exp']); |
132 | 132 | } else { |
133 | - if (!$class->hasMethod($methodName)) { |
|
133 | + if ( ! $class->hasMethod($methodName)) { |
|
134 | 134 | throw new InvalidMetadataException( |
135 | - 'The method ' . $methodName . ' not found in class ' . $class->name, |
|
135 | + 'The method '.$methodName.' not found in class '.$class->name, |
|
136 | 136 | ); |
137 | 137 | } |
138 | 138 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
147 | - if (!$excludeAll) { |
|
147 | + if ( ! $excludeAll) { |
|
148 | 148 | foreach ($class->getProperties() as $property) { |
149 | 149 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
150 | 150 | continue; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | |
153 | 153 | $pName = $property->getName(); |
154 | 154 | $propertiesMetadata[] = new PropertyMetadata($name, $pName); |
155 | - $propertiesData[] = !empty($config['properties']) && true === array_key_exists($pName, $config['properties']) |
|
155 | + $propertiesData[] = ! empty($config['properties']) && true === array_key_exists($pName, $config['properties']) |
|
156 | 156 | ? (array) $config['properties'][$pName] |
157 | 157 | : null; |
158 | 158 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | || isset($propertiesData[$propertyKey]); |
165 | 165 | |
166 | 166 | $pConfig = $propertiesData[$propertyKey]; |
167 | - if (!empty($pConfig)) { |
|
167 | + if ( ! empty($pConfig)) { |
|
168 | 168 | if (isset($pConfig['exclude'])) { |
169 | 169 | $isExclude = (bool) $pConfig['exclude']; |
170 | 170 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | if (isset($pConfig['expose_if'])) { |
197 | - $pMetadata->excludeIf = $this->parseExpression('!(' . $pConfig['expose_if'] . ')'); |
|
197 | + $pMetadata->excludeIf = $this->parseExpression('!('.$pConfig['expose_if'].')'); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | if (isset($pConfig['serialized_name'])) { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | } |
303 | 303 | } |
304 | 304 | |
305 | - if (!$pMetadata->serializedName) { |
|
305 | + if ( ! $pMetadata->serializedName) { |
|
306 | 306 | $pMetadata->serializedName = $this->namingStrategy->translateName($pMetadata); |
307 | 307 | } |
308 | 308 | |
@@ -311,12 +311,12 @@ discard block |
||
311 | 311 | $metadata->isMap = $metadata->isMap || PropertyMetadata::isCollectionMap($pMetadata->type); |
312 | 312 | } |
313 | 313 | |
314 | - if (!empty($pConfig) && !empty($pConfig['name'])) { |
|
314 | + if ( ! empty($pConfig) && ! empty($pConfig['name'])) { |
|
315 | 315 | $pMetadata->name = (string) $pConfig['name']; |
316 | 316 | } |
317 | 317 | |
318 | 318 | if ( |
319 | - (ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude) |
|
319 | + (ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude) |
|
320 | 320 | || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose) |
321 | 321 | ) { |
322 | 322 | $metadata->addPropertyMetadata($pMetadata); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | |
362 | 362 | private function addClassProperties(ClassMetadata $metadata, array $config): void |
363 | 363 | { |
364 | - if (isset($config['custom_accessor_order']) && !isset($config['accessor_order'])) { |
|
364 | + if (isset($config['custom_accessor_order']) && ! isset($config['accessor_order'])) { |
|
365 | 365 | $config['accessor_order'] = 'custom'; |
366 | 366 | } |
367 | 367 | |
@@ -391,11 +391,11 @@ discard block |
||
391 | 391 | if (isset($config['discriminator']['disabled']) && true === $config['discriminator']['disabled']) { |
392 | 392 | $metadata->discriminatorDisabled = true; |
393 | 393 | } else { |
394 | - if (!isset($config['discriminator']['field_name'])) { |
|
394 | + if ( ! isset($config['discriminator']['field_name'])) { |
|
395 | 395 | throw new InvalidMetadataException('The "field_name" attribute must be set for discriminators.'); |
396 | 396 | } |
397 | 397 | |
398 | - if (!isset($config['discriminator']['map']) || !is_array($config['discriminator']['map'])) { |
|
398 | + if ( ! isset($config['discriminator']['map']) || ! is_array($config['discriminator']['map'])) { |
|
399 | 399 | throw new InvalidMetadataException( |
400 | 400 | 'The "map" attribute must be set, and be an array for discriminators.', |
401 | 401 | ); |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | { |
433 | 433 | if (is_string($config)) { |
434 | 434 | $config = [$config]; |
435 | - } elseif (!is_array($config)) { |
|
435 | + } elseif ( ! is_array($config)) { |
|
436 | 436 | throw new InvalidMetadataException( |
437 | 437 | sprintf( |
438 | 438 | 'callback methods expects a string, or an array of strings that represent method names, but got %s.', |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | $methods = []; |
445 | 445 | foreach ($config as $name) { |
446 | - if (!$class->hasMethod($name)) { |
|
446 | + if ( ! $class->hasMethod($name)) { |
|
447 | 447 | throw new InvalidMetadataException( |
448 | 448 | sprintf('The method %s does not exist in class %s.', $name, $class->name), |
449 | 449 | ); |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | $metadata = new ClassMetadata($name = $class->name); |
61 | - if (!$elems = $elem->xpath("./class[@name = '" . $name . "']")) { |
|
61 | + if ( ! $elems = $elem->xpath("./class[@name = '".$name."']")) { |
|
62 | 62 | throw new InvalidMetadataException(sprintf('Could not find class %s inside XML element.', $name)); |
63 | 63 | } |
64 | 64 | |
65 | 65 | $elem = reset($elems); |
66 | 66 | |
67 | 67 | $metadata->fileResources[] = $path; |
68 | - $fileResource = $class->getFilename(); |
|
68 | + $fileResource = $class->getFilename(); |
|
69 | 69 | if (false !== $fileResource) { |
70 | 70 | $metadata->fileResources[] = $fileResource; |
71 | 71 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $discriminatorFieldName = (string) $elem->attributes()->{'discriminator-field-name'}; |
105 | 105 | $discriminatorMap = []; |
106 | 106 | foreach ($elem->xpath('./discriminator-class') as $entry) { |
107 | - if (!isset($entry->attributes()->value)) { |
|
107 | + if ( ! isset($entry->attributes()->value)) { |
|
108 | 108 | throw new InvalidMetadataException('Each discriminator-class element must have a "value" attribute.'); |
109 | 109 | } |
110 | 110 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | if ('true' === (string) $elem->attributes()->{'discriminator-disabled'}) { |
115 | 115 | $metadata->discriminatorDisabled = true; |
116 | - } elseif (!empty($discriminatorFieldName) || !empty($discriminatorMap)) { |
|
116 | + } elseif ( ! empty($discriminatorFieldName) || ! empty($discriminatorMap)) { |
|
117 | 117 | $discriminatorGroups = []; |
118 | 118 | foreach ($elem->xpath('./discriminator-groups/group') as $entry) { |
119 | 119 | $discriminatorGroups[] = (string) $entry; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | |
125 | 125 | foreach ($elem->xpath('./xml-namespace') as $xmlNamespace) { |
126 | - if (!isset($xmlNamespace->attributes()->uri)) { |
|
126 | + if ( ! isset($xmlNamespace->attributes()->uri)) { |
|
127 | 127 | throw new InvalidMetadataException('The prefix attribute must be set for all xml-namespace elements.'); |
128 | 128 | } |
129 | 129 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $this->parseExpression((string) $method->attributes()->expression), |
159 | 159 | ); |
160 | 160 | } else { |
161 | - if (!isset($method->attributes()->method)) { |
|
161 | + if ( ! isset($method->attributes()->method)) { |
|
162 | 162 | throw new InvalidMetadataException('The method attribute must be set for all virtual-property elements.'); |
163 | 163 | } |
164 | 164 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $propertiesNodes[] = $method; |
170 | 170 | } |
171 | 171 | |
172 | - if (!$excludeAll) { |
|
172 | + if ( ! $excludeAll) { |
|
173 | 173 | foreach ($class->getProperties() as $property) { |
174 | 174 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
175 | 175 | continue; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $pName = $property->getName(); |
179 | 179 | $propertiesMetadata[] = new PropertyMetadata($name, $pName); |
180 | 180 | |
181 | - $pElems = $elem->xpath("./property[@name = '" . $pName . "']"); |
|
181 | + $pElems = $elem->xpath("./property[@name = '".$pName."']"); |
|
182 | 182 | $propertiesNodes[] = $pElems ? reset($pElems) : null; |
183 | 183 | } |
184 | 184 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | || isset($propertiesNodes[$propertyKey]); |
190 | 190 | |
191 | 191 | $pElem = $propertiesNodes[$propertyKey]; |
192 | - if (!empty($pElem)) { |
|
192 | + if ( ! empty($pElem)) { |
|
193 | 193 | if (null !== $exclude = $pElem->attributes()->exclude) { |
194 | 194 | $isExclude = 'true' === strtolower((string) $exclude); |
195 | 195 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | } |
212 | 212 | |
213 | 213 | if (null !== $excludeIf = $pElem->attributes()->{'expose-if'}) { |
214 | - $pMetadata->excludeIf = $this->parseExpression('!(' . (string) $excludeIf . ')'); |
|
214 | + $pMetadata->excludeIf = $this->parseExpression('!('.(string) $excludeIf.')'); |
|
215 | 215 | $isExpose = true; |
216 | 216 | } |
217 | 217 | |
@@ -339,16 +339,16 @@ discard block |
||
339 | 339 | $metadata->isMap = $metadata->isMap || PropertyMetadata::isCollectionMap($pMetadata->type); |
340 | 340 | } |
341 | 341 | |
342 | - if (!$pMetadata->serializedName) { |
|
342 | + if ( ! $pMetadata->serializedName) { |
|
343 | 343 | $pMetadata->serializedName = $this->namingStrategy->translateName($pMetadata); |
344 | 344 | } |
345 | 345 | |
346 | - if (!empty($pElem) && null !== $name = $pElem->attributes()->name) { |
|
346 | + if ( ! empty($pElem) && null !== $name = $pElem->attributes()->name) { |
|
347 | 347 | $pMetadata->name = (string) $name; |
348 | 348 | } |
349 | 349 | |
350 | 350 | if ( |
351 | - (ExclusionPolicy::NONE === (string) $exclusionPolicy && !$isExclude) |
|
351 | + (ExclusionPolicy::NONE === (string) $exclusionPolicy && ! $isExclude) |
|
352 | 352 | || (ExclusionPolicy::ALL === (string) $exclusionPolicy && $isExpose) |
353 | 353 | ) { |
354 | 354 | $metadata->addPropertyMetadata($pMetadata); |
@@ -357,11 +357,11 @@ discard block |
||
357 | 357 | } |
358 | 358 | |
359 | 359 | foreach ($elem->xpath('./callback-method') as $method) { |
360 | - if (!isset($method->attributes()->type)) { |
|
360 | + if ( ! isset($method->attributes()->type)) { |
|
361 | 361 | throw new InvalidMetadataException('The type attribute must be set for all callback-method elements.'); |
362 | 362 | } |
363 | 363 | |
364 | - if (!isset($method->attributes()->name)) { |
|
364 | + if ( ! isset($method->attributes()->name)) { |
|
365 | 365 | throw new InvalidMetadataException('The name attribute must be set for all callback-method elements.'); |
366 | 366 | } |
367 | 367 | |
@@ -379,11 +379,11 @@ discard block |
||
379 | 379 | break; |
380 | 380 | |
381 | 381 | case 'handler': |
382 | - if (!isset($method->attributes()->format)) { |
|
382 | + if ( ! isset($method->attributes()->format)) { |
|
383 | 383 | throw new InvalidMetadataException('The format attribute must be set for "handler" callback methods.'); |
384 | 384 | } |
385 | 385 | |
386 | - if (!isset($method->attributes()->direction)) { |
|
386 | + if ( ! isset($method->attributes()->direction)) { |
|
387 | 387 | throw new InvalidMetadataException('The direction attribute must be set for "handler" callback methods.'); |
388 | 388 | } |
389 | 389 |