@@ -51,7 +51,7 @@ |
||
| 51 | 51 | /** @var CacheMetadata|null */ |
| 52 | 52 | private $cache; |
| 53 | 53 | |
| 54 | - public function __construct(string $name) |
|
| 54 | + public function __construct(string $name) |
|
| 55 | 55 | { |
| 56 | 56 | $this->name = $name; |
| 57 | 57 | } |
@@ -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 | |
@@ -585,11 +585,11 @@ discard block |
||
| 585 | 585 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 586 | 586 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 587 | 587 | |
| 588 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 588 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 589 | 589 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 592 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 593 | 593 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 594 | 594 | } |
| 595 | 595 | |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 648 | 648 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 649 | 649 | |
| 650 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 650 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 651 | 651 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 652 | 652 | } |
| 653 | 653 | |
@@ -706,11 +706,11 @@ discard block |
||
| 706 | 706 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 707 | 707 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 708 | 708 | |
| 709 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 709 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 710 | 710 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 713 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 714 | 714 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 715 | 715 | } |
| 716 | 716 | |
@@ -753,15 +753,15 @@ discard block |
||
| 753 | 753 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 754 | 754 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 755 | 755 | |
| 756 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 756 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 757 | 757 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 758 | 758 | } |
| 759 | 759 | |
| 760 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 760 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 761 | 761 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 762 | 762 | } |
| 763 | 763 | |
| 764 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 764 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 765 | 765 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 766 | 766 | } |
| 767 | 767 | |
@@ -805,15 +805,15 @@ discard block |
||
| 805 | 805 | |
| 806 | 806 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 807 | 807 | |
| 808 | - if (! empty($columnAnnot->name)) { |
|
| 808 | + if ( ! empty($columnAnnot->name)) { |
|
| 809 | 809 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 812 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 813 | 813 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 814 | 814 | } |
| 815 | 815 | |
| 816 | - if (! empty($columnAnnot->length)) { |
|
| 816 | + if ( ! empty($columnAnnot->length)) { |
|
| 817 | 817 | $fieldMetadata->setLength($columnAnnot->length); |
| 818 | 818 | } |
| 819 | 819 | |
@@ -836,11 +836,11 @@ discard block |
||
| 836 | 836 | Annotation\Table $tableAnnot, |
| 837 | 837 | Mapping\TableMetadata $table |
| 838 | 838 | ) : Mapping\TableMetadata { |
| 839 | - if (! empty($tableAnnot->name)) { |
|
| 839 | + if ( ! empty($tableAnnot->name)) { |
|
| 840 | 840 | $table->setName($tableAnnot->name); |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | - if (! empty($tableAnnot->schema)) { |
|
| 843 | + if ( ! empty($tableAnnot->schema)) { |
|
| 844 | 844 | $table->setSchema($tableAnnot->schema); |
| 845 | 845 | } |
| 846 | 846 | |
@@ -878,11 +878,11 @@ discard block |
||
| 878 | 878 | ) : Mapping\JoinTableMetadata { |
| 879 | 879 | $joinTable = new Mapping\JoinTableMetadata(); |
| 880 | 880 | |
| 881 | - if (! empty($joinTableAnnot->name)) { |
|
| 881 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 882 | 882 | $joinTable->setName($joinTableAnnot->name); |
| 883 | 883 | } |
| 884 | 884 | |
| 885 | - if (! empty($joinTableAnnot->schema)) { |
|
| 885 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 886 | 886 | $joinTable->setSchema($joinTableAnnot->schema); |
| 887 | 887 | } |
| 888 | 888 | |
@@ -910,22 +910,22 @@ discard block |
||
| 910 | 910 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 911 | 911 | |
| 912 | 912 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 913 | - if (! empty($joinColumnAnnot->name)) { |
|
| 913 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 914 | 914 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 915 | 915 | } |
| 916 | 916 | |
| 917 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 917 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 918 | 918 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 919 | 919 | } |
| 920 | 920 | |
| 921 | 921 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 922 | 922 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 923 | 923 | |
| 924 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 924 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 925 | 925 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 926 | 926 | } |
| 927 | 927 | |
| 928 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 928 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 929 | 929 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 930 | 930 | } |
| 931 | 931 | |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | $fieldName = null |
| 948 | 948 | ) : Mapping\CacheMetadata { |
| 949 | 949 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 950 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 950 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 951 | 951 | |
| 952 | 952 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 953 | 953 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1055,11 +1055,11 @@ discard block |
||
| 1055 | 1055 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1056 | 1056 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1057 | 1057 | |
| 1058 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1058 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1059 | 1059 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1062 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1063 | 1063 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1064 | 1064 | } |
| 1065 | 1065 | } |
@@ -1147,7 +1147,7 @@ discard block |
||
| 1147 | 1147 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1148 | 1148 | |
| 1149 | 1149 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1150 | - if (! class_exists($listenerClassName)) { |
|
| 1150 | + if ( ! class_exists($listenerClassName)) { |
|
| 1151 | 1151 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1152 | 1152 | $listenerClassName, |
| 1153 | 1153 | $metadata->getClassName() |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | $fieldName = $associationOverride->name; |
| 1186 | 1186 | $property = $metadata->getProperty($fieldName); |
| 1187 | 1187 | |
| 1188 | - if (! $property) { |
|
| 1188 | + if ( ! $property) { |
|
| 1189 | 1189 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1190 | 1190 | } |
| 1191 | 1191 | |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | // Check for fetch |
| 1220 | 1220 | if ($associationOverride->fetch) { |
| 1221 | 1221 | $override->setFetchMode( |
| 1222 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1222 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1223 | 1223 | ); |
| 1224 | 1224 | } |
| 1225 | 1225 | |
@@ -1308,7 +1308,7 @@ discard block |
||
| 1308 | 1308 | { |
| 1309 | 1309 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1310 | 1310 | |
| 1311 | - if (! defined($fetchModeConstant)) { |
|
| 1311 | + if ( ! defined($fetchModeConstant)) { |
|
| 1312 | 1312 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1313 | 1313 | } |
| 1314 | 1314 | |
@@ -1354,7 +1354,7 @@ discard block |
||
| 1354 | 1354 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1355 | 1355 | |
| 1356 | 1356 | foreach ($classAnnotations as $key => $annot) { |
| 1357 | - if (! is_numeric($key)) { |
|
| 1357 | + if ( ! is_numeric($key)) { |
|
| 1358 | 1358 | continue; |
| 1359 | 1359 | } |
| 1360 | 1360 | |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1373 | 1373 | |
| 1374 | 1374 | foreach ($propertyAnnotations as $key => $annot) { |
| 1375 | - if (! is_numeric($key)) { |
|
| 1375 | + if ( ! is_numeric($key)) { |
|
| 1376 | 1376 | continue; |
| 1377 | 1377 | } |
| 1378 | 1378 | |
@@ -1390,7 +1390,7 @@ discard block |
||
| 1390 | 1390 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1391 | 1391 | |
| 1392 | 1392 | foreach ($methodAnnotations as $key => $annot) { |
| 1393 | - if (! is_numeric($key)) { |
|
| 1393 | + if ( ! is_numeric($key)) { |
|
| 1394 | 1394 | continue; |
| 1395 | 1395 | } |
| 1396 | 1396 | |