@@ -155,6 +155,9 @@ discard block |
||
| 155 | 155 | $this->books = new \Doctrine\Common\Collections\ArrayCollection; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | + /** |
|
| 159 | + * @param string $title |
|
| 160 | + */ |
|
| 158 | 161 | public function addBook($title) |
| 159 | 162 | { |
| 160 | 163 | $book = new DDC618Book($title, $this); |
@@ -179,6 +182,9 @@ discard block |
||
| 179 | 182 | /** @ORM\ManyToOne(targetEntity=DDC618Author::class, inversedBy="books") */ |
| 180 | 183 | public $author; |
| 181 | 184 | |
| 185 | + /** |
|
| 186 | + * @param DDC618Author $author |
|
| 187 | + */ |
|
| 182 | 188 | function __construct($title, $author) |
| 183 | 189 | { |
| 184 | 190 | $this->title = $title; |
@@ -26,7 +26,6 @@ |
||
| 26 | 26 | use Doctrine\Tests\Models\DDC964\DDC964Address; |
| 27 | 27 | use Doctrine\Tests\Models\DDC964\DDC964Admin; |
| 28 | 28 | use Doctrine\Tests\Models\DDC964\DDC964Guest; |
| 29 | -use Doctrine\Tests\Models\Routing\RoutingLeg; |
|
| 30 | 29 | use Doctrine\Tests\OrmTestCase; |
| 31 | 30 | use DoctrineGlobal_Article; |
| 32 | 31 | |
@@ -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($entityAnnot->repositoryClass); |
@@ -629,11 +629,11 @@ discard block |
||
| 629 | 629 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 630 | 630 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 631 | 631 | |
| 632 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 632 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 633 | 633 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 636 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 637 | 637 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 638 | 638 | } |
| 639 | 639 | |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 696 | 696 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 697 | 697 | |
| 698 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 698 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 699 | 699 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 700 | 700 | } |
| 701 | 701 | |
@@ -760,11 +760,11 @@ discard block |
||
| 760 | 760 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 761 | 761 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 762 | 762 | |
| 763 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 763 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 764 | 764 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 767 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 768 | 768 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 769 | 769 | } |
| 770 | 770 | |
@@ -813,15 +813,15 @@ discard block |
||
| 813 | 813 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 814 | 814 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 815 | 815 | |
| 816 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 816 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 817 | 817 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 818 | 818 | } |
| 819 | 819 | |
| 820 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 820 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 821 | 821 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 824 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 825 | 825 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 826 | 826 | } |
| 827 | 827 | |
@@ -872,15 +872,15 @@ discard block |
||
| 872 | 872 | |
| 873 | 873 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 874 | 874 | |
| 875 | - if (! empty($columnAnnot->name)) { |
|
| 875 | + if ( ! empty($columnAnnot->name)) { |
|
| 876 | 876 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 877 | 877 | } |
| 878 | 878 | |
| 879 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 879 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 880 | 880 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 881 | 881 | } |
| 882 | 882 | |
| 883 | - if (! empty($columnAnnot->length)) { |
|
| 883 | + if ( ! empty($columnAnnot->length)) { |
|
| 884 | 884 | $fieldMetadata->setLength($columnAnnot->length); |
| 885 | 885 | } |
| 886 | 886 | |
@@ -909,11 +909,11 @@ discard block |
||
| 909 | 909 | Mapping\TableMetadata $table |
| 910 | 910 | ) : void |
| 911 | 911 | { |
| 912 | - if (! empty($tableAnnot->name)) { |
|
| 912 | + if ( ! empty($tableAnnot->name)) { |
|
| 913 | 913 | $table->setName($tableAnnot->name); |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | - if (! empty($tableAnnot->schema)) { |
|
| 916 | + if ( ! empty($tableAnnot->schema)) { |
|
| 917 | 917 | $table->setSchema($tableAnnot->schema); |
| 918 | 918 | } |
| 919 | 919 | |
@@ -956,11 +956,11 @@ discard block |
||
| 956 | 956 | { |
| 957 | 957 | $joinTable = new Mapping\JoinTableMetadata(); |
| 958 | 958 | |
| 959 | - if (! empty($joinTableAnnot->name)) { |
|
| 959 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 960 | 960 | $joinTable->setName($joinTableAnnot->name); |
| 961 | 961 | } |
| 962 | 962 | |
| 963 | - if (! empty($joinTableAnnot->schema)) { |
|
| 963 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 964 | 964 | $joinTable->setSchema($joinTableAnnot->schema); |
| 965 | 965 | } |
| 966 | 966 | |
@@ -993,22 +993,22 @@ discard block |
||
| 993 | 993 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 994 | 994 | |
| 995 | 995 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 996 | - if (! empty($joinColumnAnnot->name)) { |
|
| 996 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 997 | 997 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 998 | 998 | } |
| 999 | 999 | |
| 1000 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 1000 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 1001 | 1001 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | 1004 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 1005 | 1005 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 1006 | 1006 | |
| 1007 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 1007 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 1008 | 1008 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 1011 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 1012 | 1012 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 1013 | 1013 | } |
| 1014 | 1014 | |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | ) : Mapping\CacheMetadata |
| 1036 | 1036 | { |
| 1037 | 1037 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 1038 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 1038 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 1039 | 1039 | |
| 1040 | 1040 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 1041 | 1041 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1148,11 +1148,11 @@ discard block |
||
| 1148 | 1148 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1149 | 1149 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1150 | 1150 | |
| 1151 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1151 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1152 | 1152 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1155 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1156 | 1156 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1157 | 1157 | } |
| 1158 | 1158 | } |
@@ -1188,12 +1188,12 @@ discard block |
||
| 1188 | 1188 | if (isset($classAnnotations[Annotation\NamedQueries::class])) { |
| 1189 | 1189 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
| 1190 | 1190 | |
| 1191 | - if (! is_array($namedQueriesAnnot->value)) { |
|
| 1191 | + if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 1192 | 1192 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 1193 | 1193 | } |
| 1194 | 1194 | |
| 1195 | 1195 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
| 1196 | - if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1196 | + if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1197 | 1197 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 1198 | 1198 | } |
| 1199 | 1199 | |
@@ -1289,7 +1289,7 @@ discard block |
||
| 1289 | 1289 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1290 | 1290 | |
| 1291 | 1291 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1292 | - if (! class_exists($listenerClassName)) { |
|
| 1292 | + if ( ! class_exists($listenerClassName)) { |
|
| 1293 | 1293 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1294 | 1294 | $listenerClassName, |
| 1295 | 1295 | $metadata->getClassName() |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | $fieldName = $associationOverride->name; |
| 1333 | 1333 | $property = $metadata->getProperty($fieldName); |
| 1334 | 1334 | |
| 1335 | - if (! $property) { |
|
| 1335 | + if ( ! $property) { |
|
| 1336 | 1336 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1337 | 1337 | } |
| 1338 | 1338 | |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | // Check for fetch |
| 1367 | 1367 | if ($associationOverride->fetch) { |
| 1368 | 1368 | $override->setFetchMode( |
| 1369 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1369 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1370 | 1370 | ); |
| 1371 | 1371 | } |
| 1372 | 1372 | |
@@ -1453,7 +1453,7 @@ discard block |
||
| 1453 | 1453 | { |
| 1454 | 1454 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1455 | 1455 | |
| 1456 | - if (! defined($fetchModeConstant)) { |
|
| 1456 | + if ( ! defined($fetchModeConstant)) { |
|
| 1457 | 1457 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1458 | 1458 | } |
| 1459 | 1459 | |
@@ -1503,7 +1503,7 @@ discard block |
||
| 1503 | 1503 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1504 | 1504 | |
| 1505 | 1505 | foreach ($classAnnotations as $key => $annot) { |
| 1506 | - if (! is_numeric($key)) { |
|
| 1506 | + if ( ! is_numeric($key)) { |
|
| 1507 | 1507 | continue; |
| 1508 | 1508 | } |
| 1509 | 1509 | |
@@ -1523,7 +1523,7 @@ discard block |
||
| 1523 | 1523 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1524 | 1524 | |
| 1525 | 1525 | foreach ($propertyAnnotations as $key => $annot) { |
| 1526 | - if (! is_numeric($key)) { |
|
| 1526 | + if ( ! is_numeric($key)) { |
|
| 1527 | 1527 | continue; |
| 1528 | 1528 | } |
| 1529 | 1529 | |
@@ -1543,7 +1543,7 @@ discard block |
||
| 1543 | 1543 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1544 | 1544 | |
| 1545 | 1545 | foreach ($methodAnnotations as $key => $annot) { |
| 1546 | - if (! is_numeric($key)) { |
|
| 1546 | + if ( ! is_numeric($key)) { |
|
| 1547 | 1547 | continue; |
| 1548 | 1548 | } |
| 1549 | 1549 | |
@@ -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 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | return $this->classNames; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if (!$this->paths) { |
|
| 189 | + if ( ! $this->paths) { |
|
| 190 | 190 | throw Mapping\MappingException::pathRequired(); |
| 191 | 191 | } |
| 192 | 192 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 204 | 204 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 205 | 205 | ), |
| 206 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 206 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 207 | 207 | \RecursiveRegexIterator::GET_MATCH |
| 208 | 208 | ); |
| 209 | 209 | |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | { |
| 256 | 256 | $reflectionClass = $metadata->getReflectionClass(); |
| 257 | 257 | |
| 258 | - if (! $reflectionClass) { |
|
| 258 | + if ( ! $reflectionClass) { |
|
| 259 | 259 | // this happens when running annotation driver in combination with |
| 260 | 260 | // static reflection services. This is not the nicest fix |
| 261 | 261 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $classMetadata |
| 292 | 292 | ); |
| 293 | 293 | |
| 294 | - if (! $property) { |
|
| 294 | + if ( ! $property) { |
|
| 295 | 295 | continue; |
| 296 | 296 | } |
| 297 | 297 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | ) |
| 370 | 370 | { |
| 371 | 371 | /** @var Annotation\Entity $entityAnnot */ |
| 372 | - $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
| 372 | + $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
| 373 | 373 | |
| 374 | 374 | if ($entityAnnot->repositoryClass !== null) { |
| 375 | 375 | $metadata->setCustomRepositoryClassName($entityAnnot->repositoryClass); |
@@ -621,11 +621,11 @@ discard block |
||
| 621 | 621 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 622 | 622 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 623 | 623 | |
| 624 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 624 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 625 | 625 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 628 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 629 | 629 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 630 | 630 | } |
| 631 | 631 | |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 686 | 686 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 687 | 687 | |
| 688 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 688 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 689 | 689 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 690 | 690 | } |
| 691 | 691 | |
@@ -748,11 +748,11 @@ discard block |
||
| 748 | 748 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 749 | 749 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 750 | 750 | |
| 751 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 751 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 752 | 752 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 755 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 756 | 756 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 757 | 757 | } |
| 758 | 758 | |
@@ -799,15 +799,15 @@ discard block |
||
| 799 | 799 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 800 | 800 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 801 | 801 | |
| 802 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 802 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 803 | 803 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 804 | 804 | } |
| 805 | 805 | |
| 806 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 806 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 807 | 807 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 808 | 808 | } |
| 809 | 809 | |
| 810 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 810 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 811 | 811 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 812 | 812 | } |
| 813 | 813 | |
@@ -858,15 +858,15 @@ discard block |
||
| 858 | 858 | |
| 859 | 859 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 860 | 860 | |
| 861 | - if (! empty($columnAnnot->name)) { |
|
| 861 | + if ( ! empty($columnAnnot->name)) { |
|
| 862 | 862 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 863 | 863 | } |
| 864 | 864 | |
| 865 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 865 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 866 | 866 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 867 | 867 | } |
| 868 | 868 | |
| 869 | - if (! empty($columnAnnot->length)) { |
|
| 869 | + if ( ! empty($columnAnnot->length)) { |
|
| 870 | 870 | $fieldMetadata->setLength($columnAnnot->length); |
| 871 | 871 | } |
| 872 | 872 | |
@@ -895,11 +895,11 @@ discard block |
||
| 895 | 895 | Mapping\TableMetadata $tableMetadata |
| 896 | 896 | ) : void |
| 897 | 897 | { |
| 898 | - if (! empty($tableAnnot->name)) { |
|
| 898 | + if ( ! empty($tableAnnot->name)) { |
|
| 899 | 899 | $tableMetadata->setName($tableAnnot->name); |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | - if (! empty($tableAnnot->schema)) { |
|
| 902 | + if ( ! empty($tableAnnot->schema)) { |
|
| 903 | 903 | $tableMetadata->setSchema($tableAnnot->schema); |
| 904 | 904 | } |
| 905 | 905 | |
@@ -940,11 +940,11 @@ discard block |
||
| 940 | 940 | { |
| 941 | 941 | $joinTable = new Mapping\JoinTableMetadata(); |
| 942 | 942 | |
| 943 | - if (! empty($joinTableAnnot->name)) { |
|
| 943 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 944 | 944 | $joinTable->setName($joinTableAnnot->name); |
| 945 | 945 | } |
| 946 | 946 | |
| 947 | - if (! empty($joinTableAnnot->schema)) { |
|
| 947 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 948 | 948 | $joinTable->setSchema($joinTableAnnot->schema); |
| 949 | 949 | } |
| 950 | 950 | |
@@ -977,22 +977,22 @@ discard block |
||
| 977 | 977 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 978 | 978 | |
| 979 | 979 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 980 | - if (! empty($joinColumnAnnot->name)) { |
|
| 980 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 981 | 981 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 982 | 982 | } |
| 983 | 983 | |
| 984 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 984 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 985 | 985 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 986 | 986 | } |
| 987 | 987 | |
| 988 | 988 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 989 | 989 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 990 | 990 | |
| 991 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 991 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 992 | 992 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 993 | 993 | } |
| 994 | 994 | |
| 995 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 995 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 996 | 996 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 997 | 997 | } |
| 998 | 998 | |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | ) : Mapping\CacheMetadata |
| 1020 | 1020 | { |
| 1021 | 1021 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 1022 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 1022 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 1023 | 1023 | |
| 1024 | 1024 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 1025 | 1025 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
| 1081 | 1081 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
| 1082 | 1082 | do { |
| 1083 | - if (! $parent->isMappedSuperclass) { |
|
| 1083 | + if ( ! $parent->isMappedSuperclass) { |
|
| 1084 | 1084 | $metadata->setTable($parent->table); |
| 1085 | 1085 | |
| 1086 | 1086 | break; |
@@ -1138,11 +1138,11 @@ discard block |
||
| 1138 | 1138 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1139 | 1139 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1140 | 1140 | |
| 1141 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1141 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1142 | 1142 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1145 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1146 | 1146 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1147 | 1147 | } |
| 1148 | 1148 | } |
@@ -1178,12 +1178,12 @@ discard block |
||
| 1178 | 1178 | if (isset($classAnnotations[Annotation\NamedQueries::class])) { |
| 1179 | 1179 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
| 1180 | 1180 | |
| 1181 | - if (! is_array($namedQueriesAnnot->value)) { |
|
| 1181 | + if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 1182 | 1182 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 1183 | 1183 | } |
| 1184 | 1184 | |
| 1185 | 1185 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
| 1186 | - if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1186 | + if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1187 | 1187 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 1188 | 1188 | } |
| 1189 | 1189 | |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1280 | 1280 | |
| 1281 | 1281 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1282 | - if (! class_exists($listenerClassName)) { |
|
| 1282 | + if ( ! class_exists($listenerClassName)) { |
|
| 1283 | 1283 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1284 | 1284 | $listenerClassName, |
| 1285 | 1285 | $metadata->getClassName() |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | $fieldName = $associationOverride->name; |
| 1322 | 1322 | $property = $metadata->getProperty($fieldName); |
| 1323 | 1323 | |
| 1324 | - if (! $property) { |
|
| 1324 | + if ( ! $property) { |
|
| 1325 | 1325 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1326 | 1326 | } |
| 1327 | 1327 | |
@@ -1355,7 +1355,7 @@ discard block |
||
| 1355 | 1355 | // Check for fetch |
| 1356 | 1356 | if ($associationOverride->fetch) { |
| 1357 | 1357 | $override->setFetchMode( |
| 1358 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1358 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1359 | 1359 | ); |
| 1360 | 1360 | } |
| 1361 | 1361 | |
@@ -1492,7 +1492,7 @@ discard block |
||
| 1492 | 1492 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1493 | 1493 | |
| 1494 | 1494 | foreach ($classAnnotations as $key => $annot) { |
| 1495 | - if (! is_numeric($key)) { |
|
| 1495 | + if ( ! is_numeric($key)) { |
|
| 1496 | 1496 | continue; |
| 1497 | 1497 | } |
| 1498 | 1498 | |
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1513 | 1513 | |
| 1514 | 1514 | foreach ($propertyAnnotations as $key => $annot) { |
| 1515 | - if (! is_numeric($key)) { |
|
| 1515 | + if ( ! is_numeric($key)) { |
|
| 1516 | 1516 | continue; |
| 1517 | 1517 | } |
| 1518 | 1518 | |
@@ -1532,7 +1532,7 @@ discard block |
||
| 1532 | 1532 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1533 | 1533 | |
| 1534 | 1534 | foreach ($methodAnnotations as $key => $annot) { |
| 1535 | - if (! is_numeric($key)) { |
|
| 1535 | + if ( ! is_numeric($key)) { |
|
| 1536 | 1536 | continue; |
| 1537 | 1537 | } |
| 1538 | 1538 | |
@@ -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 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $classNames = array_filter( |
| 124 | 124 | $this->locator->getAllClassNames(null), |
| 125 | - function ($className) { |
|
| 125 | + function($className) { |
|
| 126 | 126 | return ! $this->isTransient($className); |
| 127 | 127 | } |
| 128 | 128 | ); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | ) |
| 211 | 211 | { |
| 212 | 212 | /** @var Annotation\Entity $entityAnnot */ |
| 213 | - $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
| 213 | + $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
| 214 | 214 | $classMetadata = new Mapping\ClassMetadata($reflectionClass->getName(), $parent); |
| 215 | 215 | |
| 216 | 216 | if ($entityAnnot->repositoryClass !== null) { |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | /** @var Annotation\NamedQueries $namedQueriesAnnot */ |
| 275 | 275 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
| 276 | 276 | |
| 277 | - if (! is_array($namedQueriesAnnot->value)) { |
|
| 277 | + if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 278 | 278 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
| 282 | - if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 282 | + if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 283 | 283 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 294 | 294 | |
| 295 | 295 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 296 | - if (! class_exists($listenerClassName)) { |
|
| 296 | + if ( ! class_exists($listenerClassName)) { |
|
| 297 | 297 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 298 | 298 | $listenerClassName, |
| 299 | 299 | $reflectionClass->getName() |
@@ -340,15 +340,15 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | $discriminatorColumn->setColumnName($discriminatorColumnAnnot->name); |
| 342 | 342 | |
| 343 | - if (! empty($discriminatorColumnAnnot->columnDefinition)) { |
|
| 343 | + if ( ! empty($discriminatorColumnAnnot->columnDefinition)) { |
|
| 344 | 344 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnot->columnDefinition); |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - if (! empty($discriminatorColumnAnnot->type)) { |
|
| 347 | + if ( ! empty($discriminatorColumnAnnot->type)) { |
|
| 348 | 348 | $discriminatorColumn->setType(Type::getType($discriminatorColumnAnnot->type)); |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - if (! empty($discriminatorColumnAnnot->length)) { |
|
| 351 | + if ( ! empty($discriminatorColumnAnnot->length)) { |
|
| 352 | 352 | $discriminatorColumn->setLength($discriminatorColumnAnnot->length); |
| 353 | 353 | } |
| 354 | 354 | } |
@@ -408,11 +408,11 @@ discard block |
||
| 408 | 408 | { |
| 409 | 409 | $table = new Mapping\TableMetadata(); |
| 410 | 410 | |
| 411 | - if (! empty($tableAnnot->name)) { |
|
| 411 | + if ( ! empty($tableAnnot->name)) { |
|
| 412 | 412 | $table->setName($tableAnnot->name); |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | - if (! empty($tableAnnot->schema)) { |
|
| 415 | + if ( ! empty($tableAnnot->schema)) { |
|
| 416 | 416 | $table->setSchema($tableAnnot->schema); |
| 417 | 417 | } |
| 418 | 418 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | { |
| 501 | 501 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 502 | 502 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 503 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 503 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 504 | 504 | |
| 505 | 505 | return new Mapping\CacheMetadata($usage, $cacheAnnot->region ?: $defaultRegion); |
| 506 | 506 | } |
@@ -622,11 +622,11 @@ discard block |
||
| 622 | 622 | $fieldMetadata->setPrimaryKey(true); |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 625 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 626 | 626 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | - if (! empty($columnAnnot->length)) { |
|
| 629 | + if ( ! empty($columnAnnot->length)) { |
|
| 630 | 630 | $fieldMetadata->setLength($columnAnnot->length); |
| 631 | 631 | } |
| 632 | 632 | |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | break; |
| 648 | 648 | |
| 649 | 649 | default: |
| 650 | - if (! isset($customOptions['default'])) { |
|
| 650 | + if ( ! isset($customOptions['default'])) { |
|
| 651 | 651 | throw Mapping\MappingException::unsupportedOptimisticLockingType($fieldMetadata->getType()); |
| 652 | 652 | } |
| 653 | 653 | } |
@@ -688,11 +688,11 @@ discard block |
||
| 688 | 688 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 689 | 689 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 690 | 690 | |
| 691 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 691 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 692 | 692 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 695 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 696 | 696 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 697 | 697 | } |
| 698 | 698 | |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 772 | 772 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 773 | 773 | |
| 774 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 774 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 775 | 775 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 776 | 776 | } |
| 777 | 777 | |
@@ -851,11 +851,11 @@ discard block |
||
| 851 | 851 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 852 | 852 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 853 | 853 | |
| 854 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 854 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 855 | 855 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 856 | 856 | } |
| 857 | 857 | |
| 858 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 858 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 859 | 859 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 860 | 860 | } |
| 861 | 861 | |
@@ -912,15 +912,15 @@ discard block |
||
| 912 | 912 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 913 | 913 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 914 | 914 | |
| 915 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 915 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 916 | 916 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 919 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 920 | 920 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 921 | 921 | } |
| 922 | 922 | |
| 923 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 923 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 924 | 924 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 925 | 925 | } |
| 926 | 926 | |
@@ -976,11 +976,11 @@ discard block |
||
| 976 | 976 | { |
| 977 | 977 | $joinTable = new Mapping\JoinTableMetadata(); |
| 978 | 978 | |
| 979 | - if (! empty($joinTableAnnot->name)) { |
|
| 979 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 980 | 980 | $joinTable->setName($joinTableAnnot->name); |
| 981 | 981 | } |
| 982 | 982 | |
| 983 | - if (! empty($joinTableAnnot->schema)) { |
|
| 983 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 984 | 984 | $joinTable->setSchema($joinTableAnnot->schema); |
| 985 | 985 | } |
| 986 | 986 | |
@@ -1036,11 +1036,11 @@ discard block |
||
| 1036 | 1036 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 1037 | 1037 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 1038 | 1038 | |
| 1039 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 1039 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 1040 | 1040 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 1041 | 1041 | } |
| 1042 | 1042 | |
| 1043 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 1043 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 1044 | 1044 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 1045 | 1045 | } |
| 1046 | 1046 | |
@@ -1098,7 +1098,7 @@ discard block |
||
| 1098 | 1098 | { |
| 1099 | 1099 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1100 | 1100 | |
| 1101 | - if (! defined($fetchModeConstant)) { |
|
| 1101 | + if ( ! defined($fetchModeConstant)) { |
|
| 1102 | 1102 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1103 | 1103 | } |
| 1104 | 1104 | |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1143 | 1143 | |
| 1144 | 1144 | foreach ($classAnnotations as $key => $annot) { |
| 1145 | - if (! is_numeric($key)) { |
|
| 1145 | + if ( ! is_numeric($key)) { |
|
| 1146 | 1146 | continue; |
| 1147 | 1147 | } |
| 1148 | 1148 | |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1163 | 1163 | |
| 1164 | 1164 | foreach ($propertyAnnotations as $key => $annot) { |
| 1165 | - if (! is_numeric($key)) { |
|
| 1165 | + if ( ! is_numeric($key)) { |
|
| 1166 | 1166 | continue; |
| 1167 | 1167 | } |
| 1168 | 1168 | |
@@ -1182,7 +1182,7 @@ discard block |
||
| 1182 | 1182 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1183 | 1183 | |
| 1184 | 1184 | foreach ($methodAnnotations as $key => $annot) { |
| 1185 | - if (! is_numeric($key)) { |
|
| 1185 | + if ( ! is_numeric($key)) { |
|
| 1186 | 1186 | continue; |
| 1187 | 1187 | } |
| 1188 | 1188 | |
@@ -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 | |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | |
| 474 | 474 | if (isset($manyToOneElement['fetch'])) { |
| 475 | 475 | $association->setFetchMode( |
| 476 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
| 476 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
| 477 | 477 | ); |
| 478 | 478 | } |
| 479 | 479 | |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | $fieldName = (string) $overrideElement['name']; |
| 626 | 626 | $property = $metadata->getProperty($fieldName); |
| 627 | 627 | |
| 628 | - if (! $property) { |
|
| 628 | + if ( ! $property) { |
|
| 629 | 629 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 630 | 630 | } |
| 631 | 631 | |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | // Check for fetch |
| 684 | 684 | if (isset($overrideElement['fetch'])) { |
| 685 | 685 | $override->setFetchMode( |
| 686 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
| 686 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
| 687 | 687 | ); |
| 688 | 688 | } |
| 689 | 689 | |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | // Evaluate <lifecycle-callbacks...> |
| 695 | 695 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
| 696 | 696 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
| 697 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
| 697 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
| 698 | 698 | $methodName = (string) $lifecycleCallback['method']; |
| 699 | 699 | |
| 700 | 700 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
| 707 | 707 | $listenerClassName = (string) $listenerElement['class']; |
| 708 | 708 | |
| 709 | - if (! class_exists($listenerClassName)) { |
|
| 709 | + if ( ! class_exists($listenerClassName)) { |
|
| 710 | 710 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 711 | 711 | $listenerClassName, |
| 712 | 712 | $metadata->getClassName() |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | ) |
| 882 | 882 | { |
| 883 | 883 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 884 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 884 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 885 | 885 | |
| 886 | 886 | $region = (string) ($cacheMapping['region'] ?? $defaultRegion); |
| 887 | 887 | $usage = isset($cacheMapping['usage']) |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | Events::preFlush, |
| 913 | 913 | ]; |
| 914 | 914 | |
| 915 | - return array_filter($events, function ($eventName) use ($method) { |
|
| 915 | + return array_filter($events, function($eventName) use ($method) { |
|
| 916 | 916 | return $eventName === $method->getName(); |
| 917 | 917 | }); |
| 918 | 918 | } |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | * @ORM\DiscriminatorMap({"parent" = CTIParent::class, "child" = CTIChild::class}) |
| 88 | 88 | */ |
| 89 | 89 | class CTIParent { |
| 90 | - /** |
|
| 91 | - * @ORM\Id @ORM\Column(type="integer") |
|
| 92 | - * @ORM\GeneratedValue(strategy="AUTO") |
|
| 93 | - */ |
|
| 90 | + /** |
|
| 91 | + * @ORM\Id @ORM\Column(type="integer") |
|
| 92 | + * @ORM\GeneratedValue(strategy="AUTO") |
|
| 93 | + */ |
|
| 94 | 94 | private $id; |
| 95 | 95 | |
| 96 | 96 | /** @ORM\OneToOne(targetEntity=CTIRelated::class, mappedBy="ctiParent") */ |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | * @ORM\Entity @ORM\Table(name="cti_children") |
| 115 | 115 | */ |
| 116 | 116 | class CTIChild extends CTIParent { |
| 117 | - /** |
|
| 118 | - * @ORM\Column(type="string") |
|
| 119 | - */ |
|
| 117 | + /** |
|
| 118 | + * @ORM\Column(type="string") |
|
| 119 | + */ |
|
| 120 | 120 | private $data; |
| 121 | 121 | |
| 122 | 122 | public function getData() { |
@@ -54,65 +54,65 @@ |
||
| 54 | 54 | /** @ORM\Column(type="string", nullable=false) */ |
| 55 | 55 | protected $name; |
| 56 | 56 | |
| 57 | - /** @ORM\Column(type="string", nullable=true) */ |
|
| 58 | - protected $description; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * @ORM\ManyToMany(targetEntity=DDC719Group::class, inversedBy="parents") |
|
| 62 | - * @ORM\JoinTable(name="groups_groups", |
|
| 63 | - * joinColumns={@ORM\JoinColumn(name="parent_id", referencedColumnName="id")}, |
|
| 64 | - * inverseJoinColumns={@ORM\JoinColumn(name="child_id", referencedColumnName="id")} |
|
| 65 | - * ) |
|
| 66 | - */ |
|
| 67 | - protected $children; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * @ORM\ManyToMany(targetEntity=DDC719Group::class, mappedBy="children") |
|
| 71 | - */ |
|
| 72 | - protected $parents; |
|
| 73 | - |
|
| 74 | - /** |
|
| 75 | - * construct |
|
| 76 | - */ |
|
| 77 | - public function __construct() { |
|
| 78 | - parent::__construct(); |
|
| 79 | - |
|
| 80 | - $this->channels = new ArrayCollection(); |
|
| 81 | - $this->children = new ArrayCollection(); |
|
| 82 | - $this->parents = new ArrayCollection(); |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - /** |
|
| 86 | - * adds group as new child |
|
| 87 | - * |
|
| 88 | - * @param Group $child |
|
| 89 | - */ |
|
| 90 | - public function addGroup(Group $child) { |
|
| 57 | + /** @ORM\Column(type="string", nullable=true) */ |
|
| 58 | + protected $description; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * @ORM\ManyToMany(targetEntity=DDC719Group::class, inversedBy="parents") |
|
| 62 | + * @ORM\JoinTable(name="groups_groups", |
|
| 63 | + * joinColumns={@ORM\JoinColumn(name="parent_id", referencedColumnName="id")}, |
|
| 64 | + * inverseJoinColumns={@ORM\JoinColumn(name="child_id", referencedColumnName="id")} |
|
| 65 | + * ) |
|
| 66 | + */ |
|
| 67 | + protected $children; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * @ORM\ManyToMany(targetEntity=DDC719Group::class, mappedBy="children") |
|
| 71 | + */ |
|
| 72 | + protected $parents; |
|
| 73 | + |
|
| 74 | + /** |
|
| 75 | + * construct |
|
| 76 | + */ |
|
| 77 | + public function __construct() { |
|
| 78 | + parent::__construct(); |
|
| 79 | + |
|
| 80 | + $this->channels = new ArrayCollection(); |
|
| 81 | + $this->children = new ArrayCollection(); |
|
| 82 | + $this->parents = new ArrayCollection(); |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * adds group as new child |
|
| 87 | + * |
|
| 88 | + * @param Group $child |
|
| 89 | + */ |
|
| 90 | + public function addGroup(Group $child) { |
|
| 91 | 91 | if ( ! $this->children->contains($child)) { |
| 92 | 92 | $this->children->add($child); |
| 93 | 93 | $child->addGroup($this); |
| 94 | 94 | } |
| 95 | - } |
|
| 96 | - |
|
| 97 | - /** |
|
| 98 | - * adds channel as new child |
|
| 99 | - * |
|
| 100 | - * @param Channel $child |
|
| 101 | - */ |
|
| 102 | - public function addChannel(Channel $child) { |
|
| 95 | + } |
|
| 96 | + |
|
| 97 | + /** |
|
| 98 | + * adds channel as new child |
|
| 99 | + * |
|
| 100 | + * @param Channel $child |
|
| 101 | + */ |
|
| 102 | + public function addChannel(Channel $child) { |
|
| 103 | 103 | if ( ! $this->channels->contains($child)) { |
| 104 | 104 | $this->channels->add($child); |
| 105 | 105 | } |
| 106 | - } |
|
| 107 | - |
|
| 108 | - /** |
|
| 109 | - * getter & setter |
|
| 110 | - */ |
|
| 111 | - public function getName() { return $this->name; } |
|
| 112 | - public function setName($name) { $this->name = $name; } |
|
| 113 | - public function getDescription() { return $this->description; } |
|
| 114 | - public function setDescription($description) { $this->description = $description; } |
|
| 115 | - public function getChildren() { return $this->children; } |
|
| 116 | - public function getParents() { return $this->parents; } |
|
| 117 | - public function getChannels() { return $this->channels; } |
|
| 106 | + } |
|
| 107 | + |
|
| 108 | + /** |
|
| 109 | + * getter & setter |
|
| 110 | + */ |
|
| 111 | + public function getName() { return $this->name; } |
|
| 112 | + public function setName($name) { $this->name = $name; } |
|
| 113 | + public function getDescription() { return $this->description; } |
|
| 114 | + public function setDescription($description) { $this->description = $description; } |
|
| 115 | + public function getChildren() { return $this->children; } |
|
| 116 | + public function getParents() { return $this->parents; } |
|
| 117 | + public function getChannels() { return $this->channels; } |
|
| 118 | 118 | } |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $qb = $this->em->createQueryBuilder(); |
| 29 | 29 | $qb->select('p', 'r') |
| 30 | - ->from(__NAMESPACE__ . '\DDC698Privilege', 'p') |
|
| 31 | - ->leftJoin('p.roles', 'r'); |
|
| 30 | + ->from(__NAMESPACE__ . '\DDC698Privilege', 'p') |
|
| 31 | + ->leftJoin('p.roles', 'r'); |
|
| 32 | 32 | |
| 33 | 33 | self::assertSQLEquals( |
| 34 | 34 | 'SELECT t0."privilegeID" AS c0, t0."name" AS c1, t1."roleID" AS c2, t1."name" AS c3, t1."shortName" AS c4 FROM "Privileges" t0 LEFT JOIN "RolePrivileges" t2 ON t0."privilegeID" = t2."privilegeID" LEFT JOIN "Roles" t1 ON t1."roleID" = t2."roleID"', |
@@ -44,37 +44,37 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | class DDC698Role |
| 46 | 46 | { |
| 47 | - /** |
|
| 48 | - * @ORM\Id @ORM\Column(name="roleID", type="integer") |
|
| 49 | - * @ORM\GeneratedValue(strategy="AUTO") |
|
| 50 | - * |
|
| 51 | - */ |
|
| 52 | - protected $roleID; |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * @ORM\Column(name="name", type="string", length=45) |
|
| 56 | - * |
|
| 57 | - * |
|
| 58 | - */ |
|
| 59 | - protected $name; |
|
| 60 | - |
|
| 61 | - /** |
|
| 62 | - * @ORM\Column(name="shortName", type="string", length=45) |
|
| 63 | - * |
|
| 64 | - * |
|
| 65 | - */ |
|
| 66 | - protected $shortName; |
|
| 67 | - |
|
| 68 | - |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * @ORM\ManyToMany(targetEntity=DDC698Privilege::class, inversedBy="roles") |
|
| 72 | - * @ORM\JoinTable(name="RolePrivileges", |
|
| 73 | - * joinColumns={@ORM\JoinColumn(name="roleID", referencedColumnName="roleID")}, |
|
| 74 | - * inverseJoinColumns={@ORM\JoinColumn(name="privilegeID", referencedColumnName="privilegeID")} |
|
| 75 | - * ) |
|
| 76 | - */ |
|
| 77 | - protected $privilege; |
|
| 47 | + /** |
|
| 48 | + * @ORM\Id @ORM\Column(name="roleID", type="integer") |
|
| 49 | + * @ORM\GeneratedValue(strategy="AUTO") |
|
| 50 | + * |
|
| 51 | + */ |
|
| 52 | + protected $roleID; |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * @ORM\Column(name="name", type="string", length=45) |
|
| 56 | + * |
|
| 57 | + * |
|
| 58 | + */ |
|
| 59 | + protected $name; |
|
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * @ORM\Column(name="shortName", type="string", length=45) |
|
| 63 | + * |
|
| 64 | + * |
|
| 65 | + */ |
|
| 66 | + protected $shortName; |
|
| 67 | + |
|
| 68 | + |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * @ORM\ManyToMany(targetEntity=DDC698Privilege::class, inversedBy="roles") |
|
| 72 | + * @ORM\JoinTable(name="RolePrivileges", |
|
| 73 | + * joinColumns={@ORM\JoinColumn(name="roleID", referencedColumnName="roleID")}, |
|
| 74 | + * inverseJoinColumns={@ORM\JoinColumn(name="privilegeID", referencedColumnName="privilegeID")} |
|
| 75 | + * ) |
|
| 76 | + */ |
|
| 77 | + protected $privilege; |
|
| 78 | 78 | |
| 79 | 79 | } |
| 80 | 80 | |
@@ -86,22 +86,22 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | class DDC698Privilege |
| 88 | 88 | { |
| 89 | - /** |
|
| 90 | - * @ORM\Id @ORM\Column(name="privilegeID", type="integer") |
|
| 91 | - * @ORM\GeneratedValue(strategy="AUTO") |
|
| 92 | - * |
|
| 93 | - */ |
|
| 94 | - protected $privilegeID; |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * @ORM\Column(name="name", type="string", length=45) |
|
| 98 | - * |
|
| 99 | - * |
|
| 100 | - */ |
|
| 101 | - protected $name; |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * @ORM\ManyToMany(targetEntity=DDC698Role::class, mappedBy="privilege") |
|
| 105 | - */ |
|
| 106 | - protected $roles; |
|
| 89 | + /** |
|
| 90 | + * @ORM\Id @ORM\Column(name="privilegeID", type="integer") |
|
| 91 | + * @ORM\GeneratedValue(strategy="AUTO") |
|
| 92 | + * |
|
| 93 | + */ |
|
| 94 | + protected $privilegeID; |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * @ORM\Column(name="name", type="string", length=45) |
|
| 98 | + * |
|
| 99 | + * |
|
| 100 | + */ |
|
| 101 | + protected $name; |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * @ORM\ManyToMany(targetEntity=DDC698Role::class, mappedBy="privilege") |
|
| 105 | + */ |
|
| 106 | + protected $roles; |
|
| 107 | 107 | } |