@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | foreach ($metadata->getPropertiesIterator() as $name => $association) { |
| 57 | - if (! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
| 57 | + if ( ! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
| 58 | 58 | continue; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - if (! $association instanceof ToOneAssociationMetadata) { |
|
| 61 | + if ( ! $association instanceof ToOneAssociationMetadata) { |
|
| 62 | 62 | unset($data[$name]); |
| 63 | 63 | |
| 64 | 64 | continue; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $targetClassMetadata = $this->em->getClassMetadata($targetEntity); |
| 69 | 69 | $targetPersister = $this->uow->getEntityPersister($targetEntity); |
| 70 | 70 | |
| 71 | - if (! $association->getCache()) { |
|
| 71 | + if ( ! $association->getCache()) { |
|
| 72 | 72 | $owningAssociation = ! $association->isOwningSide() |
| 73 | 73 | ? $targetClassMetadata->getProperty($association->getMappedBy()) |
| 74 | 74 | : $association; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | continue; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - if (! $association->isPrimaryKey()) { |
|
| 119 | + if ( ! $association->isPrimaryKey()) { |
|
| 120 | 120 | $targetClass = StaticClassNameConverter::getClass($data[$name]); |
| 121 | 121 | $targetId = $this->uow->getEntityIdentifier($data[$name]); |
| 122 | 122 | $data[$name] = new AssociationCacheEntry($targetClass, $targetId); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | ($association instanceof OneToOneAssociationMetadata && ! $association->isOwningSide()) |
| 166 | 166 | ); |
| 167 | 167 | |
| 168 | - if (! $isEagerLoad) { |
|
| 168 | + if ( ! $isEagerLoad) { |
|
| 169 | 169 | $data[$name] = $this->em->getReference($assocClass, $assocId); |
| 170 | 170 | |
| 171 | 171 | continue; |
@@ -239,11 +239,11 @@ discard block |
||
| 239 | 239 | $this->setCache(clone $parent->cache); |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - if (! empty($parent->lifecycleCallbacks)) { |
|
| 242 | + if ( ! empty($parent->lifecycleCallbacks)) { |
|
| 243 | 243 | $this->lifecycleCallbacks = $parent->lifecycleCallbacks; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - if (! empty($parent->entityListeners)) { |
|
| 246 | + if ( ! empty($parent->entityListeners)) { |
|
| 247 | 247 | $this->entityListeners = $parent->entityListeners; |
| 248 | 248 | } |
| 249 | 249 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | public function __toString() |
| 312 | 312 | { |
| 313 | - return self::class . '@' . spl_object_id($this); |
|
| 313 | + return self::class.'@'.spl_object_id($this); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | // Restore ReflectionClass and properties |
| 398 | 398 | $this->reflectionClass = $reflectionService->getClass($this->className); |
| 399 | 399 | |
| 400 | - if (! $this->reflectionClass) { |
|
| 400 | + if ( ! $this->reflectionClass) { |
|
| 401 | 401 | return; |
| 402 | 402 | } |
| 403 | 403 | |
@@ -426,11 +426,11 @@ discard block |
||
| 426 | 426 | */ |
| 427 | 427 | public function isIdentifier(string $fieldName) : bool |
| 428 | 428 | { |
| 429 | - if (! $this->identifier) { |
|
| 429 | + if ( ! $this->identifier) { |
|
| 430 | 430 | return false; |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | - if (! $this->isIdentifierComposite()) { |
|
| 433 | + if ( ! $this->isIdentifierComposite()) { |
|
| 434 | 434 | return $fieldName === $this->identifier[0]; |
| 435 | 435 | } |
| 436 | 436 | |
@@ -454,11 +454,11 @@ discard block |
||
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | // Verify & complete identifier mapping |
| 457 | - if (! $this->identifier) { |
|
| 457 | + if ( ! $this->identifier) { |
|
| 458 | 458 | throw MappingException::identifierRequired($this->className); |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - $explicitlyGeneratedProperties = array_filter($this->properties, static function (Property $property) : bool { |
|
| 461 | + $explicitlyGeneratedProperties = array_filter($this->properties, static function(Property $property) : bool { |
|
| 462 | 462 | return $property instanceof FieldMetadata |
| 463 | 463 | && $property->isPrimaryKey() |
| 464 | 464 | && $property->hasValueGenerator(); |
@@ -477,14 +477,14 @@ discard block |
||
| 477 | 477 | public function validateAssociations() : void |
| 478 | 478 | { |
| 479 | 479 | array_map( |
| 480 | - function (Property $property) { |
|
| 481 | - if (! ($property instanceof AssociationMetadata)) { |
|
| 480 | + function(Property $property) { |
|
| 481 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
| 482 | 482 | return; |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | $targetEntity = $property->getTargetEntity(); |
| 486 | 486 | |
| 487 | - if (! class_exists($targetEntity)) { |
|
| 487 | + if ( ! class_exists($targetEntity)) { |
|
| 488 | 488 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
| 489 | 489 | } |
| 490 | 490 | }, |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | foreach ($this->lifecycleCallbacks as $callbacks) { |
| 503 | 503 | /** @var array $callbacks */ |
| 504 | 504 | foreach ($callbacks as $callbackFuncName) { |
| 505 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 505 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 506 | 506 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
| 507 | 507 | } |
| 508 | 508 | } |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | $fieldName = $property->getName(); |
| 552 | 552 | $targetEntity = $property->getTargetEntity(); |
| 553 | 553 | |
| 554 | - if (! $targetEntity) { |
|
| 554 | + if ( ! $targetEntity) { |
|
| 555 | 555 | throw MappingException::missingTargetEntity($fieldName); |
| 556 | 556 | } |
| 557 | 557 | |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | throw MappingException::illegalToManyIdentifierAssociation($this->className, $property->getName()); |
| 581 | 581 | } |
| 582 | 582 | |
| 583 | - if (! in_array($property->getName(), $this->identifier, true)) { |
|
| 583 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
| 584 | 584 | $this->identifier[] = $property->getName(); |
| 585 | 585 | } |
| 586 | 586 | } |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | /** @var JoinColumnMetadata $joinColumn */ |
| 622 | 622 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
| 623 | 623 | if (count($property->getJoinColumns()) === 1) { |
| 624 | - if (! $property->isPrimaryKey()) { |
|
| 624 | + if ( ! $property->isPrimaryKey()) { |
|
| 625 | 625 | $joinColumn->setUnique(true); |
| 626 | 626 | } |
| 627 | 627 | } else { |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | if ($uniqueConstraintColumns) { |
| 636 | - if (! $this->table) { |
|
| 636 | + if ( ! $this->table) { |
|
| 637 | 637 | throw new RuntimeException( |
| 638 | 638 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
| 639 | 639 | ); |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | if ($property->isOrphanRemoval()) { |
| 654 | 654 | $cascades = $property->getCascade(); |
| 655 | 655 | |
| 656 | - if (! in_array('remove', $cascades, true)) { |
|
| 656 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 657 | 657 | $cascades[] = 'remove'; |
| 658 | 658 | |
| 659 | 659 | $property->setCascade($cascades); |
@@ -679,14 +679,14 @@ discard block |
||
| 679 | 679 | protected function validateAndCompleteOneToManyMapping(OneToManyAssociationMetadata $property) |
| 680 | 680 | { |
| 681 | 681 | // OneToMany MUST have mappedBy |
| 682 | - if (! $property->getMappedBy()) { |
|
| 682 | + if ( ! $property->getMappedBy()) { |
|
| 683 | 683 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | if ($property->isOrphanRemoval()) { |
| 687 | 687 | $cascades = $property->getCascade(); |
| 688 | 688 | |
| 689 | - if (! in_array('remove', $cascades, true)) { |
|
| 689 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 690 | 690 | $cascades[] = 'remove'; |
| 691 | 691 | |
| 692 | 692 | $property->setCascade($cascades); |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | - if (! isset($this->identifier[0])) { |
|
| 719 | + if ( ! isset($this->identifier[0])) { |
|
| 720 | 720 | throw MappingException::noIdDefined($this->className); |
| 721 | 721 | } |
| 722 | 722 | |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | // Association defined as Id field |
| 776 | 776 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 777 | 777 | |
| 778 | - if (! $property->isOwningSide()) { |
|
| 778 | + if ( ! $property->isOwningSide()) { |
|
| 779 | 779 | $property = $targetClass->getProperty($property->getMappedBy()); |
| 780 | 780 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 781 | 781 | } |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | $columnName = $joinColumn->getColumnName(); |
| 790 | 790 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 791 | 791 | |
| 792 | - if (! $joinColumn->getType()) { |
|
| 792 | + if ( ! $joinColumn->getType()) { |
|
| 793 | 793 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
| 794 | 794 | } |
| 795 | 795 | |
@@ -823,10 +823,10 @@ discard block |
||
| 823 | 823 | { |
| 824 | 824 | $schema = $this->getSchemaName() === null |
| 825 | 825 | ? '' |
| 826 | - : $this->getSchemaName() . '_'; |
|
| 826 | + : $this->getSchemaName().'_'; |
|
| 827 | 827 | |
| 828 | 828 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 829 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
| 829 | + return $schema.$this->getTableName().'_id_tmp'; |
|
| 830 | 830 | } |
| 831 | 831 | |
| 832 | 832 | /** |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | */ |
| 861 | 861 | public function setInheritanceType($type) : void |
| 862 | 862 | { |
| 863 | - if (! $this->isInheritanceType($type)) { |
|
| 863 | + if ( ! $this->isInheritanceType($type)) { |
|
| 864 | 864 | throw MappingException::invalidInheritanceType($this->className, $type); |
| 865 | 865 | } |
| 866 | 866 | |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | { |
| 879 | 879 | $fieldName = $property->getName(); |
| 880 | 880 | |
| 881 | - if (! isset($this->properties[$fieldName])) { |
|
| 881 | + if ( ! isset($this->properties[$fieldName])) { |
|
| 882 | 882 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
| 883 | 883 | } |
| 884 | 884 | |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | $inheritedProperty = $declaringClass->isMappedSuperclass ? clone $property : $property; |
| 1096 | 1096 | |
| 1097 | 1097 | if ($inheritedProperty instanceof FieldMetadata) { |
| 1098 | - if (! $declaringClass->isMappedSuperclass) { |
|
| 1098 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
| 1099 | 1099 | $inheritedProperty->setTableName($property->getTableName()); |
| 1100 | 1100 | } |
| 1101 | 1101 | |
@@ -1188,11 +1188,11 @@ discard block |
||
| 1188 | 1188 | 'method' => $methodName, |
| 1189 | 1189 | ]; |
| 1190 | 1190 | |
| 1191 | - if (! class_exists($class)) { |
|
| 1191 | + if ( ! class_exists($class)) { |
|
| 1192 | 1192 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
| 1193 | 1193 | } |
| 1194 | 1194 | |
| 1195 | - if (! method_exists($class, $methodName)) { |
|
| 1195 | + if ( ! method_exists($class, $methodName)) { |
|
| 1196 | 1196 | throw MappingException::entityListenerMethodNotFound($class, $methodName, $this->className); |
| 1197 | 1197 | } |
| 1198 | 1198 | |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | return; |
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | - if (! (class_exists($className) || interface_exists($className))) { |
|
| 1263 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
| 1264 | 1264 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
| 1265 | 1265 | } |
| 1266 | 1266 | |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | $joinTableMetadata->setName($namingStrategy->joinTableName($souceEntity, $this->targetEntity, $this->fieldName)); |
| 83 | 83 | |
| 84 | 84 | if ($this->joinTableAnnotation !== null) { |
| 85 | - if (! empty($this->joinTableAnnotation->name)) { |
|
| 85 | + if ( ! empty($this->joinTableAnnotation->name)) { |
|
| 86 | 86 | $joinTableMetadata->setName($this->joinTableAnnotation->name); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - if (! empty($this->joinTableAnnotation->schema)) { |
|
| 89 | + if ( ! empty($this->joinTableAnnotation->schema)) { |
|
| 90 | 90 | $joinTableMetadata->setSchema($this->joinTableAnnotation->schema); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $selfReferenceEntity = $souceEntity === $this->targetEntity; |
| 124 | 124 | |
| 125 | - if (! $joinTableMetadata->getJoinColumns()) { |
|
| 125 | + if ( ! $joinTableMetadata->getJoinColumns()) { |
|
| 126 | 126 | $joinColumnAnnotation = new Annotation\JoinColumn(); |
| 127 | 127 | |
| 128 | 128 | $joinColumnAnnotation->onDelete = 'CASCADE'; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $joinTableMetadata->addJoinColumn($this->joinColumnMetadataBuilder->build()); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if (! $joinTableMetadata->getInverseJoinColumns()) { |
|
| 140 | + if ( ! $joinTableMetadata->getInverseJoinColumns()) { |
|
| 141 | 141 | $joinColumnAnnotation = new Annotation\JoinColumn(); |
| 142 | 142 | |
| 143 | 143 | $joinColumnAnnotation->onDelete = 'CASCADE'; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $namingStrategy = $this->metadataBuildingContext->getNamingStrategy(); |
| 60 | 60 | $joinColumnMetadata = new Mapping\JoinColumnMetadata(); |
| 61 | 61 | |
| 62 | - if (! $this->componentMetadata->isMappedSuperclass) { |
|
| 62 | + if ( ! $this->componentMetadata->isMappedSuperclass) { |
|
| 63 | 63 | $joinColumnMetadata->setTableName($this->componentMetadata->getTableName()); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -73,19 +73,19 @@ discard block |
||
| 73 | 73 | $joinColumnMetadata->setNullable($this->joinColumnAnnotation->nullable); |
| 74 | 74 | $joinColumnMetadata->setUnique($this->joinColumnAnnotation->unique); |
| 75 | 75 | |
| 76 | - if (! empty($this->joinColumnAnnotation->name)) { |
|
| 76 | + if ( ! empty($this->joinColumnAnnotation->name)) { |
|
| 77 | 77 | $joinColumnMetadata->setColumnName($this->joinColumnAnnotation->name); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if (! empty($this->joinColumnAnnotation->referencedColumnName)) { |
|
| 80 | + if ( ! empty($this->joinColumnAnnotation->referencedColumnName)) { |
|
| 81 | 81 | $joinColumnMetadata->setReferencedColumnName($this->joinColumnAnnotation->referencedColumnName); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if (! empty($this->joinColumnAnnotation->fieldName)) { |
|
| 84 | + if ( ! empty($this->joinColumnAnnotation->fieldName)) { |
|
| 85 | 85 | $joinColumnMetadata->setAliasedName($this->joinColumnAnnotation->fieldName); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if (! empty($this->joinColumnAnnotation->columnDefinition)) { |
|
| 88 | + if ( ! empty($this->joinColumnAnnotation->columnDefinition)) { |
|
| 89 | 89 | $joinColumnMetadata->setColumnDefinition($this->joinColumnAnnotation->columnDefinition); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
| 82 | 82 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
| 83 | 83 | do { |
| 84 | - if (! $parent->isMappedSuperclass) { |
|
| 84 | + if ( ! $parent->isMappedSuperclass) { |
|
| 85 | 85 | $metadata->setTable($parent->table); |
| 86 | 86 | |
| 87 | 87 | break; |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | 'arguments' => [], |
| 252 | 252 | ]; |
| 253 | 253 | |
| 254 | - if (! isset($idGeneratorDefinition['class'])) { |
|
| 254 | + if ( ! isset($idGeneratorDefinition['class'])) { |
|
| 255 | 255 | throw new Mapping\MappingException( |
| 256 | 256 | sprintf('Cannot instantiate custom generator, no class has been defined') |
| 257 | 257 | ); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | - if (! class_exists($idGeneratorDefinition['class'])) { |
|
| 260 | + if ( ! class_exists($idGeneratorDefinition['class'])) { |
|
| 261 | 261 | throw new Mapping\MappingException( |
| 262 | 262 | sprintf('Cannot instantiate custom generator : %s', var_export($idGeneratorDefinition, true)) |
| 263 | 263 | ); |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | // Check for owning side to consider join column |
| 327 | - if (! $association->isOwningSide()) { |
|
| 327 | + if ( ! $association->isOwningSide()) { |
|
| 328 | 328 | $metadata->addProperty($association); |
| 329 | 329 | |
| 330 | 330 | continue; |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | if (isset($manyToOneElement['fetch'])) { |
| 444 | 444 | $association->setFetchMode( |
| 445 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
| 445 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
| 446 | 446 | ); |
| 447 | 447 | } |
| 448 | 448 | |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | // Check for owning side to consider join column |
| 571 | - if (! $association->isOwningSide()) { |
|
| 571 | + if ( ! $association->isOwningSide()) { |
|
| 572 | 572 | $metadata->addProperty($association); |
| 573 | 573 | |
| 574 | 574 | continue; |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | $fieldName = (string) $overrideElement['name']; |
| 614 | 614 | $property = $metadata->getProperty($fieldName); |
| 615 | 615 | |
| 616 | - if (! $property) { |
|
| 616 | + if ( ! $property) { |
|
| 617 | 617 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 618 | 618 | } |
| 619 | 619 | |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | // Check for fetch |
| 663 | 663 | if (isset($overrideElement['fetch'])) { |
| 664 | 664 | $override->setFetchMode( |
| 665 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
| 665 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
| 666 | 666 | ); |
| 667 | 667 | } |
| 668 | 668 | |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | // Evaluate <lifecycle-callbacks...> |
| 674 | 674 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
| 675 | 675 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
| 676 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
| 676 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
| 677 | 677 | $methodName = (string) $lifecycleCallback['method']; |
| 678 | 678 | |
| 679 | 679 | $metadata->addLifecycleCallback($eventName, $methodName); |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
| 686 | 686 | $listenerClassName = (string) $listenerElement['class']; |
| 687 | 687 | |
| 688 | - if (! class_exists($listenerClassName)) { |
|
| 688 | + if ( ! class_exists($listenerClassName)) { |
|
| 689 | 689 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 690 | 690 | $listenerClassName, |
| 691 | 691 | $metadata->getClassName() |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | return $this->classNames; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - if (! $this->paths) { |
|
| 216 | + if ( ! $this->paths) { |
|
| 217 | 217 | throw Mapping\MappingException::pathRequired(); |
| 218 | 218 | } |
| 219 | 219 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $includedFiles = []; |
| 222 | 222 | |
| 223 | 223 | foreach ($this->paths as $path) { |
| 224 | - if (! is_dir($path)) { |
|
| 224 | + if ( ! is_dir($path)) { |
|
| 225 | 225 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 226 | 226 | } |
| 227 | 227 | |
@@ -230,14 +230,14 @@ discard block |
||
| 230 | 230 | new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), |
| 231 | 231 | RecursiveIteratorIterator::LEAVES_ONLY |
| 232 | 232 | ), |
| 233 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 233 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 234 | 234 | RecursiveRegexIterator::GET_MATCH |
| 235 | 235 | ); |
| 236 | 236 | |
| 237 | 237 | foreach ($iterator as $file) { |
| 238 | 238 | $sourceFile = $file[0]; |
| 239 | 239 | |
| 240 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
| 240 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 241 | 241 | $sourceFile = realpath($sourceFile); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
| 416 | 416 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
| 417 | 417 | do { |
| 418 | - if (! $parent->isMappedSuperclass) { |
|
| 418 | + if ( ! $parent->isMappedSuperclass) { |
|
| 419 | 419 | $metadata->setTable($parent->table); |
| 420 | 420 | |
| 421 | 421 | break; |
@@ -605,15 +605,15 @@ discard block |
||
| 605 | 605 | $fieldMetadata->setVersioned($isVersioned); |
| 606 | 606 | $fieldMetadata->setColumnName($columnName); |
| 607 | 607 | |
| 608 | - if (! $metadata->isMappedSuperclass) { |
|
| 608 | + if ( ! $metadata->isMappedSuperclass) { |
|
| 609 | 609 | $fieldMetadata->setTableName($metadata->getTableName()); |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 612 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 613 | 613 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | - if (! empty($columnAnnot->length)) { |
|
| 616 | + if ( ! empty($columnAnnot->length)) { |
|
| 617 | 617 | $fieldMetadata->setLength($columnAnnot->length); |
| 618 | 618 | } |
| 619 | 619 | |
@@ -674,13 +674,13 @@ discard block |
||
| 674 | 674 | 'arguments' => $customGeneratorAnnot->arguments, |
| 675 | 675 | ]; |
| 676 | 676 | |
| 677 | - if (! isset($idGeneratorDefinition['class'])) { |
|
| 677 | + if ( ! isset($idGeneratorDefinition['class'])) { |
|
| 678 | 678 | throw new Mapping\MappingException( |
| 679 | 679 | sprintf('Cannot instantiate custom generator, no class has been defined') |
| 680 | 680 | ); |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | - if (! class_exists($idGeneratorDefinition['class'])) { |
|
| 683 | + if ( ! class_exists($idGeneratorDefinition['class'])) { |
|
| 684 | 684 | throw new Mapping\MappingException( |
| 685 | 685 | sprintf('Cannot instantiate custom generator : %s', var_export($idGeneratorDefinition, true)) |
| 686 | 686 | ); |
@@ -722,12 +722,12 @@ discard block |
||
| 722 | 722 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 723 | 723 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 724 | 724 | |
| 725 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 725 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 726 | 726 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 727 | 727 | $assocMetadata->setOwningSide(false); |
| 728 | 728 | } |
| 729 | 729 | |
| 730 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 730 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 731 | 731 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 732 | 732 | $assocMetadata->setOwningSide(true); |
| 733 | 733 | } |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | // Check for owning side to consider join column |
| 753 | - if (! $assocMetadata->isOwningSide()) { |
|
| 753 | + if ( ! $assocMetadata->isOwningSide()) { |
|
| 754 | 754 | return $assocMetadata; |
| 755 | 755 | } |
| 756 | 756 | |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 808 | 808 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 809 | 809 | |
| 810 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 810 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 811 | 811 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 812 | 812 | } |
| 813 | 813 | |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | $assocMetadata->setOwningSide(false); |
| 886 | 886 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 887 | 887 | |
| 888 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 888 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 889 | 889 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 890 | 890 | } |
| 891 | 891 | |
@@ -938,16 +938,16 @@ discard block |
||
| 938 | 938 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 939 | 939 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 940 | 940 | |
| 941 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 941 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 942 | 942 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 943 | 943 | $assocMetadata->setOwningSide(false); |
| 944 | 944 | } |
| 945 | 945 | |
| 946 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 946 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 947 | 947 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 948 | 948 | } |
| 949 | 949 | |
| 950 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 950 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 951 | 951 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 952 | 952 | } |
| 953 | 953 | |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | // Check for owning side to consider join column |
| 979 | - if (! $assocMetadata->isOwningSide()) { |
|
| 979 | + if ( ! $assocMetadata->isOwningSide()) { |
|
| 980 | 980 | return $assocMetadata; |
| 981 | 981 | } |
| 982 | 982 | |
@@ -1010,15 +1010,15 @@ discard block |
||
| 1010 | 1010 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 1011 | 1011 | $fieldMetadata->setVersioned($isVersioned); |
| 1012 | 1012 | |
| 1013 | - if (! empty($columnAnnot->name)) { |
|
| 1013 | + if ( ! empty($columnAnnot->name)) { |
|
| 1014 | 1014 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 1015 | 1015 | } |
| 1016 | 1016 | |
| 1017 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 1017 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 1018 | 1018 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | - if (! empty($columnAnnot->length)) { |
|
| 1021 | + if ( ! empty($columnAnnot->length)) { |
|
| 1022 | 1022 | $fieldMetadata->setLength($columnAnnot->length); |
| 1023 | 1023 | } |
| 1024 | 1024 | |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | ]; |
| 1095 | 1095 | |
| 1096 | 1096 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1097 | - if (! class_exists($listenerClassName)) { |
|
| 1097 | + if ( ! class_exists($listenerClassName)) { |
|
| 1098 | 1098 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1099 | 1099 | $listenerClassName, |
| 1100 | 1100 | $metadata->getClassName() |
@@ -1136,7 +1136,7 @@ discard block |
||
| 1136 | 1136 | $fieldName = $associationOverride->name; |
| 1137 | 1137 | $property = $metadata->getProperty($fieldName); |
| 1138 | 1138 | |
| 1139 | - if (! $property) { |
|
| 1139 | + if ( ! $property) { |
|
| 1140 | 1140 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1141 | 1141 | } |
| 1142 | 1142 | |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | // Check for fetch |
| 1184 | 1184 | if ($associationOverride->fetch) { |
| 1185 | 1185 | $override->setFetchMode( |
| 1186 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1186 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1187 | 1187 | ); |
| 1188 | 1188 | } |
| 1189 | 1189 | |
@@ -1250,7 +1250,7 @@ discard block |
||
| 1250 | 1250 | { |
| 1251 | 1251 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1252 | 1252 | |
| 1253 | - if (! defined($fetchModeConstant)) { |
|
| 1253 | + if ( ! defined($fetchModeConstant)) { |
|
| 1254 | 1254 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1255 | 1255 | } |
| 1256 | 1256 | |
@@ -1265,7 +1265,7 @@ discard block |
||
| 1265 | 1265 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1266 | 1266 | |
| 1267 | 1267 | foreach ($classAnnotations as $key => $annot) { |
| 1268 | - if (! is_numeric($key)) { |
|
| 1268 | + if ( ! is_numeric($key)) { |
|
| 1269 | 1269 | continue; |
| 1270 | 1270 | } |
| 1271 | 1271 | |
@@ -1283,7 +1283,7 @@ discard block |
||
| 1283 | 1283 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1284 | 1284 | |
| 1285 | 1285 | foreach ($propertyAnnotations as $key => $annot) { |
| 1286 | - if (! is_numeric($key)) { |
|
| 1286 | + if ( ! is_numeric($key)) { |
|
| 1287 | 1287 | continue; |
| 1288 | 1288 | } |
| 1289 | 1289 | |
@@ -1301,7 +1301,7 @@ discard block |
||
| 1301 | 1301 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1302 | 1302 | |
| 1303 | 1303 | foreach ($methodAnnotations as $key => $annot) { |
| 1304 | - if (! is_numeric($key)) { |
|
| 1304 | + if ( ! is_numeric($key)) { |
|
| 1305 | 1305 | continue; |
| 1306 | 1306 | } |
| 1307 | 1307 | |