@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Mapping; |
| 7 | 7 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param null|string $name |
| 41 | 41 | * @param null|string $schema |
| 42 | 42 | */ |
| 43 | - public function __construct(?string $name = null, ?string $schema = null) |
|
| 43 | + public function __construct(? string $name = null, ? string $schema = null) |
|
| 44 | 44 | { |
| 45 | 45 | $this->name = $name; |
| 46 | 46 | $this->schema = $schema; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * @return string|null |
| 51 | 51 | */ |
| 52 | - public function getSchema() : ?string |
|
| 52 | + public function getSchema() : ? string |
|
| 53 | 53 | { |
| 54 | 54 | return $this->schema; |
| 55 | 55 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | /** |
| 74 | 74 | * @return string|null |
| 75 | 75 | */ |
| 76 | - public function getName() : ?string |
|
| 76 | + public function getName() : ? string |
|
| 77 | 77 | { |
| 78 | 78 | return $this->name; |
| 79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function getQuotedQualifiedName(AbstractPlatform $platform) : string |
| 87 | 87 | { |
| 88 | - if (!$this->schema) { |
|
| 88 | + if ( ! $this->schema) { |
|
| 89 | 89 | return $platform->quoteIdentifier($this->name); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | public function addIndex(array $index) : void |
| 174 | 174 | { |
| 175 | - if (! isset($index['name'])) { |
|
| 175 | + if ( ! isset($index['name'])) { |
|
| 176 | 176 | $this->indexes[] = $index; |
| 177 | 177 | |
| 178 | 178 | return; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | public function addUniqueConstraint(array $constraint) : void |
| 216 | 216 | { |
| 217 | - if (! isset($constraint['name'])) { |
|
| 217 | + if ( ! isset($constraint['name'])) { |
|
| 218 | 218 | $this->uniqueConstraints[] = $constraint; |
| 219 | 219 | |
| 220 | 220 | return; |
@@ -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 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | return $this->classNames; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if (!$this->paths) { |
|
| 188 | + if ( ! $this->paths) { |
|
| 189 | 189 | throw Mapping\MappingException::pathRequired(); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 203 | 203 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 204 | 204 | ), |
| 205 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 205 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 206 | 206 | \RecursiveRegexIterator::GET_MATCH |
| 207 | 207 | ); |
| 208 | 208 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | { |
| 255 | 255 | $reflectionClass = $metadata->getReflectionClass(); |
| 256 | 256 | |
| 257 | - if (! $reflectionClass) { |
|
| 257 | + if ( ! $reflectionClass) { |
|
| 258 | 258 | // this happens when running annotation driver in combination with |
| 259 | 259 | // static reflection services. This is not the nicest fix |
| 260 | 260 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $classMetadata |
| 291 | 291 | ); |
| 292 | 292 | |
| 293 | - if (! $property) { |
|
| 293 | + if ( ! $property) { |
|
| 294 | 294 | continue; |
| 295 | 295 | } |
| 296 | 296 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | ) |
| 369 | 369 | { |
| 370 | 370 | /** @var Annotation\Entity $entityAnnot */ |
| 371 | - $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
| 371 | + $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
| 372 | 372 | |
| 373 | 373 | if ($entityAnnot->repositoryClass !== null) { |
| 374 | 374 | $metadata->setCustomRepositoryClassName( |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | array $propertyAnnotations, |
| 481 | 481 | \ReflectionProperty $reflectionProperty, |
| 482 | 482 | Mapping\ClassMetadata $metadata |
| 483 | - ) : ?Mapping\Property |
|
| 483 | + ) : ? Mapping\Property |
|
| 484 | 484 | { |
| 485 | 485 | switch (true) { |
| 486 | 486 | case isset($propertyAnnotations[Annotation\Column::class]): |
@@ -624,11 +624,11 @@ discard block |
||
| 624 | 624 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 625 | 625 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 626 | 626 | |
| 627 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 627 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 628 | 628 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 631 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 632 | 632 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 633 | 633 | } |
| 634 | 634 | |
@@ -682,13 +682,13 @@ discard block |
||
| 682 | 682 | $fieldName = $reflectionProperty->getName(); |
| 683 | 683 | $manyToOneAnnot = $propertyAnnotations[Annotation\ManyToOne::class]; |
| 684 | 684 | $assocMetadata = new Mapping\ManyToOneAssociationMetadata($fieldName); |
| 685 | - $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity); |
|
| 685 | + $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity); |
|
| 686 | 686 | |
| 687 | 687 | $assocMetadata->setTargetEntity($targetEntity); |
| 688 | 688 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 689 | 689 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 690 | 690 | |
| 691 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 691 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 692 | 692 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 693 | 693 | } |
| 694 | 694 | |
@@ -744,18 +744,18 @@ discard block |
||
| 744 | 744 | $fieldName = $reflectionProperty->getName(); |
| 745 | 745 | $oneToManyAnnot = $propertyAnnotations[Annotation\OneToMany::class]; |
| 746 | 746 | $assocMetadata = new Mapping\OneToManyAssociationMetadata($fieldName); |
| 747 | - $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity); |
|
| 747 | + $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity); |
|
| 748 | 748 | |
| 749 | 749 | $assocMetadata->setTargetEntity($targetEntity); |
| 750 | 750 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $oneToManyAnnot->cascade)); |
| 751 | 751 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 752 | 752 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 753 | 753 | |
| 754 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 754 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 755 | 755 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 758 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 759 | 759 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 760 | 760 | } |
| 761 | 761 | |
@@ -802,15 +802,15 @@ discard block |
||
| 802 | 802 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 803 | 803 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 804 | 804 | |
| 805 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 805 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 806 | 806 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 807 | 807 | } |
| 808 | 808 | |
| 809 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 809 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 810 | 810 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 813 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 814 | 814 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 815 | 815 | } |
| 816 | 816 | |
@@ -861,15 +861,15 @@ discard block |
||
| 861 | 861 | |
| 862 | 862 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 863 | 863 | |
| 864 | - if (! empty($columnAnnot->name)) { |
|
| 864 | + if ( ! empty($columnAnnot->name)) { |
|
| 865 | 865 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 866 | 866 | } |
| 867 | 867 | |
| 868 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 868 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 869 | 869 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | - if (! empty($columnAnnot->length)) { |
|
| 872 | + if ( ! empty($columnAnnot->length)) { |
|
| 873 | 873 | $fieldMetadata->setLength($columnAnnot->length); |
| 874 | 874 | } |
| 875 | 875 | |
@@ -898,11 +898,11 @@ discard block |
||
| 898 | 898 | Mapping\TableMetadata $tableMetadata |
| 899 | 899 | ) : void |
| 900 | 900 | { |
| 901 | - if (! empty($tableAnnot->name)) { |
|
| 901 | + if ( ! empty($tableAnnot->name)) { |
|
| 902 | 902 | $tableMetadata->setName($tableAnnot->name); |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | - if (! empty($tableAnnot->schema)) { |
|
| 905 | + if ( ! empty($tableAnnot->schema)) { |
|
| 906 | 906 | $tableMetadata->setSchema($tableAnnot->schema); |
| 907 | 907 | } |
| 908 | 908 | |
@@ -943,11 +943,11 @@ discard block |
||
| 943 | 943 | { |
| 944 | 944 | $joinTable = new Mapping\JoinTableMetadata(); |
| 945 | 945 | |
| 946 | - if (! empty($joinTableAnnot->name)) { |
|
| 946 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 947 | 947 | $joinTable->setName($joinTableAnnot->name); |
| 948 | 948 | } |
| 949 | 949 | |
| 950 | - if (! empty($joinTableAnnot->schema)) { |
|
| 950 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 951 | 951 | $joinTable->setSchema($joinTableAnnot->schema); |
| 952 | 952 | } |
| 953 | 953 | |
@@ -980,22 +980,22 @@ discard block |
||
| 980 | 980 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 981 | 981 | |
| 982 | 982 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 983 | - if (! empty($joinColumnAnnot->name)) { |
|
| 983 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 984 | 984 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 985 | 985 | } |
| 986 | 986 | |
| 987 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 987 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 988 | 988 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 989 | 989 | } |
| 990 | 990 | |
| 991 | 991 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 992 | 992 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 993 | 993 | |
| 994 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 994 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 995 | 995 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 996 | 996 | } |
| 997 | 997 | |
| 998 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 998 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 999 | 999 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 1000 | 1000 | } |
| 1001 | 1001 | |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | ) : Mapping\CacheMetadata |
| 1023 | 1023 | { |
| 1024 | 1024 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 1025 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 1025 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 1026 | 1026 | |
| 1027 | 1027 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 1028 | 1028 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1083,7 +1083,7 @@ discard block |
||
| 1083 | 1083 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
| 1084 | 1084 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
| 1085 | 1085 | do { |
| 1086 | - if (! $parent->isMappedSuperclass) { |
|
| 1086 | + if ( ! $parent->isMappedSuperclass) { |
|
| 1087 | 1087 | $metadata->setTable($parent->table); |
| 1088 | 1088 | |
| 1089 | 1089 | break; |
@@ -1141,11 +1141,11 @@ discard block |
||
| 1141 | 1141 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1142 | 1142 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1143 | 1143 | |
| 1144 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1144 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1145 | 1145 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1146 | 1146 | } |
| 1147 | 1147 | |
| 1148 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1148 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1149 | 1149 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1150 | 1150 | } |
| 1151 | 1151 | } |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | if (isset($classAnnotations[Annotation\DiscriminatorMap::class])) { |
| 1157 | 1157 | $discriminatorMapAnnotation = $classAnnotations[Annotation\DiscriminatorMap::class]; |
| 1158 | 1158 | $discriminatorMap = array_map( |
| 1159 | - function ($className) use ($metadata) { |
|
| 1159 | + function($className) use ($metadata) { |
|
| 1160 | 1160 | return $metadata->fullyQualifiedClassName($className); |
| 1161 | 1161 | }, |
| 1162 | 1162 | $discriminatorMapAnnotation->value |
@@ -1186,12 +1186,12 @@ discard block |
||
| 1186 | 1186 | if (isset($classAnnotations[Annotation\NamedQueries::class])) { |
| 1187 | 1187 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
| 1188 | 1188 | |
| 1189 | - if (! is_array($namedQueriesAnnot->value)) { |
|
| 1189 | + if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 1190 | 1190 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 1191 | 1191 | } |
| 1192 | 1192 | |
| 1193 | 1193 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
| 1194 | - if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1194 | + if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1195 | 1195 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 1196 | 1196 | } |
| 1197 | 1197 | |
@@ -1289,7 +1289,7 @@ discard block |
||
| 1289 | 1289 | foreach ($entityListenersAnnot->value as $item) { |
| 1290 | 1290 | $listenerClassName = $metadata->fullyQualifiedClassName($item); |
| 1291 | 1291 | |
| 1292 | - if (! class_exists($listenerClassName)) { |
|
| 1292 | + if ( ! class_exists($listenerClassName)) { |
|
| 1293 | 1293 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1294 | 1294 | $listenerClassName, |
| 1295 | 1295 | $metadata->getClassName() |
@@ -1331,7 +1331,7 @@ discard block |
||
| 1331 | 1331 | $fieldName = $associationOverride->name; |
| 1332 | 1332 | $property = $metadata->getProperty($fieldName); |
| 1333 | 1333 | |
| 1334 | - if (! $property) { |
|
| 1334 | + if ( ! $property) { |
|
| 1335 | 1335 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1336 | 1336 | } |
| 1337 | 1337 | |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | // Check for fetch |
| 1366 | 1366 | if ($associationOverride->fetch) { |
| 1367 | 1367 | $override->setFetchMode( |
| 1368 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1368 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1369 | 1369 | ); |
| 1370 | 1370 | } |
| 1371 | 1371 | |
@@ -1502,7 +1502,7 @@ discard block |
||
| 1502 | 1502 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1503 | 1503 | |
| 1504 | 1504 | foreach ($classAnnotations as $key => $annot) { |
| 1505 | - if (! is_numeric($key)) { |
|
| 1505 | + if ( ! is_numeric($key)) { |
|
| 1506 | 1506 | continue; |
| 1507 | 1507 | } |
| 1508 | 1508 | |
@@ -1522,7 +1522,7 @@ discard block |
||
| 1522 | 1522 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1523 | 1523 | |
| 1524 | 1524 | foreach ($propertyAnnotations as $key => $annot) { |
| 1525 | - if (! is_numeric($key)) { |
|
| 1525 | + if ( ! is_numeric($key)) { |
|
| 1526 | 1526 | continue; |
| 1527 | 1527 | } |
| 1528 | 1528 | |
@@ -1542,7 +1542,7 @@ discard block |
||
| 1542 | 1542 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1543 | 1543 | |
| 1544 | 1544 | foreach ($methodAnnotations as $key => $annot) { |
| 1545 | - if (! is_numeric($key)) { |
|
| 1545 | + if ( ! is_numeric($key)) { |
|
| 1546 | 1546 | continue; |
| 1547 | 1547 | } |
| 1548 | 1548 | |
@@ -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\Annotation; |
| 6 | 6 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | return $this->classNames; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - if (!$this->paths) { |
|
| 190 | + if ( ! $this->paths) { |
|
| 191 | 191 | throw Mapping\MappingException::pathRequired(); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 205 | 205 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 206 | 206 | ), |
| 207 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 207 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 208 | 208 | \RecursiveRegexIterator::GET_MATCH |
| 209 | 209 | ); |
| 210 | 210 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | { |
| 261 | 261 | $reflectionClass = $metadata->getReflectionClass(); |
| 262 | 262 | |
| 263 | - if (! $reflectionClass) { |
|
| 263 | + if ( ! $reflectionClass) { |
|
| 264 | 264 | // this happens when running annotation driver in combination with |
| 265 | 265 | // static reflection services. This is not the nicest fix |
| 266 | 266 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $metadataBuildingContext |
| 298 | 298 | ); |
| 299 | 299 | |
| 300 | - if (! $property) { |
|
| 300 | + if ( ! $property) { |
|
| 301 | 301 | continue; |
| 302 | 302 | } |
| 303 | 303 | |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | ) |
| 383 | 383 | { |
| 384 | 384 | /** @var Annotation\Entity $entityAnnot */ |
| 385 | - $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
| 385 | + $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
| 386 | 386 | |
| 387 | 387 | if ($entityAnnot->repositoryClass !== null) { |
| 388 | 388 | $metadata->setCustomRepositoryClassName( |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | \ReflectionProperty $reflectionProperty, |
| 481 | 481 | Mapping\ClassMetadata $metadata, |
| 482 | 482 | Mapping\ClassMetadataBuildingContext $metadataBuildingContext |
| 483 | - ) : ?Mapping\Property |
|
| 483 | + ) : ? Mapping\Property |
|
| 484 | 484 | { |
| 485 | 485 | switch (true) { |
| 486 | 486 | case isset($propertyAnnotations[Annotation\Column::class]): |
@@ -633,11 +633,11 @@ discard block |
||
| 633 | 633 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 634 | 634 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 635 | 635 | |
| 636 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 636 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 637 | 637 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 640 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 641 | 641 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 642 | 642 | } |
| 643 | 643 | |
@@ -693,13 +693,13 @@ discard block |
||
| 693 | 693 | $fieldName = $reflectionProperty->getName(); |
| 694 | 694 | $manyToOneAnnot = $propertyAnnotations[Annotation\ManyToOne::class]; |
| 695 | 695 | $assocMetadata = new Mapping\ManyToOneAssociationMetadata($fieldName); |
| 696 | - $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity); |
|
| 696 | + $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity); |
|
| 697 | 697 | |
| 698 | 698 | $assocMetadata->setTargetEntity($targetEntity); |
| 699 | 699 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 700 | 700 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 701 | 701 | |
| 702 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 702 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 703 | 703 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 704 | 704 | } |
| 705 | 705 | |
@@ -757,18 +757,18 @@ discard block |
||
| 757 | 757 | $fieldName = $reflectionProperty->getName(); |
| 758 | 758 | $oneToManyAnnot = $propertyAnnotations[Annotation\OneToMany::class]; |
| 759 | 759 | $assocMetadata = new Mapping\OneToManyAssociationMetadata($fieldName); |
| 760 | - $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity); |
|
| 760 | + $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity); |
|
| 761 | 761 | |
| 762 | 762 | $assocMetadata->setTargetEntity($targetEntity); |
| 763 | 763 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $oneToManyAnnot->cascade)); |
| 764 | 764 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 765 | 765 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 766 | 766 | |
| 767 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 767 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 768 | 768 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 769 | 769 | } |
| 770 | 770 | |
| 771 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 771 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 772 | 772 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 773 | 773 | } |
| 774 | 774 | |
@@ -817,15 +817,15 @@ discard block |
||
| 817 | 817 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 818 | 818 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 819 | 819 | |
| 820 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 820 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 821 | 821 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 824 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 825 | 825 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 826 | 826 | } |
| 827 | 827 | |
| 828 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 828 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 829 | 829 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 830 | 830 | } |
| 831 | 831 | |
@@ -876,15 +876,15 @@ discard block |
||
| 876 | 876 | |
| 877 | 877 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 878 | 878 | |
| 879 | - if (! empty($columnAnnot->name)) { |
|
| 879 | + if ( ! empty($columnAnnot->name)) { |
|
| 880 | 880 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 881 | 881 | } |
| 882 | 882 | |
| 883 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 883 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 884 | 884 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 885 | 885 | } |
| 886 | 886 | |
| 887 | - if (! empty($columnAnnot->length)) { |
|
| 887 | + if ( ! empty($columnAnnot->length)) { |
|
| 888 | 888 | $fieldMetadata->setLength($columnAnnot->length); |
| 889 | 889 | } |
| 890 | 890 | |
@@ -913,11 +913,11 @@ discard block |
||
| 913 | 913 | Mapping\TableMetadata $table |
| 914 | 914 | ) : void |
| 915 | 915 | { |
| 916 | - if (! empty($tableAnnot->name)) { |
|
| 916 | + if ( ! empty($tableAnnot->name)) { |
|
| 917 | 917 | $table->setName($tableAnnot->name); |
| 918 | 918 | } |
| 919 | 919 | |
| 920 | - if (! empty($tableAnnot->schema)) { |
|
| 920 | + if ( ! empty($tableAnnot->schema)) { |
|
| 921 | 921 | $table->setSchema($tableAnnot->schema); |
| 922 | 922 | } |
| 923 | 923 | |
@@ -960,11 +960,11 @@ discard block |
||
| 960 | 960 | { |
| 961 | 961 | $joinTable = new Mapping\JoinTableMetadata(); |
| 962 | 962 | |
| 963 | - if (! empty($joinTableAnnot->name)) { |
|
| 963 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 964 | 964 | $joinTable->setName($joinTableAnnot->name); |
| 965 | 965 | } |
| 966 | 966 | |
| 967 | - if (! empty($joinTableAnnot->schema)) { |
|
| 967 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 968 | 968 | $joinTable->setSchema($joinTableAnnot->schema); |
| 969 | 969 | } |
| 970 | 970 | |
@@ -997,22 +997,22 @@ discard block |
||
| 997 | 997 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 998 | 998 | |
| 999 | 999 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 1000 | - if (! empty($joinColumnAnnot->name)) { |
|
| 1000 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 1001 | 1001 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 1004 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 1005 | 1005 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 1006 | 1006 | } |
| 1007 | 1007 | |
| 1008 | 1008 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 1009 | 1009 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 1010 | 1010 | |
| 1011 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 1011 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 1012 | 1012 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 1015 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 1016 | 1016 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 1017 | 1017 | } |
| 1018 | 1018 | |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | ) : Mapping\CacheMetadata |
| 1040 | 1040 | { |
| 1041 | 1041 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 1042 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 1042 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 1043 | 1043 | |
| 1044 | 1044 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 1045 | 1045 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1152,11 +1152,11 @@ discard block |
||
| 1152 | 1152 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1153 | 1153 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1154 | 1154 | |
| 1155 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1155 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1156 | 1156 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1157 | 1157 | } |
| 1158 | 1158 | |
| 1159 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1159 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1160 | 1160 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1161 | 1161 | } |
| 1162 | 1162 | } |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | if (isset($classAnnotations[Annotation\DiscriminatorMap::class])) { |
| 1168 | 1168 | $discriminatorMapAnnotation = $classAnnotations[Annotation\DiscriminatorMap::class]; |
| 1169 | 1169 | $discriminatorMap = array_map( |
| 1170 | - function ($className) use ($metadata) { |
|
| 1170 | + function($className) use ($metadata) { |
|
| 1171 | 1171 | return $metadata->fullyQualifiedClassName($className); |
| 1172 | 1172 | }, |
| 1173 | 1173 | $discriminatorMapAnnotation->value |
@@ -1197,12 +1197,12 @@ discard block |
||
| 1197 | 1197 | if (isset($classAnnotations[Annotation\NamedQueries::class])) { |
| 1198 | 1198 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
| 1199 | 1199 | |
| 1200 | - if (! is_array($namedQueriesAnnot->value)) { |
|
| 1200 | + if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 1201 | 1201 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 1202 | 1202 | } |
| 1203 | 1203 | |
| 1204 | 1204 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
| 1205 | - if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1205 | + if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1206 | 1206 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 1207 | 1207 | } |
| 1208 | 1208 | |
@@ -1300,7 +1300,7 @@ discard block |
||
| 1300 | 1300 | foreach ($entityListenersAnnot->value as $item) { |
| 1301 | 1301 | $listenerClassName = $metadata->fullyQualifiedClassName($item); |
| 1302 | 1302 | |
| 1303 | - if (! class_exists($listenerClassName)) { |
|
| 1303 | + if ( ! class_exists($listenerClassName)) { |
|
| 1304 | 1304 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1305 | 1305 | $listenerClassName, |
| 1306 | 1306 | $metadata->getClassName() |
@@ -1343,7 +1343,7 @@ discard block |
||
| 1343 | 1343 | $fieldName = $associationOverride->name; |
| 1344 | 1344 | $property = $metadata->getProperty($fieldName); |
| 1345 | 1345 | |
| 1346 | - if (! $property) { |
|
| 1346 | + if ( ! $property) { |
|
| 1347 | 1347 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1348 | 1348 | } |
| 1349 | 1349 | |
@@ -1377,7 +1377,7 @@ discard block |
||
| 1377 | 1377 | // Check for fetch |
| 1378 | 1378 | if ($associationOverride->fetch) { |
| 1379 | 1379 | $override->setFetchMode( |
| 1380 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1380 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1381 | 1381 | ); |
| 1382 | 1382 | } |
| 1383 | 1383 | |
@@ -1464,7 +1464,7 @@ discard block |
||
| 1464 | 1464 | { |
| 1465 | 1465 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1466 | 1466 | |
| 1467 | - if (! defined($fetchModeConstant)) { |
|
| 1467 | + if ( ! defined($fetchModeConstant)) { |
|
| 1468 | 1468 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1469 | 1469 | } |
| 1470 | 1470 | |
@@ -1514,7 +1514,7 @@ discard block |
||
| 1514 | 1514 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1515 | 1515 | |
| 1516 | 1516 | foreach ($classAnnotations as $key => $annot) { |
| 1517 | - if (! is_numeric($key)) { |
|
| 1517 | + if ( ! is_numeric($key)) { |
|
| 1518 | 1518 | continue; |
| 1519 | 1519 | } |
| 1520 | 1520 | |
@@ -1534,7 +1534,7 @@ discard block |
||
| 1534 | 1534 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1535 | 1535 | |
| 1536 | 1536 | foreach ($propertyAnnotations as $key => $annot) { |
| 1537 | - if (! is_numeric($key)) { |
|
| 1537 | + if ( ! is_numeric($key)) { |
|
| 1538 | 1538 | continue; |
| 1539 | 1539 | } |
| 1540 | 1540 | |
@@ -1554,7 +1554,7 @@ discard block |
||
| 1554 | 1554 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1555 | 1555 | |
| 1556 | 1556 | foreach ($methodAnnotations as $key => $annot) { |
| 1557 | - if (! is_numeric($key)) { |
|
| 1557 | + if ( ! is_numeric($key)) { |
|
| 1558 | 1558 | continue; |
| 1559 | 1559 | } |
| 1560 | 1560 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Mapping\Driver\Annotation\Binder; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Mapping\Driver\Annotation\Binder; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Mapping\Driver\Annotation\Binder; |
| 6 | 6 | |
@@ -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\Tests\ORM\Tools; |
| 6 | 6 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $this->namespace = uniqid("doctrine_", false); |
| 54 | 54 | $this->tmpDir = sys_get_temp_dir(); |
| 55 | 55 | |
| 56 | - mkdir($this->tmpDir . \DIRECTORY_SEPARATOR . $this->namespace); |
|
| 56 | + mkdir($this->tmpDir.\DIRECTORY_SEPARATOR.$this->namespace); |
|
| 57 | 57 | |
| 58 | 58 | $this->generator = new EntityGenerator(); |
| 59 | 59 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function tearDown() |
| 68 | 68 | { |
| 69 | - $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir . '/' . $this->namespace)); |
|
| 69 | + $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir.'/'.$this->namespace)); |
|
| 70 | 70 | |
| 71 | 71 | foreach ($ri AS $file) { |
| 72 | 72 | /* @var $file \SplFileInfo */ |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - rmdir($this->tmpDir . '/' . $this->namespace); |
|
| 78 | + rmdir($this->tmpDir.'/'.$this->namespace); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function generateBookEntityFixture(array $embeddedClasses = []) |
| 87 | 87 | { |
| 88 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 88 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 89 | 89 | |
| 90 | - $metadata->setCustomRepositoryClassName($this->namespace . '\EntityGeneratorBookRepository'); |
|
| 90 | + $metadata->setCustomRepositoryClassName($this->namespace.'\EntityGeneratorBookRepository'); |
|
| 91 | 91 | |
| 92 | 92 | $tableMetadata = new Mapping\TableMetadata(); |
| 93 | 93 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | private function generateEntityTypeFixture(array $field) |
| 208 | 208 | { |
| 209 | - $metadata = new ClassMetadata($this->namespace . '\EntityType', $this->staticMetadataBuildingContext); |
|
| 209 | + $metadata = new ClassMetadata($this->namespace.'\EntityType', $this->staticMetadataBuildingContext); |
|
| 210 | 210 | |
| 211 | 211 | $tableMetadata = new Mapping\TableMetadata(); |
| 212 | 212 | $tableMetadata->setName('entity_type'); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | private function generateIsbnEmbeddableFixture(array $embeddedClasses = [], $columnPrefix = null) |
| 241 | 241 | { |
| 242 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorIsbn', $this->staticMetadataBuildingContext); |
|
| 242 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorIsbn', $this->staticMetadataBuildingContext); |
|
| 243 | 243 | |
| 244 | 244 | $metadata->isEmbeddedClass = true; |
| 245 | 245 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | private function generateTestEmbeddableFixture() |
| 300 | 300 | { |
| 301 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorTestEmbeddable', $this->staticMetadataBuildingContext); |
|
| 301 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorTestEmbeddable', $this->staticMetadataBuildingContext); |
|
| 302 | 302 | |
| 303 | 303 | $metadata->isEmbeddedClass = true; |
| 304 | 304 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | private function loadEntityClass(ClassMetadata $metadata) |
| 342 | 342 | { |
| 343 | 343 | $className = basename(str_replace('\\', '/', $metadata->getClassName())); |
| 344 | - $path = $this->tmpDir . '/' . $this->namespace . '/' . $className . '.php'; |
|
| 344 | + $path = $this->tmpDir.'/'.$this->namespace.'/'.$className.'.php'; |
|
| 345 | 345 | |
| 346 | 346 | self::assertFileExists($path); |
| 347 | 347 | |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | |
| 493 | 493 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 494 | 494 | |
| 495 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/EntityGeneratorBook.php~"); |
|
| 495 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/EntityGeneratorBook.php~"); |
|
| 496 | 496 | |
| 497 | 497 | $book = $this->newInstance($metadata); |
| 498 | 498 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | self::assertPhpDocReturnType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor|null', new \ReflectionMethod($book, 'getAuthor')); |
| 544 | 544 | self::assertPhpDocParamType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor|null', new \ReflectionMethod($book, 'setAuthor')); |
| 545 | 545 | |
| 546 | - $expectedClassName = '\\' . $embeddedMetadata->getClassName(); |
|
| 546 | + $expectedClassName = '\\'.$embeddedMetadata->getClassName(); |
|
| 547 | 547 | |
| 548 | 548 | self::assertPhpDocVarType($expectedClassName, new \ReflectionProperty($book, 'isbn')); |
| 549 | 549 | self::assertPhpDocReturnType($expectedClassName, new \ReflectionMethod($book, 'getIsbn')); |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | */ |
| 648 | 648 | public function testMappedSuperclassAnnotationGeneration() |
| 649 | 649 | { |
| 650 | - $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 650 | + $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorBook', $this->staticMetadataBuildingContext); |
|
| 651 | 651 | |
| 652 | 652 | $metadata->isMappedSuperclass = true; |
| 653 | 653 | |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | */ |
| 685 | 685 | public function testGenerateEntityWithSequenceGenerator() |
| 686 | 686 | { |
| 687 | - $metadata = new ClassMetadata($this->namespace . '\DDC1784Entity', $this->staticMetadataBuildingContext); |
|
| 687 | + $metadata = new ClassMetadata($this->namespace.'\DDC1784Entity', $this->staticMetadataBuildingContext); |
|
| 688 | 688 | $metadata->setTable(new Mapping\TableMetadata('ddc1784_entity')); |
| 689 | 689 | |
| 690 | 690 | $fieldMetadata = new Mapping\FieldMetadata('id'); |
@@ -702,8 +702,8 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 704 | 704 | |
| 705 | - $filename = $this->tmpDir . DIRECTORY_SEPARATOR |
|
| 706 | - . $this->namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php'; |
|
| 705 | + $filename = $this->tmpDir.DIRECTORY_SEPARATOR |
|
| 706 | + . $this->namespace.DIRECTORY_SEPARATOR.'DDC1784Entity.php'; |
|
| 707 | 707 | |
| 708 | 708 | self::assertFileExists($filename); |
| 709 | 709 | |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | */ |
| 724 | 724 | public function testGenerateEntityWithMultipleInverseJoinColumns() |
| 725 | 725 | { |
| 726 | - $metadata = new ClassMetadata($this->namespace . '\DDC2079Entity', $this->staticMetadataBuildingContext); |
|
| 726 | + $metadata = new ClassMetadata($this->namespace.'\DDC2079Entity', $this->staticMetadataBuildingContext); |
|
| 727 | 727 | $metadata->setTable(new Mapping\TableMetadata('ddc2079_entity')); |
| 728 | 728 | |
| 729 | 729 | $fieldMetadata = new Mapping\FieldMetadata('id'); |
@@ -763,14 +763,14 @@ discard block |
||
| 763 | 763 | $association = new Mapping\ManyToManyAssociationMetadata('centroCustos'); |
| 764 | 764 | |
| 765 | 765 | $association->setJoinTable($joinTable); |
| 766 | - $association->setTargetEntity($this->namespace . '\\DDC2079CentroCusto'); |
|
| 766 | + $association->setTargetEntity($this->namespace.'\\DDC2079CentroCusto'); |
|
| 767 | 767 | |
| 768 | 768 | $metadata->addProperty($association); |
| 769 | 769 | |
| 770 | 770 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 771 | 771 | |
| 772 | - $filename = $this->tmpDir . DIRECTORY_SEPARATOR |
|
| 773 | - . $this->namespace . DIRECTORY_SEPARATOR . 'DDC2079Entity.php'; |
|
| 772 | + $filename = $this->tmpDir.DIRECTORY_SEPARATOR |
|
| 773 | + . $this->namespace.DIRECTORY_SEPARATOR.'DDC2079Entity.php'; |
|
| 774 | 774 | |
| 775 | 775 | self::assertFileExists($filename); |
| 776 | 776 | |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | $method->setAccessible(true); |
| 802 | 802 | |
| 803 | 803 | foreach ($constants as $name => $value) { |
| 804 | - if( ! preg_match($pattern, $name)) { |
|
| 804 | + if ( ! preg_match($pattern, $name)) { |
|
| 805 | 805 | continue; |
| 806 | 806 | } |
| 807 | 807 | |
@@ -830,7 +830,7 @@ discard block |
||
| 830 | 830 | $method->setAccessible(true); |
| 831 | 831 | |
| 832 | 832 | foreach ($constants as $name => $value) { |
| 833 | - if( ! preg_match($pattern, $name)) { |
|
| 833 | + if ( ! preg_match($pattern, $name)) { |
|
| 834 | 834 | continue; |
| 835 | 835 | } |
| 836 | 836 | |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | $method->setAccessible(true); |
| 860 | 860 | |
| 861 | 861 | foreach ($constants as $name => $value) { |
| 862 | - if( ! preg_match($pattern, $name)) { |
|
| 862 | + if ( ! preg_match($pattern, $name)) { |
|
| 863 | 863 | continue; |
| 864 | 864 | } |
| 865 | 865 | |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | public function testEntityTypeAlias(array $field) |
| 884 | 884 | { |
| 885 | 885 | $metadata = $this->generateEntityTypeFixture($field); |
| 886 | - $path = $this->tmpDir . '/'. $this->namespace . '/EntityType.php'; |
|
| 886 | + $path = $this->tmpDir.'/'.$this->namespace.'/EntityType.php'; |
|
| 887 | 887 | |
| 888 | 888 | self::assertFileExists($path); |
| 889 | 889 | require_once $path; |
@@ -896,8 +896,8 @@ discard block |
||
| 896 | 896 | $type = $field['phpType']; |
| 897 | 897 | $name = $field['fieldName']; |
| 898 | 898 | $value = $field['value']; |
| 899 | - $getter = "get" . ucfirst($name); |
|
| 900 | - $setter = "set" . ucfirst($name); |
|
| 899 | + $getter = "get".ucfirst($name); |
|
| 900 | + $setter = "set".ucfirst($name); |
|
| 901 | 901 | |
| 902 | 902 | self::assertPhpDocVarType($type, $reflClass->getProperty($name)); |
| 903 | 903 | self::assertPhpDocParamType($type, $reflClass->getMethod($setter)); |
@@ -920,13 +920,13 @@ discard block |
||
| 920 | 920 | $metadata = $cmf->getMetadataFor(get_class($user)); |
| 921 | 921 | |
| 922 | 922 | // @todo guilhermeblanco Fix this test as changing Entity class should never be allowed. |
| 923 | - $metadata->setClassName($this->namespace . "\DDC2372User"); |
|
| 923 | + $metadata->setClassName($this->namespace."\DDC2372User"); |
|
| 924 | 924 | |
| 925 | 925 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 926 | 926 | |
| 927 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/DDC2372User.php"); |
|
| 927 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/DDC2372User.php"); |
|
| 928 | 928 | |
| 929 | - require $this->tmpDir . "/" . $this->namespace . "/DDC2372User.php"; |
|
| 929 | + require $this->tmpDir."/".$this->namespace."/DDC2372User.php"; |
|
| 930 | 930 | |
| 931 | 931 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
| 932 | 932 | |
@@ -948,12 +948,12 @@ discard block |
||
| 948 | 948 | $metadata = $cmf->getMetadataFor(get_class($user)); |
| 949 | 949 | |
| 950 | 950 | // @todo guilhermeblanco Fix this test as changing Entity class should never be allowed. |
| 951 | - $metadata->setClassName($this->namespace . "\DDC2372Admin"); |
|
| 951 | + $metadata->setClassName($this->namespace."\DDC2372Admin"); |
|
| 952 | 952 | |
| 953 | 953 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 954 | 954 | |
| 955 | - self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/DDC2372Admin.php"); |
|
| 956 | - require $this->tmpDir . "/" . $this->namespace . "/DDC2372Admin.php"; |
|
| 955 | + self::assertFileExists($this->tmpDir."/".$this->namespace."/DDC2372Admin.php"); |
|
| 956 | + require $this->tmpDir."/".$this->namespace."/DDC2372Admin.php"; |
|
| 957 | 957 | |
| 958 | 958 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
| 959 | 959 | |
@@ -973,22 +973,22 @@ discard block |
||
| 973 | 973 | $cmf->setEntityManager($em); |
| 974 | 974 | |
| 975 | 975 | $ns = $this->namespace; |
| 976 | - $nsdir = $this->tmpDir . '/' . $ns; |
|
| 976 | + $nsdir = $this->tmpDir.'/'.$ns; |
|
| 977 | 977 | |
| 978 | 978 | // Dump DDC1590User into temp file |
| 979 | 979 | $content = str_replace( |
| 980 | 980 | 'namespace Doctrine\Tests\Models\DDC1590', |
| 981 | - 'namespace ' . $ns, |
|
| 982 | - file_get_contents(__DIR__ . '/../../Models/DDC1590/DDC1590User.php') |
|
| 981 | + 'namespace '.$ns, |
|
| 982 | + file_get_contents(__DIR__.'/../../Models/DDC1590/DDC1590User.php') |
|
| 983 | 983 | ); |
| 984 | 984 | |
| 985 | - $fname = $nsdir . "/DDC1590User.php"; |
|
| 985 | + $fname = $nsdir."/DDC1590User.php"; |
|
| 986 | 986 | file_put_contents($fname, $content); |
| 987 | 987 | |
| 988 | 988 | // Require DDC1590User |
| 989 | 989 | require $fname; |
| 990 | 990 | |
| 991 | - $metadata = $cmf->getMetadataFor($ns . '\DDC1590User'); |
|
| 991 | + $metadata = $cmf->getMetadataFor($ns.'\DDC1590User'); |
|
| 992 | 992 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 993 | 993 | |
| 994 | 994 | // class DDC1590User extends DDC1590Entity { ... } |
@@ -996,13 +996,13 @@ discard block |
||
| 996 | 996 | |
| 997 | 997 | // class _DDC1590User extends DDC1590Entity { ... } |
| 998 | 998 | $source2 = str_replace('class DDC1590User', 'class _DDC1590User', $source); |
| 999 | - $fname2 = $nsdir . "/_DDC1590User.php"; |
|
| 999 | + $fname2 = $nsdir."/_DDC1590User.php"; |
|
| 1000 | 1000 | file_put_contents($fname2, $source2); |
| 1001 | 1001 | require $fname2; |
| 1002 | 1002 | |
| 1003 | 1003 | // class __DDC1590User { ... } |
| 1004 | 1004 | $source3 = str_replace('class DDC1590User extends DDC1590Entity', 'class __DDC1590User', $source); |
| 1005 | - $fname3 = $nsdir . "/__DDC1590User.php"; |
|
| 1005 | + $fname3 = $nsdir."/__DDC1590User.php"; |
|
| 1006 | 1006 | file_put_contents($fname3, $source3); |
| 1007 | 1007 | require $fname3; |
| 1008 | 1008 | |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | $this->loadEntityClass($metadata); |
| 1166 | 1166 | |
| 1167 | 1167 | $className = basename(str_replace('\\', '/', $metadata->getClassName())); |
| 1168 | - $path = $this->tmpDir . '/' . $this->namespace . '/' . $className . '.php'; |
|
| 1168 | + $path = $this->tmpDir.'/'.$this->namespace.'/'.$className.'.php'; |
|
| 1169 | 1169 | $classTest = file_get_contents($path); |
| 1170 | 1170 | |
| 1171 | 1171 | $this->generator->setRegenerateEntityIfExists(true); |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | $this->generator->writeEntityClass($metadata, $this->tmpDir); |
| 1175 | 1175 | $classNew = file_get_contents($path); |
| 1176 | 1176 | |
| 1177 | - self::assertSame($classTest,$classNew); |
|
| 1177 | + self::assertSame($classTest, $classNew); |
|
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | /** |
@@ -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\Tests\ORM\Mapping; |
| 6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | use DoctrineGlobal_Article; |
| 32 | 32 | use SebastianBergmann\Environment\Runtime; |
| 33 | 33 | |
| 34 | -require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 34 | +require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 35 | 35 | |
| 36 | 36 | class ClassMetadataTest extends OrmTestCase |
| 37 | 37 | { |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | public function testEmptyFieldNameThrowsException() |
| 805 | 805 | { |
| 806 | 806 | $this->expectException(MappingException::class); |
| 807 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
| 807 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
| 808 | 808 | |
| 809 | 809 | $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
| 810 | 810 | $cm->setTable(new Mapping\TableMetadata('cms_users')); |
@@ -947,12 +947,12 @@ discard block |
||
| 947 | 947 | $mapping = $cm->getSqlResultSetMapping('find-all'); |
| 948 | 948 | |
| 949 | 949 | self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
| 950 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 951 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 950 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 951 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 952 | 952 | |
| 953 | 953 | self::assertEquals(CMS\CmsEmail::class, $mapping['entities'][1]['entityClass']); |
| 954 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
| 955 | - self::assertEquals(['name'=>'email','column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
| 954 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
| 955 | + self::assertEquals(['name'=>'email', 'column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
| 956 | 956 | |
| 957 | 957 | self::assertEquals('scalarColumn', $mapping['columns'][0]['name']); |
| 958 | 958 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
| 1149 | 1149 | $cm->addLifecycleCallback('notfound', 'postLoad'); |
| 1150 | 1150 | |
| 1151 | 1151 | $this->expectException(MappingException::class); |
| 1152 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback."); |
|
| 1152 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback."); |
|
| 1153 | 1153 | |
| 1154 | 1154 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
| 1155 | 1155 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | $cm->addProperty($association); |
| 1170 | 1170 | |
| 1171 | 1171 | $this->expectException(MappingException::class); |
| 1172 | - $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
| 1172 | + $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '".CMS\CmsUser::class."#address'."); |
|
| 1173 | 1173 | |
| 1174 | 1174 | $cm->validateAssociations(); |
| 1175 | 1175 | } |
@@ -1510,6 +1510,6 @@ discard block |
||
| 1510 | 1510 | */ |
| 1511 | 1511 | public function propertyToColumnName($propertyName, $className = null) |
| 1512 | 1512 | { |
| 1513 | - return strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
| 1513 | + return strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
| 1514 | 1514 | } |
| 1515 | 1515 | } |