@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Mapping\Driver; |
6 | 6 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | return $this->classNames; |
202 | 202 | } |
203 | 203 | |
204 | - if (! $this->paths) { |
|
204 | + if ( ! $this->paths) { |
|
205 | 205 | throw Mapping\MappingException::pathRequired(); |
206 | 206 | } |
207 | 207 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $includedFiles = []; |
210 | 210 | |
211 | 211 | foreach ($this->paths as $path) { |
212 | - if (! is_dir($path)) { |
|
212 | + if ( ! is_dir($path)) { |
|
213 | 213 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
214 | 214 | } |
215 | 215 | |
@@ -218,14 +218,14 @@ discard block |
||
218 | 218 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
219 | 219 | \RecursiveIteratorIterator::LEAVES_ONLY |
220 | 220 | ), |
221 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
221 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
222 | 222 | \RecursiveRegexIterator::GET_MATCH |
223 | 223 | ); |
224 | 224 | |
225 | 225 | foreach ($iterator as $file) { |
226 | 226 | $sourceFile = $file[0]; |
227 | 227 | |
228 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
228 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
229 | 229 | $sourceFile = realpath($sourceFile); |
230 | 230 | } |
231 | 231 | |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | ) : Mapping\ClassMetadata { |
275 | 275 | $reflectionClass = $metadata->getReflectionClass(); |
276 | 276 | |
277 | - if (! $reflectionClass) { |
|
277 | + if ( ! $reflectionClass) { |
|
278 | 278 | // this happens when running annotation driver in combination with |
279 | 279 | // static reflection services. This is not the nicest fix |
280 | 280 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | ); |
320 | 320 | } |
321 | 321 | |
322 | - if (! $property) { |
|
322 | + if ( ! $property) { |
|
323 | 323 | continue; |
324 | 324 | } |
325 | 325 | |
@@ -614,12 +614,12 @@ discard block |
||
614 | 614 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
615 | 615 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
616 | 616 | |
617 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
617 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
618 | 618 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
619 | 619 | $assocMetadata->setOwningSide(false); |
620 | 620 | } |
621 | 621 | |
622 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
622 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
623 | 623 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
624 | 624 | } |
625 | 625 | |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
677 | 677 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
678 | 678 | |
679 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
679 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
680 | 680 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
681 | 681 | } |
682 | 682 | |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | $assocMetadata->setOwningSide(false); |
737 | 737 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
738 | 738 | |
739 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
739 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
740 | 740 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
741 | 741 | } |
742 | 742 | |
@@ -778,16 +778,16 @@ discard block |
||
778 | 778 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
779 | 779 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
780 | 780 | |
781 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
781 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
782 | 782 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
783 | 783 | $assocMetadata->setOwningSide(false); |
784 | 784 | } |
785 | 785 | |
786 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
786 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
787 | 787 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
788 | 788 | } |
789 | 789 | |
790 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
790 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
791 | 791 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
792 | 792 | } |
793 | 793 | |
@@ -831,15 +831,15 @@ discard block |
||
831 | 831 | |
832 | 832 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
833 | 833 | |
834 | - if (! empty($columnAnnot->name)) { |
|
834 | + if ( ! empty($columnAnnot->name)) { |
|
835 | 835 | $fieldMetadata->setColumnName($columnAnnot->name); |
836 | 836 | } |
837 | 837 | |
838 | - if (! empty($columnAnnot->columnDefinition)) { |
|
838 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
839 | 839 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
840 | 840 | } |
841 | 841 | |
842 | - if (! empty($columnAnnot->length)) { |
|
842 | + if ( ! empty($columnAnnot->length)) { |
|
843 | 843 | $fieldMetadata->setLength($columnAnnot->length); |
844 | 844 | } |
845 | 845 | |
@@ -862,11 +862,11 @@ discard block |
||
862 | 862 | Annotation\Table $tableAnnot, |
863 | 863 | Mapping\TableMetadata $tableMetadata |
864 | 864 | ) : void { |
865 | - if (! empty($tableAnnot->name)) { |
|
865 | + if ( ! empty($tableAnnot->name)) { |
|
866 | 866 | $tableMetadata->setName($tableAnnot->name); |
867 | 867 | } |
868 | 868 | |
869 | - if (! empty($tableAnnot->schema)) { |
|
869 | + if ( ! empty($tableAnnot->schema)) { |
|
870 | 870 | $tableMetadata->setSchema($tableAnnot->schema); |
871 | 871 | } |
872 | 872 | |
@@ -902,11 +902,11 @@ discard block |
||
902 | 902 | ) : Mapping\JoinTableMetadata { |
903 | 903 | $joinTable = new Mapping\JoinTableMetadata(); |
904 | 904 | |
905 | - if (! empty($joinTableAnnot->name)) { |
|
905 | + if ( ! empty($joinTableAnnot->name)) { |
|
906 | 906 | $joinTable->setName($joinTableAnnot->name); |
907 | 907 | } |
908 | 908 | |
909 | - if (! empty($joinTableAnnot->schema)) { |
|
909 | + if ( ! empty($joinTableAnnot->schema)) { |
|
910 | 910 | $joinTable->setSchema($joinTableAnnot->schema); |
911 | 911 | } |
912 | 912 | |
@@ -934,22 +934,22 @@ discard block |
||
934 | 934 | $joinColumn = new Mapping\JoinColumnMetadata(); |
935 | 935 | |
936 | 936 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
937 | - if (! empty($joinColumnAnnot->name)) { |
|
937 | + if ( ! empty($joinColumnAnnot->name)) { |
|
938 | 938 | $joinColumn->setColumnName($joinColumnAnnot->name); |
939 | 939 | } |
940 | 940 | |
941 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
941 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
942 | 942 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
943 | 943 | } |
944 | 944 | |
945 | 945 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
946 | 946 | $joinColumn->setUnique($joinColumnAnnot->unique); |
947 | 947 | |
948 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
948 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
949 | 949 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
950 | 950 | } |
951 | 951 | |
952 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
952 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
953 | 953 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
954 | 954 | } |
955 | 955 | |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | $fieldName = null |
972 | 972 | ) : Mapping\CacheMetadata { |
973 | 973 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
974 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
974 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
975 | 975 | |
976 | 976 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
977 | 977 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
1033 | 1033 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
1034 | 1034 | do { |
1035 | - if (! $parent->isMappedSuperclass) { |
|
1035 | + if ( ! $parent->isMappedSuperclass) { |
|
1036 | 1036 | $metadata->setTable($parent->table); |
1037 | 1037 | |
1038 | 1038 | break; |
@@ -1087,11 +1087,11 @@ discard block |
||
1087 | 1087 | $discriminatorColumn->setType(Type::getType($typeName)); |
1088 | 1088 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
1089 | 1089 | |
1090 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
1090 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
1091 | 1091 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
1092 | 1092 | } |
1093 | 1093 | |
1094 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
1094 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
1095 | 1095 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
1096 | 1096 | } |
1097 | 1097 | } |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
1180 | 1180 | |
1181 | 1181 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
1182 | - if (! class_exists($listenerClassName)) { |
|
1182 | + if ( ! class_exists($listenerClassName)) { |
|
1183 | 1183 | throw Mapping\MappingException::entityListenerClassNotFound( |
1184 | 1184 | $listenerClassName, |
1185 | 1185 | $metadata->getClassName() |
@@ -1216,7 +1216,7 @@ discard block |
||
1216 | 1216 | $fieldName = $associationOverride->name; |
1217 | 1217 | $property = $metadata->getProperty($fieldName); |
1218 | 1218 | |
1219 | - if (! $property) { |
|
1219 | + if ( ! $property) { |
|
1220 | 1220 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
1221 | 1221 | } |
1222 | 1222 | |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | // Check for fetch |
1251 | 1251 | if ($associationOverride->fetch) { |
1252 | 1252 | $override->setFetchMode( |
1253 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
1253 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
1254 | 1254 | ); |
1255 | 1255 | } |
1256 | 1256 | |
@@ -1339,7 +1339,7 @@ discard block |
||
1339 | 1339 | { |
1340 | 1340 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
1341 | 1341 | |
1342 | - if (! defined($fetchModeConstant)) { |
|
1342 | + if ( ! defined($fetchModeConstant)) { |
|
1343 | 1343 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
1344 | 1344 | } |
1345 | 1345 | |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
1386 | 1386 | |
1387 | 1387 | foreach ($classAnnotations as $key => $annot) { |
1388 | - if (! is_numeric($key)) { |
|
1388 | + if ( ! is_numeric($key)) { |
|
1389 | 1389 | continue; |
1390 | 1390 | } |
1391 | 1391 | |
@@ -1403,7 +1403,7 @@ discard block |
||
1403 | 1403 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
1404 | 1404 | |
1405 | 1405 | foreach ($propertyAnnotations as $key => $annot) { |
1406 | - if (! is_numeric($key)) { |
|
1406 | + if ( ! is_numeric($key)) { |
|
1407 | 1407 | continue; |
1408 | 1408 | } |
1409 | 1409 | |
@@ -1421,7 +1421,7 @@ discard block |
||
1421 | 1421 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
1422 | 1422 | |
1423 | 1423 | foreach ($methodAnnotations as $key => $annot) { |
1424 | - if (! is_numeric($key)) { |
|
1424 | + if ( ! is_numeric($key)) { |
|
1425 | 1425 | continue; |
1426 | 1426 | } |
1427 | 1427 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Mapping; |
6 | 6 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | */ |
297 | 297 | public function __toString() |
298 | 298 | { |
299 | - return __CLASS__ . '@' . spl_object_id($this); |
|
299 | + return __CLASS__.'@'.spl_object_id($this); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | // Restore ReflectionClass and properties |
392 | 392 | $this->reflectionClass = $reflectionService->getClass($this->className); |
393 | 393 | |
394 | - if (! $this->reflectionClass) { |
|
394 | + if ( ! $this->reflectionClass) { |
|
395 | 395 | return; |
396 | 396 | } |
397 | 397 | |
@@ -415,11 +415,11 @@ discard block |
||
415 | 415 | } |
416 | 416 | |
417 | 417 | // Verify & complete identifier mapping |
418 | - if (! $this->identifier) { |
|
418 | + if ( ! $this->identifier) { |
|
419 | 419 | throw MappingException::identifierRequired($this->className); |
420 | 420 | } |
421 | 421 | |
422 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
422 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
423 | 423 | return $property instanceof FieldMetadata |
424 | 424 | && $property->isPrimaryKey() |
425 | 425 | && $property->hasValueGenerator(); |
@@ -438,14 +438,14 @@ discard block |
||
438 | 438 | public function validateAssociations() : void |
439 | 439 | { |
440 | 440 | array_map( |
441 | - function (Property $property) { |
|
442 | - if (! ($property instanceof AssociationMetadata)) { |
|
441 | + function(Property $property) { |
|
442 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
443 | 443 | return; |
444 | 444 | } |
445 | 445 | |
446 | 446 | $targetEntity = $property->getTargetEntity(); |
447 | 447 | |
448 | - if (! class_exists($targetEntity)) { |
|
448 | + if ( ! class_exists($targetEntity)) { |
|
449 | 449 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
450 | 450 | } |
451 | 451 | }, |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | foreach ($this->lifecycleCallbacks as $callbacks) { |
464 | 464 | /** @var array $callbacks */ |
465 | 465 | foreach ($callbacks as $callbackFuncName) { |
466 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
466 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
467 | 467 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
468 | 468 | } |
469 | 469 | } |
@@ -487,11 +487,11 @@ discard block |
||
487 | 487 | */ |
488 | 488 | public function isIdentifier(string $fieldName) : bool |
489 | 489 | { |
490 | - if (! $this->identifier) { |
|
490 | + if ( ! $this->identifier) { |
|
491 | 491 | return false; |
492 | 492 | } |
493 | 493 | |
494 | - if (! $this->isIdentifierComposite()) { |
|
494 | + if ( ! $this->isIdentifierComposite()) { |
|
495 | 495 | return $fieldName === $this->identifier[0]; |
496 | 496 | } |
497 | 497 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | */ |
517 | 517 | public function getNamedNativeQuery($queryName) : array |
518 | 518 | { |
519 | - if (! isset($this->namedNativeQueries[$queryName])) { |
|
519 | + if ( ! isset($this->namedNativeQueries[$queryName])) { |
|
520 | 520 | throw MappingException::queryNotFound($this->className, $queryName); |
521 | 521 | } |
522 | 522 | |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | */ |
547 | 547 | public function getSqlResultSetMapping($name) |
548 | 548 | { |
549 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
549 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
550 | 550 | throw MappingException::resultMappingNotFound($this->className, $name); |
551 | 551 | } |
552 | 552 | |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | $property->setColumnName($columnName); |
580 | 580 | } |
581 | 581 | |
582 | - if (! $this->isMappedSuperclass) { |
|
582 | + if ( ! $this->isMappedSuperclass) { |
|
583 | 583 | $property->setTableName($this->getTableName()); |
584 | 584 | } |
585 | 585 | |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($this->className, $property); |
600 | 600 | } |
601 | 601 | |
602 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
602 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
603 | 603 | $this->identifier[] = $fieldName; |
604 | 604 | } |
605 | 605 | } |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | $fieldName = $property->getName(); |
650 | 650 | $targetEntity = $property->getTargetEntity(); |
651 | 651 | |
652 | - if (! $targetEntity) { |
|
652 | + if ( ! $targetEntity) { |
|
653 | 653 | throw MappingException::missingTargetEntity($fieldName); |
654 | 654 | } |
655 | 655 | |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName); |
663 | 663 | } |
664 | 664 | |
665 | - if (! in_array($property->getName(), $this->identifier, true)) { |
|
665 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
666 | 666 | if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) { |
667 | 667 | throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( |
668 | 668 | $property->getTargetEntity(), |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | /** @var JoinColumnMetadata $joinColumn */ |
725 | 725 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
726 | 726 | if (count($property->getJoinColumns()) === 1) { |
727 | - if (! $property->isPrimaryKey()) { |
|
727 | + if ( ! $property->isPrimaryKey()) { |
|
728 | 728 | $joinColumn->setUnique(true); |
729 | 729 | } |
730 | 730 | } else { |
@@ -732,13 +732,13 @@ discard block |
||
732 | 732 | } |
733 | 733 | } |
734 | 734 | |
735 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
735 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
736 | 736 | |
737 | - if (! $joinColumn->getColumnName()) { |
|
737 | + if ( ! $joinColumn->getColumnName()) { |
|
738 | 738 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
739 | 739 | } |
740 | 740 | |
741 | - if (! $joinColumn->getReferencedColumnName()) { |
|
741 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
742 | 742 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
743 | 743 | } |
744 | 744 | |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | } |
747 | 747 | |
748 | 748 | if ($uniqueConstraintColumns) { |
749 | - if (! $this->table) { |
|
749 | + if ( ! $this->table) { |
|
750 | 750 | throw new \RuntimeException( |
751 | 751 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
752 | 752 | ); |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | if ($property->isOrphanRemoval()) { |
767 | 767 | $cascades = $property->getCascade(); |
768 | 768 | |
769 | - if (! in_array('remove', $cascades, true)) { |
|
769 | + if ( ! in_array('remove', $cascades, true)) { |
|
770 | 770 | $cascades[] = 'remove'; |
771 | 771 | |
772 | 772 | $property->setCascade($cascades); |
@@ -829,14 +829,14 @@ discard block |
||
829 | 829 | protected function validateAndCompleteOneToManyMapping(OneToManyAssociationMetadata $property) |
830 | 830 | { |
831 | 831 | // OneToMany MUST have mappedBy |
832 | - if (! $property->getMappedBy()) { |
|
832 | + if ( ! $property->getMappedBy()) { |
|
833 | 833 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
834 | 834 | } |
835 | 835 | |
836 | 836 | if ($property->isOrphanRemoval()) { |
837 | 837 | $cascades = $property->getCascade(); |
838 | 838 | |
839 | - if (! in_array('remove', $cascades, true)) { |
|
839 | + if ( ! in_array('remove', $cascades, true)) { |
|
840 | 840 | $cascades[] = 'remove'; |
841 | 841 | |
842 | 842 | $property->setCascade($cascades); |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | |
860 | 860 | $property->setJoinTable($joinTable); |
861 | 861 | |
862 | - if (! $joinTable->getName()) { |
|
862 | + if ( ! $joinTable->getName()) { |
|
863 | 863 | $joinTableName = $this->namingStrategy->joinTableName( |
864 | 864 | $property->getSourceEntity(), |
865 | 865 | $property->getTargetEntity(), |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | |
872 | 872 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
873 | 873 | |
874 | - if (! $joinTable->getJoinColumns()) { |
|
874 | + if ( ! $joinTable->getJoinColumns()) { |
|
875 | 875 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
876 | 876 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
877 | 877 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | $joinTable->addJoinColumn($joinColumn); |
885 | 885 | } |
886 | 886 | |
887 | - if (! $joinTable->getInverseJoinColumns()) { |
|
887 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
888 | 888 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
889 | 889 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
890 | 890 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -899,13 +899,13 @@ discard block |
||
899 | 899 | |
900 | 900 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
901 | 901 | /** @var JoinColumnMetadata $joinColumn */ |
902 | - if (! $joinColumn->getReferencedColumnName()) { |
|
902 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
903 | 903 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
904 | 904 | } |
905 | 905 | |
906 | 906 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
907 | 907 | |
908 | - if (! $joinColumn->getColumnName()) { |
|
908 | + if ( ! $joinColumn->getColumnName()) { |
|
909 | 909 | $columnName = $this->namingStrategy->joinKeyColumnName( |
910 | 910 | $property->getSourceEntity(), |
911 | 911 | $referencedColumnName |
@@ -917,13 +917,13 @@ discard block |
||
917 | 917 | |
918 | 918 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
919 | 919 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
920 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
920 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
921 | 921 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
922 | 922 | } |
923 | 923 | |
924 | 924 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
925 | 925 | |
926 | - if (! $inverseJoinColumn->getColumnName()) { |
|
926 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
927 | 927 | $columnName = $this->namingStrategy->joinKeyColumnName( |
928 | 928 | $property->getTargetEntity(), |
929 | 929 | $referencedColumnName |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
958 | 958 | } |
959 | 959 | |
960 | - if (! isset($this->identifier[0])) { |
|
960 | + if ( ! isset($this->identifier[0])) { |
|
961 | 961 | throw MappingException::noIdDefined($this->className); |
962 | 962 | } |
963 | 963 | |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | // Association defined as Id field |
1017 | 1017 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1018 | 1018 | |
1019 | - if (! $property->isOwningSide()) { |
|
1019 | + if ( ! $property->isOwningSide()) { |
|
1020 | 1020 | $property = $targetClass->getProperty($property->getMappedBy()); |
1021 | 1021 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1022 | 1022 | } |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | $columnName = $joinColumn->getColumnName(); |
1032 | 1032 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1033 | 1033 | |
1034 | - if (! $joinColumn->getType()) { |
|
1034 | + if ( ! $joinColumn->getType()) { |
|
1035 | 1035 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
1036 | 1036 | } |
1037 | 1037 | |
@@ -1065,11 +1065,11 @@ discard block |
||
1065 | 1065 | { |
1066 | 1066 | $schema = $this->getSchemaName() === null |
1067 | 1067 | ? '' |
1068 | - : $this->getSchemaName() . '_' |
|
1068 | + : $this->getSchemaName().'_' |
|
1069 | 1069 | ; |
1070 | 1070 | |
1071 | 1071 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
1072 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
1072 | + return $schema.$this->getTableName().'_id_tmp'; |
|
1073 | 1073 | } |
1074 | 1074 | |
1075 | 1075 | /** |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | */ |
1104 | 1104 | public function setInheritanceType($type) : void |
1105 | 1105 | { |
1106 | - if (! $this->isInheritanceType($type)) { |
|
1106 | + if ( ! $this->isInheritanceType($type)) { |
|
1107 | 1107 | throw MappingException::invalidInheritanceType($this->className, $type); |
1108 | 1108 | } |
1109 | 1109 | |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | { |
1122 | 1122 | $fieldName = $property->getName(); |
1123 | 1123 | |
1124 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1124 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1125 | 1125 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1126 | 1126 | } |
1127 | 1127 | |
@@ -1318,7 +1318,7 @@ discard block |
||
1318 | 1318 | $declaringClass = $property->getDeclaringClass(); |
1319 | 1319 | |
1320 | 1320 | if ($inheritedProperty instanceof FieldMetadata) { |
1321 | - if (! $declaringClass->isMappedSuperclass) { |
|
1321 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1322 | 1322 | $inheritedProperty->setTableName($property->getTableName()); |
1323 | 1323 | } |
1324 | 1324 | |
@@ -1362,7 +1362,7 @@ discard block |
||
1362 | 1362 | throw MappingException::duplicateQueryMapping($this->className, $name); |
1363 | 1363 | } |
1364 | 1364 | |
1365 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1365 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1366 | 1366 | throw MappingException::missingQueryMapping($this->className, $name); |
1367 | 1367 | } |
1368 | 1368 | |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | */ |
1380 | 1380 | public function addSqlResultSetMapping(array $resultMapping) |
1381 | 1381 | { |
1382 | - if (! isset($resultMapping['name'])) { |
|
1382 | + if ( ! isset($resultMapping['name'])) { |
|
1383 | 1383 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
1384 | 1384 | } |
1385 | 1385 | |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | |
1390 | 1390 | if (isset($resultMapping['entities'])) { |
1391 | 1391 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
1392 | - if (! isset($entityResult['entityClass'])) { |
|
1392 | + if ( ! isset($entityResult['entityClass'])) { |
|
1393 | 1393 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
1394 | 1394 | } |
1395 | 1395 | |
@@ -1398,11 +1398,11 @@ discard block |
||
1398 | 1398 | |
1399 | 1399 | if (isset($entityResult['fields'])) { |
1400 | 1400 | foreach ($entityResult['fields'] as $k => $field) { |
1401 | - if (! isset($field['name'])) { |
|
1401 | + if ( ! isset($field['name'])) { |
|
1402 | 1402 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
1403 | 1403 | } |
1404 | 1404 | |
1405 | - if (! isset($field['column'])) { |
|
1405 | + if ( ! isset($field['column'])) { |
|
1406 | 1406 | $fieldName = $field['name']; |
1407 | 1407 | |
1408 | 1408 | if (strpos($fieldName, '.')) { |
@@ -1500,11 +1500,11 @@ discard block |
||
1500 | 1500 | 'method' => $method, |
1501 | 1501 | ]; |
1502 | 1502 | |
1503 | - if (! class_exists($class)) { |
|
1503 | + if ( ! class_exists($class)) { |
|
1504 | 1504 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1505 | 1505 | } |
1506 | 1506 | |
1507 | - if (! method_exists($class, $method)) { |
|
1507 | + if ( ! method_exists($class, $method)) { |
|
1508 | 1508 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1509 | 1509 | } |
1510 | 1510 | |
@@ -1571,7 +1571,7 @@ discard block |
||
1571 | 1571 | return; |
1572 | 1572 | } |
1573 | 1573 | |
1574 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1574 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1575 | 1575 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1576 | 1576 | } |
1577 | 1577 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Mapping\Exporter; |
6 | 6 | |
@@ -24,33 +24,33 @@ discard block |
||
24 | 24 | $cacheExporter = new CacheMetadataExporter(); |
25 | 25 | $variableExporter = new VariableExporter(); |
26 | 26 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
27 | - $objectReference = $indentation . static::VARIABLE; |
|
27 | + $objectReference = $indentation.static::VARIABLE; |
|
28 | 28 | $cascade = $this->resolveCascade($value->getCascade()); |
29 | 29 | $lines = []; |
30 | 30 | |
31 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
31 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
32 | 32 | |
33 | - if (! empty($value->getCache())) { |
|
33 | + if ( ! empty($value->getCache())) { |
|
34 | 34 | $lines[] = $cacheExporter->export($value->getCache(), $indentationLevel); |
35 | 35 | $lines[] = null; |
36 | - $lines[] = $objectReference . '->setCache(' . $cacheExporter::VARIABLE . ');'; |
|
36 | + $lines[] = $objectReference.'->setCache('.$cacheExporter::VARIABLE.');'; |
|
37 | 37 | } |
38 | 38 | |
39 | - if (! empty($value->getMappedBy())) { |
|
40 | - $lines[] = $objectReference . '->setMappedBy("' . $value->getMappedBy() . '");'; |
|
41 | - $lines[] = $objectReference . '->setOwningSide(false);'; |
|
39 | + if ( ! empty($value->getMappedBy())) { |
|
40 | + $lines[] = $objectReference.'->setMappedBy("'.$value->getMappedBy().'");'; |
|
41 | + $lines[] = $objectReference.'->setOwningSide(false);'; |
|
42 | 42 | } |
43 | 43 | |
44 | - if (! empty($value->getInversedBy())) { |
|
45 | - $lines[] = $objectReference . '->setInversedBy("' . $value->getInversedBy() . '");'; |
|
44 | + if ( ! empty($value->getInversedBy())) { |
|
45 | + $lines[] = $objectReference.'->setInversedBy("'.$value->getInversedBy().'");'; |
|
46 | 46 | } |
47 | 47 | |
48 | - $lines[] = $objectReference . '->setSourceEntity("' . $value->getSourceEntity() . '");'; |
|
49 | - $lines[] = $objectReference . '->setTargetEntity("' . $value->getTargetEntity() . '");'; |
|
50 | - $lines[] = $objectReference . '->setFetchMode(Mapping\FetchMode::' . strtoupper($value->getFetchMode()) . '");'; |
|
51 | - $lines[] = $objectReference . '->setCascade(' . $variableExporter->export($cascade, $indentationLevel + 1) . ');'; |
|
52 | - $lines[] = $objectReference . '->setOrphanRemoval(' . $variableExporter->export($value->isOrphanRemoval(), $indentationLevel + 1) . ');'; |
|
53 | - $lines[] = $objectReference . '->setPrimaryKey(' . $variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1) . ');'; |
|
48 | + $lines[] = $objectReference.'->setSourceEntity("'.$value->getSourceEntity().'");'; |
|
49 | + $lines[] = $objectReference.'->setTargetEntity("'.$value->getTargetEntity().'");'; |
|
50 | + $lines[] = $objectReference.'->setFetchMode(Mapping\FetchMode::'.strtoupper($value->getFetchMode()).'");'; |
|
51 | + $lines[] = $objectReference.'->setCascade('.$variableExporter->export($cascade, $indentationLevel + 1).');'; |
|
52 | + $lines[] = $objectReference.'->setOrphanRemoval('.$variableExporter->export($value->isOrphanRemoval(), $indentationLevel + 1).');'; |
|
53 | + $lines[] = $objectReference.'->setPrimaryKey('.$variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1).');'; |
|
54 | 54 | |
55 | 55 | return implode(PHP_EOL, $lines); |
56 | 56 | } |