@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | $classMetadata = new ClassMetadata($name = $class->name); |
| 16 | 16 | $classMetadata->isEnum = method_exists($class, 'isEnum') ? $class->isEnum() : false; |
| 17 | - $fileResource = $class->getFilename(); |
|
| 17 | + $fileResource = $class->getFilename(); |
|
| 18 | 18 | if (false !== $fileResource) { |
| 19 | 19 | $classMetadata->fileResources[] = $fileResource; |
| 20 | 20 | } |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $metadata = new ClassMetadata($name = $class->name); |
| 57 | 57 | $metadata->isEnum = method_exists($class, 'isEnum') ? $class->isEnum() : false; |
| 58 | - if (!$elems = $elem->xpath("./class[@name = '" . $name . "']")) { |
|
| 58 | + if ( ! $elems = $elem->xpath("./class[@name = '".$name."']")) { |
|
| 59 | 59 | throw new InvalidMetadataException(sprintf('Could not find class %s inside XML element.', $name)); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $elem = reset($elems); |
| 63 | 63 | |
| 64 | 64 | $metadata->fileResources[] = $path; |
| 65 | - $fileResource = $class->getFilename(); |
|
| 65 | + $fileResource = $class->getFilename(); |
|
| 66 | 66 | if (false !== $fileResource) { |
| 67 | 67 | $metadata->fileResources[] = $fileResource; |
| 68 | 68 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $discriminatorFieldName = (string) $elem->attributes()->{'discriminator-field-name'}; |
| 102 | 102 | $discriminatorMap = []; |
| 103 | 103 | foreach ($elem->xpath('./discriminator-class') as $entry) { |
| 104 | - if (!isset($entry->attributes()->value)) { |
|
| 104 | + if ( ! isset($entry->attributes()->value)) { |
|
| 105 | 105 | throw new InvalidMetadataException('Each discriminator-class element must have a "value" attribute.'); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | if ('true' === (string) $elem->attributes()->{'discriminator-disabled'}) { |
| 112 | 112 | $metadata->discriminatorDisabled = true; |
| 113 | - } elseif (!empty($discriminatorFieldName) || !empty($discriminatorMap)) { |
|
| 113 | + } elseif ( ! empty($discriminatorFieldName) || ! empty($discriminatorMap)) { |
|
| 114 | 114 | $discriminatorGroups = []; |
| 115 | 115 | foreach ($elem->xpath('./discriminator-groups/group') as $entry) { |
| 116 | 116 | $discriminatorGroups[] = (string) $entry; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | foreach ($elem->xpath('./xml-namespace') as $xmlNamespace) { |
| 123 | - if (!isset($xmlNamespace->attributes()->uri)) { |
|
| 123 | + if ( ! isset($xmlNamespace->attributes()->uri)) { |
|
| 124 | 124 | throw new InvalidMetadataException('The prefix attribute must be set for all xml-namespace elements.'); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $this->parseExpression((string) $method->attributes()->expression) |
| 156 | 156 | ); |
| 157 | 157 | } else { |
| 158 | - if (!isset($method->attributes()->method)) { |
|
| 158 | + if ( ! isset($method->attributes()->method)) { |
|
| 159 | 159 | throw new InvalidMetadataException('The method attribute must be set for all virtual-property elements.'); |
| 160 | 160 | } |
| 161 | 161 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $propertiesNodes[] = $method; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - if (!$excludeAll) { |
|
| 169 | + if ( ! $excludeAll) { |
|
| 170 | 170 | foreach ($class->getProperties() as $property) { |
| 171 | 171 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
| 172 | 172 | continue; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $pName = $property->getName(); |
| 176 | 176 | $propertiesMetadata[] = new PropertyMetadata($name, $pName); |
| 177 | 177 | |
| 178 | - $pElems = $elem->xpath("./property[@name = '" . $pName . "']"); |
|
| 178 | + $pElems = $elem->xpath("./property[@name = '".$pName."']"); |
|
| 179 | 179 | $propertiesNodes[] = $pElems ? reset($pElems) : null; |
| 180 | 180 | } |
| 181 | 181 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | || isset($propertiesNodes[$propertyKey]); |
| 187 | 187 | |
| 188 | 188 | $pElem = $propertiesNodes[$propertyKey]; |
| 189 | - if (!empty($pElem)) { |
|
| 189 | + if ( ! empty($pElem)) { |
|
| 190 | 190 | if (null !== $exclude = $pElem->attributes()->exclude) { |
| 191 | 191 | $isExclude = 'true' === strtolower((string) $exclude); |
| 192 | 192 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | if (null !== $excludeIf = $pElem->attributes()->{'expose-if'}) { |
| 211 | - $pMetadata->excludeIf = $this->parseExpression('!(' . (string) $excludeIf . ')'); |
|
| 211 | + $pMetadata->excludeIf = $this->parseExpression('!('.(string) $excludeIf.')'); |
|
| 212 | 212 | $isExpose = true; |
| 213 | 213 | } |
| 214 | 214 | |
@@ -336,16 +336,16 @@ discard block |
||
| 336 | 336 | $metadata->isMap = $metadata->isMap || PropertyMetadata::isCollectionMap($pMetadata->type); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - if (!$pMetadata->serializedName) { |
|
| 339 | + if ( ! $pMetadata->serializedName) { |
|
| 340 | 340 | $pMetadata->serializedName = $this->namingStrategy->translateName($pMetadata); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - if (!empty($pElem) && null !== $name = $pElem->attributes()->name) { |
|
| 343 | + if ( ! empty($pElem) && null !== $name = $pElem->attributes()->name) { |
|
| 344 | 344 | $pMetadata->name = (string) $name; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | if ( |
| 348 | - (ExclusionPolicy::NONE === (string) $exclusionPolicy && !$isExclude) |
|
| 348 | + (ExclusionPolicy::NONE === (string) $exclusionPolicy && ! $isExclude) |
|
| 349 | 349 | || (ExclusionPolicy::ALL === (string) $exclusionPolicy && $isExpose) |
| 350 | 350 | ) { |
| 351 | 351 | $metadata->addPropertyMetadata($pMetadata); |
@@ -354,11 +354,11 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | foreach ($elem->xpath('./callback-method') as $method) { |
| 357 | - if (!isset($method->attributes()->type)) { |
|
| 357 | + if ( ! isset($method->attributes()->type)) { |
|
| 358 | 358 | throw new InvalidMetadataException('The type attribute must be set for all callback-method elements.'); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - if (!isset($method->attributes()->name)) { |
|
| 361 | + if ( ! isset($method->attributes()->name)) { |
|
| 362 | 362 | throw new InvalidMetadataException('The name attribute must be set for all callback-method elements.'); |
| 363 | 363 | } |
| 364 | 364 | |
@@ -376,11 +376,11 @@ discard block |
||
| 376 | 376 | break; |
| 377 | 377 | |
| 378 | 378 | case 'handler': |
| 379 | - if (!isset($method->attributes()->format)) { |
|
| 379 | + if ( ! isset($method->attributes()->format)) { |
|
| 380 | 380 | throw new InvalidMetadataException('The format attribute must be set for "handler" callback methods.'); |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - if (!isset($method->attributes()->direction)) { |
|
| 383 | + if ( ! isset($method->attributes()->direction)) { |
|
| 384 | 384 | throw new InvalidMetadataException('The direction attribute must be set for "handler" callback methods.'); |
| 385 | 385 | } |
| 386 | 386 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $classMetadata = new ClassMetadata($name = $class->name); |
| 80 | 80 | $classMetadata->isEnum = method_exists($class, 'isEnum') ? $class->isEnum() : false; |
| 81 | - $fileResource = $class->getFilename(); |
|
| 81 | + $fileResource = $class->getFilename(); |
|
| 82 | 82 | if (false !== $fileResource) { |
| 83 | 83 | $classMetadata->fileResources[] = $fileResource; |
| 84 | 84 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - if (!$excludeAll) { |
|
| 161 | + if ( ! $excludeAll) { |
|
| 162 | 162 | foreach ($class->getProperties() as $property) { |
| 163 | 163 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
| 164 | 164 | continue; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | } elseif ($annot instanceof Expose) { |
| 191 | 191 | $isExpose = true; |
| 192 | 192 | if (null !== $annot->if) { |
| 193 | - $propertyMetadata->excludeIf = $this->parseExpression('!(' . $annot->if . ')'); |
|
| 193 | + $propertyMetadata->excludeIf = $this->parseExpression('!('.$annot->if.')'); |
|
| 194 | 194 | } |
| 195 | 195 | } elseif ($annot instanceof Exclude) { |
| 196 | 196 | if (null !== $annot->if) { |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | throw new InvalidMetadataException(sprintf( |
| 238 | 238 | 'Invalid group name "%s" on "%s", did you mean to create multiple groups?', |
| 239 | 239 | implode(', ', $propertyMetadata->groups), |
| 240 | - $propertyMetadata->class . '->' . $propertyMetadata->name |
|
| 240 | + $propertyMetadata->class.'->'.$propertyMetadata->name |
|
| 241 | 241 | )); |
| 242 | 242 | } |
| 243 | 243 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | - if (!$propertyMetadata->serializedName) { |
|
| 262 | + if ( ! $propertyMetadata->serializedName) { |
|
| 263 | 263 | $propertyMetadata->serializedName = $this->namingStrategy->translateName($propertyMetadata); |
| 264 | 264 | } |
| 265 | 265 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | if ( |
| 273 | - (ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude) |
|
| 273 | + (ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude) |
|
| 274 | 274 | || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose) |
| 275 | 275 | ) { |
| 276 | 276 | $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]); |