@@ -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\Factory; |
| 6 | 6 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function embeddedFieldToColumnName($propertyName, $embeddedColumnName, $className = null, $embeddedClassName = null) |
| 36 | 36 | { |
| 37 | - return $propertyName . '_' . $embeddedColumnName; |
|
| 37 | + return $propertyName.'_'.$embeddedColumnName; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function joinColumnName($propertyName, $className = null) |
| 52 | 52 | { |
| 53 | - return $propertyName . '_' . $this->referenceColumnName(); |
|
| 53 | + return $propertyName.'_'.$this->referenceColumnName(); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) |
| 60 | 60 | { |
| 61 | - return strtolower($this->classToTableName($sourceEntity) . '_' . |
|
| 61 | + return strtolower($this->classToTableName($sourceEntity).'_'. |
|
| 62 | 62 | $this->classToTableName($targetEntity)); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function joinKeyColumnName($entityName, $referencedColumnName = null) |
| 69 | 69 | { |
| 70 | - return strtolower($this->classToTableName($entityName) . '_' . |
|
| 70 | + return strtolower($this->classToTableName($entityName).'_'. |
|
| 71 | 71 | ($referencedColumnName ?: $this->referenceColumnName())); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -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\Factory; |
| 6 | 6 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function embeddedFieldToColumnName($propertyName, $embeddedColumnName, $className = null, $embeddedClassName = null) |
| 71 | 71 | { |
| 72 | - return $this->underscore($propertyName) . '_' . $embeddedColumnName; |
|
| 72 | + return $this->underscore($propertyName).'_'.$embeddedColumnName; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function joinColumnName($propertyName, $className = null) |
| 87 | 87 | { |
| 88 | - return $this->underscore($propertyName) . '_' . $this->referenceColumnName(); |
|
| 88 | + return $this->underscore($propertyName).'_'.$this->referenceColumnName(); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) |
| 95 | 95 | { |
| 96 | - return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity); |
|
| 96 | + return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function joinKeyColumnName($entityName, $referencedColumnName = null) |
| 103 | 103 | { |
| 104 | - return $this->classToTableName($entityName) . '_' . |
|
| 104 | + return $this->classToTableName($entityName).'_'. |
|
| 105 | 105 | ($referencedColumnName ?: $this->referenceColumnName()); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -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 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | return $this->classNames; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if (! $this->paths) { |
|
| 181 | + if ( ! $this->paths) { |
|
| 182 | 182 | throw Mapping\MappingException::pathRequired(); |
| 183 | 183 | } |
| 184 | 184 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $includedFiles = []; |
| 187 | 187 | |
| 188 | 188 | foreach ($this->paths as $path) { |
| 189 | - if (! is_dir($path)) { |
|
| 189 | + if ( ! is_dir($path)) { |
|
| 190 | 190 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 191 | 191 | } |
| 192 | 192 | |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 196 | 196 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 197 | 197 | ), |
| 198 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 198 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 199 | 199 | \RecursiveRegexIterator::GET_MATCH |
| 200 | 200 | ); |
| 201 | 201 | |
| 202 | 202 | foreach ($iterator as $file) { |
| 203 | 203 | $sourceFile = $file[0]; |
| 204 | 204 | |
| 205 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
| 205 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 206 | 206 | $sourceFile = realpath($sourceFile); |
| 207 | 207 | } |
| 208 | 208 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | ) : Mapping\ClassMetadata { |
| 247 | 247 | $reflectionClass = $metadata->getReflectionClass(); |
| 248 | 248 | |
| 249 | - if (! $reflectionClass) { |
|
| 249 | + if ( ! $reflectionClass) { |
|
| 250 | 250 | // this happens when running annotation driver in combination with |
| 251 | 251 | // static reflection services. This is not the nicest fix |
| 252 | 252 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $classMetadata |
| 283 | 283 | ); |
| 284 | 284 | |
| 285 | - if (! $property) { |
|
| 285 | + if ( ! $property) { |
|
| 286 | 286 | continue; |
| 287 | 287 | } |
| 288 | 288 | |
@@ -579,11 +579,11 @@ discard block |
||
| 579 | 579 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 580 | 580 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 581 | 581 | |
| 582 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 582 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 583 | 583 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 586 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 587 | 587 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 588 | 588 | } |
| 589 | 589 | |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 641 | 641 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 642 | 642 | |
| 643 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 643 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 644 | 644 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 645 | 645 | } |
| 646 | 646 | |
@@ -698,11 +698,11 @@ discard block |
||
| 698 | 698 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 699 | 699 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 700 | 700 | |
| 701 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 701 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 702 | 702 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 705 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 706 | 706 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 707 | 707 | } |
| 708 | 708 | |
@@ -744,15 +744,15 @@ discard block |
||
| 744 | 744 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 745 | 745 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 746 | 746 | |
| 747 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 747 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 748 | 748 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 751 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 752 | 752 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 755 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 756 | 756 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 757 | 757 | } |
| 758 | 758 | |
@@ -796,15 +796,15 @@ discard block |
||
| 796 | 796 | |
| 797 | 797 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 798 | 798 | |
| 799 | - if (! empty($columnAnnot->name)) { |
|
| 799 | + if ( ! empty($columnAnnot->name)) { |
|
| 800 | 800 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 803 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 804 | 804 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 805 | 805 | } |
| 806 | 806 | |
| 807 | - if (! empty($columnAnnot->length)) { |
|
| 807 | + if ( ! empty($columnAnnot->length)) { |
|
| 808 | 808 | $fieldMetadata->setLength($columnAnnot->length); |
| 809 | 809 | } |
| 810 | 810 | |
@@ -827,11 +827,11 @@ discard block |
||
| 827 | 827 | Annotation\Table $tableAnnot, |
| 828 | 828 | Mapping\TableMetadata $tableMetadata |
| 829 | 829 | ) : void { |
| 830 | - if (! empty($tableAnnot->name)) { |
|
| 830 | + if ( ! empty($tableAnnot->name)) { |
|
| 831 | 831 | $tableMetadata->setName($tableAnnot->name); |
| 832 | 832 | } |
| 833 | 833 | |
| 834 | - if (! empty($tableAnnot->schema)) { |
|
| 834 | + if ( ! empty($tableAnnot->schema)) { |
|
| 835 | 835 | $tableMetadata->setSchema($tableAnnot->schema); |
| 836 | 836 | } |
| 837 | 837 | |
@@ -867,11 +867,11 @@ discard block |
||
| 867 | 867 | ) : Mapping\JoinTableMetadata { |
| 868 | 868 | $joinTable = new Mapping\JoinTableMetadata(); |
| 869 | 869 | |
| 870 | - if (! empty($joinTableAnnot->name)) { |
|
| 870 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 871 | 871 | $joinTable->setName($joinTableAnnot->name); |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | - if (! empty($joinTableAnnot->schema)) { |
|
| 874 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 875 | 875 | $joinTable->setSchema($joinTableAnnot->schema); |
| 876 | 876 | } |
| 877 | 877 | |
@@ -899,22 +899,22 @@ discard block |
||
| 899 | 899 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 900 | 900 | |
| 901 | 901 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 902 | - if (! empty($joinColumnAnnot->name)) { |
|
| 902 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 903 | 903 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 906 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 907 | 907 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 911 | 911 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 912 | 912 | |
| 913 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 913 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 914 | 914 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 915 | 915 | } |
| 916 | 916 | |
| 917 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 917 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 918 | 918 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 919 | 919 | } |
| 920 | 920 | |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | $fieldName = null |
| 937 | 937 | ) : Mapping\CacheMetadata { |
| 938 | 938 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 939 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 939 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 940 | 940 | |
| 941 | 941 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 942 | 942 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
| 998 | 998 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
| 999 | 999 | do { |
| 1000 | - if (! $parent->isMappedSuperclass) { |
|
| 1000 | + if ( ! $parent->isMappedSuperclass) { |
|
| 1001 | 1001 | $metadata->setTable($parent->table); |
| 1002 | 1002 | |
| 1003 | 1003 | break; |
@@ -1052,11 +1052,11 @@ discard block |
||
| 1052 | 1052 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1053 | 1053 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1054 | 1054 | |
| 1055 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1055 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1056 | 1056 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1057 | 1057 | } |
| 1058 | 1058 | |
| 1059 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1059 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1060 | 1060 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1061 | 1061 | } |
| 1062 | 1062 | } |
@@ -1087,12 +1087,12 @@ discard block |
||
| 1087 | 1087 | if (isset($classAnnotations[Annotation\NamedQueries::class])) { |
| 1088 | 1088 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
| 1089 | 1089 | |
| 1090 | - if (! is_array($namedQueriesAnnot->value)) { |
|
| 1090 | + if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 1091 | 1091 | throw new \UnexpectedValueException('@NamedQueries should contain an array of @NamedQuery annotations.'); |
| 1092 | 1092 | } |
| 1093 | 1093 | |
| 1094 | 1094 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
| 1095 | - if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1095 | + if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1096 | 1096 | throw new \UnexpectedValueException('@NamedQueries should contain an array of @NamedQuery annotations.'); |
| 1097 | 1097 | } |
| 1098 | 1098 | |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1174 | 1174 | |
| 1175 | 1175 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1176 | - if (! class_exists($listenerClassName)) { |
|
| 1176 | + if ( ! class_exists($listenerClassName)) { |
|
| 1177 | 1177 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1178 | 1178 | $listenerClassName, |
| 1179 | 1179 | $metadata->getClassName() |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | $fieldName = $associationOverride->name; |
| 1211 | 1211 | $property = $metadata->getProperty($fieldName); |
| 1212 | 1212 | |
| 1213 | - if (! $property) { |
|
| 1213 | + if ( ! $property) { |
|
| 1214 | 1214 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1215 | 1215 | } |
| 1216 | 1216 | |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | // Check for fetch |
| 1245 | 1245 | if ($associationOverride->fetch) { |
| 1246 | 1246 | $override->setFetchMode( |
| 1247 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1247 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1248 | 1248 | ); |
| 1249 | 1249 | } |
| 1250 | 1250 | |
@@ -1333,7 +1333,7 @@ discard block |
||
| 1333 | 1333 | { |
| 1334 | 1334 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1335 | 1335 | |
| 1336 | - if (! defined($fetchModeConstant)) { |
|
| 1336 | + if ( ! defined($fetchModeConstant)) { |
|
| 1337 | 1337 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1338 | 1338 | } |
| 1339 | 1339 | |
@@ -1379,7 +1379,7 @@ discard block |
||
| 1379 | 1379 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1380 | 1380 | |
| 1381 | 1381 | foreach ($classAnnotations as $key => $annot) { |
| 1382 | - if (! is_numeric($key)) { |
|
| 1382 | + if ( ! is_numeric($key)) { |
|
| 1383 | 1383 | continue; |
| 1384 | 1384 | } |
| 1385 | 1385 | |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1398 | 1398 | |
| 1399 | 1399 | foreach ($propertyAnnotations as $key => $annot) { |
| 1400 | - if (! is_numeric($key)) { |
|
| 1400 | + if ( ! is_numeric($key)) { |
|
| 1401 | 1401 | continue; |
| 1402 | 1402 | } |
| 1403 | 1403 | |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1416 | 1416 | |
| 1417 | 1417 | foreach ($methodAnnotations as $key => $annot) { |
| 1418 | - if (! is_numeric($key)) { |
|
| 1418 | + if ( ! is_numeric($key)) { |
|
| 1419 | 1419 | continue; |
| 1420 | 1420 | } |
| 1421 | 1421 | |
@@ -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 | ); |
@@ -268,12 +268,12 @@ discard block |
||
| 268 | 268 | /** @var Annotation\NamedQueries $namedQueriesAnnot */ |
| 269 | 269 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
| 270 | 270 | |
| 271 | - if (! is_array($namedQueriesAnnot->value)) { |
|
| 271 | + if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 272 | 272 | throw new \UnexpectedValueException('@NamedQueries should contain an array of @NamedQuery annotations.'); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
| 276 | - if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 276 | + if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 277 | 277 | throw new \UnexpectedValueException('@NamedQueries should contain an array of @NamedQuery annotations.'); |
| 278 | 278 | } |
| 279 | 279 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 288 | 288 | |
| 289 | 289 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 290 | - if (! class_exists($listenerClassName)) { |
|
| 290 | + if ( ! class_exists($listenerClassName)) { |
|
| 291 | 291 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 292 | 292 | $listenerClassName, |
| 293 | 293 | $reflectionClass->getName() |
@@ -334,15 +334,15 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | $discriminatorColumn->setColumnName($discriminatorColumnAnnot->name); |
| 336 | 336 | |
| 337 | - if (! empty($discriminatorColumnAnnot->columnDefinition)) { |
|
| 337 | + if ( ! empty($discriminatorColumnAnnot->columnDefinition)) { |
|
| 338 | 338 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnot->columnDefinition); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - if (! empty($discriminatorColumnAnnot->type)) { |
|
| 341 | + if ( ! empty($discriminatorColumnAnnot->type)) { |
|
| 342 | 342 | $discriminatorColumn->setType(Type::getType($discriminatorColumnAnnot->type)); |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | - if (! empty($discriminatorColumnAnnot->length)) { |
|
| 345 | + if ( ! empty($discriminatorColumnAnnot->length)) { |
|
| 346 | 346 | $discriminatorColumn->setLength($discriminatorColumnAnnot->length); |
| 347 | 347 | } |
| 348 | 348 | } |
@@ -397,11 +397,11 @@ discard block |
||
| 397 | 397 | { |
| 398 | 398 | $table = new Mapping\TableMetadata(); |
| 399 | 399 | |
| 400 | - if (! empty($tableAnnot->name)) { |
|
| 400 | + if ( ! empty($tableAnnot->name)) { |
|
| 401 | 401 | $table->setName($tableAnnot->name); |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | - if (! empty($tableAnnot->schema)) { |
|
| 404 | + if ( ! empty($tableAnnot->schema)) { |
|
| 405 | 405 | $table->setSchema($tableAnnot->schema); |
| 406 | 406 | } |
| 407 | 407 | |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | ) { |
| 485 | 485 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 486 | 486 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 487 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 487 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 488 | 488 | |
| 489 | 489 | return new Mapping\CacheMetadata($usage, $cacheAnnot->region ?: $defaultRegion); |
| 490 | 490 | } |
@@ -600,11 +600,11 @@ discard block |
||
| 600 | 600 | $fieldMetadata->setPrimaryKey(true); |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 603 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 604 | 604 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | - if (! empty($columnAnnot->length)) { |
|
| 607 | + if ( ! empty($columnAnnot->length)) { |
|
| 608 | 608 | $fieldMetadata->setLength($columnAnnot->length); |
| 609 | 609 | } |
| 610 | 610 | |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | break; |
| 626 | 626 | |
| 627 | 627 | default: |
| 628 | - if (! isset($customOptions['default'])) { |
|
| 628 | + if ( ! isset($customOptions['default'])) { |
|
| 629 | 629 | throw Mapping\MappingException::unsupportedOptimisticLockingType($fieldMetadata->getType()); |
| 630 | 630 | } |
| 631 | 631 | } |
@@ -663,11 +663,11 @@ discard block |
||
| 663 | 663 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 664 | 664 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 665 | 665 | |
| 666 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 666 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 667 | 667 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 670 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 671 | 671 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 672 | 672 | } |
| 673 | 673 | |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 744 | 744 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 745 | 745 | |
| 746 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 746 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 747 | 747 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 748 | 748 | } |
| 749 | 749 | |
@@ -820,11 +820,11 @@ discard block |
||
| 820 | 820 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 821 | 821 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 822 | 822 | |
| 823 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 823 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 824 | 824 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 825 | 825 | } |
| 826 | 826 | |
| 827 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 827 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 828 | 828 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 829 | 829 | } |
| 830 | 830 | |
@@ -878,15 +878,15 @@ discard block |
||
| 878 | 878 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 879 | 879 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 880 | 880 | |
| 881 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 881 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 882 | 882 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 883 | 883 | } |
| 884 | 884 | |
| 885 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 885 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 886 | 886 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 887 | 887 | } |
| 888 | 888 | |
| 889 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 889 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 890 | 890 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 891 | 891 | } |
| 892 | 892 | |
@@ -937,11 +937,11 @@ discard block |
||
| 937 | 937 | ) { |
| 938 | 938 | $joinTable = new Mapping\JoinTableMetadata(); |
| 939 | 939 | |
| 940 | - if (! empty($joinTableAnnot->name)) { |
|
| 940 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 941 | 941 | $joinTable->setName($joinTableAnnot->name); |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | - if (! empty($joinTableAnnot->schema)) { |
|
| 944 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 945 | 945 | $joinTable->setSchema($joinTableAnnot->schema); |
| 946 | 946 | } |
| 947 | 947 | |
@@ -994,11 +994,11 @@ discard block |
||
| 994 | 994 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 995 | 995 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 996 | 996 | |
| 997 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 997 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 998 | 998 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 999 | 999 | } |
| 1000 | 1000 | |
| 1001 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 1001 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 1002 | 1002 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 1003 | 1003 | } |
| 1004 | 1004 | |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | { |
| 1055 | 1055 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1056 | 1056 | |
| 1057 | - if (! defined($fetchModeConstant)) { |
|
| 1057 | + if ( ! defined($fetchModeConstant)) { |
|
| 1058 | 1058 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1059 | 1059 | } |
| 1060 | 1060 | |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1097 | 1097 | |
| 1098 | 1098 | foreach ($classAnnotations as $key => $annot) { |
| 1099 | - if (! is_numeric($key)) { |
|
| 1099 | + if ( ! is_numeric($key)) { |
|
| 1100 | 1100 | continue; |
| 1101 | 1101 | } |
| 1102 | 1102 | |
@@ -1115,7 +1115,7 @@ discard block |
||
| 1115 | 1115 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1116 | 1116 | |
| 1117 | 1117 | foreach ($propertyAnnotations as $key => $annot) { |
| 1118 | - if (! is_numeric($key)) { |
|
| 1118 | + if ( ! is_numeric($key)) { |
|
| 1119 | 1119 | continue; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1135 | 1135 | |
| 1136 | 1136 | foreach ($methodAnnotations as $key => $annot) { |
| 1137 | - if (! is_numeric($key)) { |
|
| 1137 | + if ( ! is_numeric($key)) { |
|
| 1138 | 1138 | continue; |
| 1139 | 1139 | } |
| 1140 | 1140 | |
@@ -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 | |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | if (isset($manyToOneElement['fetch'])) { |
| 465 | 465 | $association->setFetchMode( |
| 466 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
| 466 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
| 467 | 467 | ); |
| 468 | 468 | } |
| 469 | 469 | |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | $fieldName = (string) $overrideElement['name']; |
| 616 | 616 | $property = $metadata->getProperty($fieldName); |
| 617 | 617 | |
| 618 | - if (! $property) { |
|
| 618 | + if ( ! $property) { |
|
| 619 | 619 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 620 | 620 | } |
| 621 | 621 | |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | // Check for fetch |
| 674 | 674 | if (isset($overrideElement['fetch'])) { |
| 675 | 675 | $override->setFetchMode( |
| 676 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
| 676 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
| 677 | 677 | ); |
| 678 | 678 | } |
| 679 | 679 | |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | // Evaluate <lifecycle-callbacks...> |
| 685 | 685 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
| 686 | 686 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
| 687 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
| 687 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
| 688 | 688 | $methodName = (string) $lifecycleCallback['method']; |
| 689 | 689 | |
| 690 | 690 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
| 697 | 697 | $listenerClassName = (string) $listenerElement['class']; |
| 698 | 698 | |
| 699 | - if (! class_exists($listenerClassName)) { |
|
| 699 | + if ( ! class_exists($listenerClassName)) { |
|
| 700 | 700 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 701 | 701 | $listenerClassName, |
| 702 | 702 | $metadata->getClassName() |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | $fieldName = null |
| 864 | 864 | ) { |
| 865 | 865 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 866 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 866 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 867 | 867 | |
| 868 | 868 | $region = (string) ($cacheMapping['region'] ?? $defaultRegion); |
| 869 | 869 | $usage = isset($cacheMapping['usage']) |
@@ -892,7 +892,7 @@ discard block |
||
| 892 | 892 | Events::preFlush, |
| 893 | 893 | ]; |
| 894 | 894 | |
| 895 | - return array_filter($events, function ($eventName) use ($method) { |
|
| 895 | + return array_filter($events, function($eventName) use ($method) { |
|
| 896 | 896 | return $eventName === $method->getName(); |
| 897 | 897 | }); |
| 898 | 898 | } |
@@ -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 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | foreach ($this->drivers as $namespace => $driver) { |
| 99 | 99 | $oid = spl_object_id($driver); |
| 100 | 100 | |
| 101 | - if (! isset($driverClasses[$oid])) { |
|
| 101 | + if ( ! isset($driverClasses[$oid])) { |
|
| 102 | 102 | $driverClasses[$oid] = $driver->getAllClassNames(); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -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 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | return $this->classNames; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - if (! $this->paths) { |
|
| 180 | + if ( ! $this->paths) { |
|
| 181 | 181 | throw Mapping\MappingException::pathRequired(); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $includedFiles = []; |
| 186 | 186 | |
| 187 | 187 | foreach ($this->paths as $path) { |
| 188 | - if (! is_dir($path)) { |
|
| 188 | + if ( ! is_dir($path)) { |
|
| 189 | 189 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -194,14 +194,14 @@ discard block |
||
| 194 | 194 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 195 | 195 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 196 | 196 | ), |
| 197 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 197 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 198 | 198 | \RecursiveRegexIterator::GET_MATCH |
| 199 | 199 | ); |
| 200 | 200 | |
| 201 | 201 | foreach ($iterator as $file) { |
| 202 | 202 | $sourceFile = $file[0]; |
| 203 | 203 | |
| 204 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
| 204 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 205 | 205 | $sourceFile = realpath($sourceFile); |
| 206 | 206 | } |
| 207 | 207 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | ) : Mapping\ClassMetadata { |
| 250 | 250 | $reflectionClass = $metadata->getReflectionClass(); |
| 251 | 251 | |
| 252 | - if (! $reflectionClass) { |
|
| 252 | + if ( ! $reflectionClass) { |
|
| 253 | 253 | // this happens when running annotation driver in combination with |
| 254 | 254 | // static reflection services. This is not the nicest fix |
| 255 | 255 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $metadataBuildingContext |
| 287 | 287 | ); |
| 288 | 288 | |
| 289 | - if (! $property) { |
|
| 289 | + if ( ! $property) { |
|
| 290 | 290 | continue; |
| 291 | 291 | } |
| 292 | 292 | |
@@ -587,11 +587,11 @@ discard block |
||
| 587 | 587 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 588 | 588 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 589 | 589 | |
| 590 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 590 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 591 | 591 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 594 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 595 | 595 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 596 | 596 | } |
| 597 | 597 | |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 650 | 650 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 651 | 651 | |
| 652 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 652 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 653 | 653 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 654 | 654 | } |
| 655 | 655 | |
@@ -708,11 +708,11 @@ discard block |
||
| 708 | 708 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 709 | 709 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 710 | 710 | |
| 711 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 711 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 712 | 712 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 715 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 716 | 716 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 717 | 717 | } |
| 718 | 718 | |
@@ -755,15 +755,15 @@ discard block |
||
| 755 | 755 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 756 | 756 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 757 | 757 | |
| 758 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 758 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 759 | 759 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 760 | 760 | } |
| 761 | 761 | |
| 762 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 762 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 763 | 763 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 764 | 764 | } |
| 765 | 765 | |
| 766 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 766 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 767 | 767 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 768 | 768 | } |
| 769 | 769 | |
@@ -807,15 +807,15 @@ discard block |
||
| 807 | 807 | |
| 808 | 808 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 809 | 809 | |
| 810 | - if (! empty($columnAnnot->name)) { |
|
| 810 | + if ( ! empty($columnAnnot->name)) { |
|
| 811 | 811 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 814 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 815 | 815 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | - if (! empty($columnAnnot->length)) { |
|
| 818 | + if ( ! empty($columnAnnot->length)) { |
|
| 819 | 819 | $fieldMetadata->setLength($columnAnnot->length); |
| 820 | 820 | } |
| 821 | 821 | |
@@ -838,11 +838,11 @@ discard block |
||
| 838 | 838 | Annotation\Table $tableAnnot, |
| 839 | 839 | Mapping\TableMetadata $table |
| 840 | 840 | ) : void { |
| 841 | - if (! empty($tableAnnot->name)) { |
|
| 841 | + if ( ! empty($tableAnnot->name)) { |
|
| 842 | 842 | $table->setName($tableAnnot->name); |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | - if (! empty($tableAnnot->schema)) { |
|
| 845 | + if ( ! empty($tableAnnot->schema)) { |
|
| 846 | 846 | $table->setSchema($tableAnnot->schema); |
| 847 | 847 | } |
| 848 | 848 | |
@@ -880,11 +880,11 @@ discard block |
||
| 880 | 880 | ) : Mapping\JoinTableMetadata { |
| 881 | 881 | $joinTable = new Mapping\JoinTableMetadata(); |
| 882 | 882 | |
| 883 | - if (! empty($joinTableAnnot->name)) { |
|
| 883 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 884 | 884 | $joinTable->setName($joinTableAnnot->name); |
| 885 | 885 | } |
| 886 | 886 | |
| 887 | - if (! empty($joinTableAnnot->schema)) { |
|
| 887 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 888 | 888 | $joinTable->setSchema($joinTableAnnot->schema); |
| 889 | 889 | } |
| 890 | 890 | |
@@ -912,22 +912,22 @@ discard block |
||
| 912 | 912 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 913 | 913 | |
| 914 | 914 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 915 | - if (! empty($joinColumnAnnot->name)) { |
|
| 915 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 916 | 916 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 919 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 920 | 920 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 921 | 921 | } |
| 922 | 922 | |
| 923 | 923 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 924 | 924 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 925 | 925 | |
| 926 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 926 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 927 | 927 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 928 | 928 | } |
| 929 | 929 | |
| 930 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 930 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 931 | 931 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 932 | 932 | } |
| 933 | 933 | |
@@ -949,7 +949,7 @@ discard block |
||
| 949 | 949 | $fieldName = null |
| 950 | 950 | ) : Mapping\CacheMetadata { |
| 951 | 951 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 952 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 952 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 953 | 953 | |
| 954 | 954 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 955 | 955 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1057,11 +1057,11 @@ discard block |
||
| 1057 | 1057 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1058 | 1058 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1059 | 1059 | |
| 1060 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1060 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1061 | 1061 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1064 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1065 | 1065 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1066 | 1066 | } |
| 1067 | 1067 | } |
@@ -1092,12 +1092,12 @@ discard block |
||
| 1092 | 1092 | if (isset($classAnnotations[Annotation\NamedQueries::class])) { |
| 1093 | 1093 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
| 1094 | 1094 | |
| 1095 | - if (! is_array($namedQueriesAnnot->value)) { |
|
| 1095 | + if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 1096 | 1096 | throw new \UnexpectedValueException('@NamedQueries should contain an array of @NamedQuery annotations.'); |
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
| 1100 | - if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1100 | + if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 1101 | 1101 | throw new \UnexpectedValueException('@NamedQueries should contain an array of @NamedQuery annotations.'); |
| 1102 | 1102 | } |
| 1103 | 1103 | |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1179 | 1179 | |
| 1180 | 1180 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1181 | - if (! class_exists($listenerClassName)) { |
|
| 1181 | + if ( ! class_exists($listenerClassName)) { |
|
| 1182 | 1182 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1183 | 1183 | $listenerClassName, |
| 1184 | 1184 | $metadata->getClassName() |
@@ -1216,7 +1216,7 @@ discard block |
||
| 1216 | 1216 | $fieldName = $associationOverride->name; |
| 1217 | 1217 | $property = $metadata->getProperty($fieldName); |
| 1218 | 1218 | |
| 1219 | - if (! $property) { |
|
| 1219 | + if ( ! $property) { |
|
| 1220 | 1220 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1221 | 1221 | } |
| 1222 | 1222 | |
@@ -1250,7 +1250,7 @@ discard block |
||
| 1250 | 1250 | // Check for fetch |
| 1251 | 1251 | if ($associationOverride->fetch) { |
| 1252 | 1252 | $override->setFetchMode( |
| 1253 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1253 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1254 | 1254 | ); |
| 1255 | 1255 | } |
| 1256 | 1256 | |
@@ -1339,7 +1339,7 @@ discard block |
||
| 1339 | 1339 | { |
| 1340 | 1340 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1341 | 1341 | |
| 1342 | - if (! defined($fetchModeConstant)) { |
|
| 1342 | + if ( ! defined($fetchModeConstant)) { |
|
| 1343 | 1343 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1344 | 1344 | } |
| 1345 | 1345 | |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1386 | 1386 | |
| 1387 | 1387 | foreach ($classAnnotations as $key => $annot) { |
| 1388 | - if (! is_numeric($key)) { |
|
| 1388 | + if ( ! is_numeric($key)) { |
|
| 1389 | 1389 | continue; |
| 1390 | 1390 | } |
| 1391 | 1391 | |
@@ -1403,7 +1403,7 @@ discard block |
||
| 1403 | 1403 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1404 | 1404 | |
| 1405 | 1405 | foreach ($propertyAnnotations as $key => $annot) { |
| 1406 | - if (! is_numeric($key)) { |
|
| 1406 | + if ( ! is_numeric($key)) { |
|
| 1407 | 1407 | continue; |
| 1408 | 1408 | } |
| 1409 | 1409 | |
@@ -1421,7 +1421,7 @@ discard block |
||
| 1421 | 1421 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1422 | 1422 | |
| 1423 | 1423 | foreach ($methodAnnotations as $key => $annot) { |
| 1424 | - if (! is_numeric($key)) { |
|
| 1424 | + if ( ! is_numeric($key)) { |
|
| 1425 | 1425 | continue; |
| 1426 | 1426 | } |
| 1427 | 1427 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Mapping\Driver; |
| 6 | 6 | |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | ) { |
| 146 | 146 | $this->reverseEngineerMappingFromDatabase(); |
| 147 | 147 | |
| 148 | - if (! isset($this->classToTableNames[$className])) { |
|
| 149 | - throw new \InvalidArgumentException('Unknown class ' . $className); |
|
| 148 | + if ( ! isset($this->classToTableNames[$className])) { |
|
| 149 | + throw new \InvalidArgumentException('Unknown class '.$className); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // @todo guilhermeblanco This should somehow disappear... =) |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | foreach ($this->manyToManyTables as $manyTable) { |
| 162 | 162 | foreach ($manyTable->getForeignKeys() as $foreignKey) { |
| 163 | 163 | // foreign key maps to the table of the current entity, many to many association probably exists |
| 164 | - if (! ($loweredTableName === strtolower($foreignKey->getForeignTableName()))) { |
|
| 164 | + if ( ! ($loweredTableName === strtolower($foreignKey->getForeignTableName()))) { |
|
| 165 | 165 | continue; |
| 166 | 166 | } |
| 167 | 167 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if (! $otherFk) { |
|
| 179 | + if ( ! $otherFk) { |
|
| 180 | 180 | // the definition of this many to many table does not contain |
| 181 | 181 | // enough foreign key information to continue reverse engineering. |
| 182 | 182 | continue; |
@@ -257,9 +257,9 @@ discard block |
||
| 257 | 257 | $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | - if (! $table->hasPrimaryKey()) { |
|
| 260 | + if ( ! $table->hasPrimaryKey()) { |
|
| 261 | 261 | throw new Mapping\MappingException( |
| 262 | - 'Table ' . $table->getName() . ' has no primary key. Doctrine does not ' . |
|
| 262 | + 'Table '.$table->getName().' has no primary key. Doctrine does not '. |
|
| 263 | 263 | "support reverse engineering from tables that don't have a primary key." |
| 264 | 264 | ); |
| 265 | 265 | } |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | // Here we need to check if $fkColumns are the same as $primaryKeys |
| 452 | - if (! array_diff($fkColumns, $primaryKeys)) { |
|
| 452 | + if ( ! array_diff($fkColumns, $primaryKeys)) { |
|
| 453 | 453 | $metadata->addProperty($associationMapping); |
| 454 | 454 | } else { |
| 455 | 455 | $metadata->addProperty($associationMapping); |
@@ -495,10 +495,10 @@ discard block |
||
| 495 | 495 | private function getClassNameForTable($tableName) |
| 496 | 496 | { |
| 497 | 497 | if (isset($this->classNamesForTables[$tableName])) { |
| 498 | - return $this->namespace . $this->classNamesForTables[$tableName]; |
|
| 498 | + return $this->namespace.$this->classNamesForTables[$tableName]; |
|
| 499 | 499 | } |
| 500 | 500 | |
| 501 | - return $this->namespace . Inflector::classify(strtolower($tableName)); |
|
| 501 | + return $this->namespace.Inflector::classify(strtolower($tableName)); |
|
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | /** |
@@ -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 | |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $result = $this->loadMappingFile($this->locator->findMappingFile($className)); |
| 112 | - if (! isset($result[$className])) { |
|
| 113 | - throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension()); |
|
| 112 | + if ( ! isset($result[$className])) { |
|
| 113 | + throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className).$this->locator->getFileExtension()); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $this->classCache[$className] = $result[$className]; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $this->initialize(); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - if (! $this->classCache) { |
|
| 146 | + if ( ! $this->classCache) { |
|
| 147 | 147 | return (array) $this->locator->getAllClassNames($this->globalBasename); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $this->classCache = []; |
| 178 | 178 | if ($this->globalBasename !== null) { |
| 179 | 179 | foreach ($this->locator->getPaths() as $path) { |
| 180 | - $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension(); |
|
| 180 | + $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); |
|
| 181 | 181 | if (is_file($file)) { |
| 182 | 182 | $this->classCache = array_merge( |
| 183 | 183 | $this->classCache, |