@@ -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 | |
@@ -495,11 +495,11 @@ discard block |
||
495 | 495 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
496 | 496 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
497 | 497 | |
498 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
498 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
499 | 499 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
500 | 500 | } |
501 | 501 | |
502 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
502 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
503 | 503 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
504 | 504 | } |
505 | 505 | |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
558 | 558 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
559 | 559 | |
560 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
560 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
561 | 561 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
562 | 562 | } |
563 | 563 | |
@@ -616,11 +616,11 @@ discard block |
||
616 | 616 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
617 | 617 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
618 | 618 | |
619 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
619 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
620 | 620 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
621 | 621 | } |
622 | 622 | |
623 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
623 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
624 | 624 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
625 | 625 | } |
626 | 626 | |
@@ -663,15 +663,15 @@ discard block |
||
663 | 663 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
664 | 664 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
665 | 665 | |
666 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
666 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
667 | 667 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
668 | 668 | } |
669 | 669 | |
670 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
670 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
671 | 671 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
672 | 672 | } |
673 | 673 | |
674 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
674 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
675 | 675 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
676 | 676 | } |
677 | 677 | |
@@ -715,15 +715,15 @@ discard block |
||
715 | 715 | |
716 | 716 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
717 | 717 | |
718 | - if (! empty($columnAnnot->name)) { |
|
718 | + if ( ! empty($columnAnnot->name)) { |
|
719 | 719 | $fieldMetadata->setColumnName($columnAnnot->name); |
720 | 720 | } |
721 | 721 | |
722 | - if (! empty($columnAnnot->columnDefinition)) { |
|
722 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
723 | 723 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
724 | 724 | } |
725 | 725 | |
726 | - if (! empty($columnAnnot->length)) { |
|
726 | + if ( ! empty($columnAnnot->length)) { |
|
727 | 727 | $fieldMetadata->setLength($columnAnnot->length); |
728 | 728 | } |
729 | 729 | |
@@ -746,11 +746,11 @@ discard block |
||
746 | 746 | Annotation\Table $tableAnnot, |
747 | 747 | Mapping\TableMetadata $table |
748 | 748 | ) : Mapping\TableMetadata { |
749 | - if (! empty($tableAnnot->name)) { |
|
749 | + if ( ! empty($tableAnnot->name)) { |
|
750 | 750 | $table->setName($tableAnnot->name); |
751 | 751 | } |
752 | 752 | |
753 | - if (! empty($tableAnnot->schema)) { |
|
753 | + if ( ! empty($tableAnnot->schema)) { |
|
754 | 754 | $table->setSchema($tableAnnot->schema); |
755 | 755 | } |
756 | 756 | |
@@ -788,11 +788,11 @@ discard block |
||
788 | 788 | ) : Mapping\JoinTableMetadata { |
789 | 789 | $joinTable = new Mapping\JoinTableMetadata(); |
790 | 790 | |
791 | - if (! empty($joinTableAnnot->name)) { |
|
791 | + if ( ! empty($joinTableAnnot->name)) { |
|
792 | 792 | $joinTable->setName($joinTableAnnot->name); |
793 | 793 | } |
794 | 794 | |
795 | - if (! empty($joinTableAnnot->schema)) { |
|
795 | + if ( ! empty($joinTableAnnot->schema)) { |
|
796 | 796 | $joinTable->setSchema($joinTableAnnot->schema); |
797 | 797 | } |
798 | 798 | |
@@ -820,22 +820,22 @@ discard block |
||
820 | 820 | $joinColumn = new Mapping\JoinColumnMetadata(); |
821 | 821 | |
822 | 822 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
823 | - if (! empty($joinColumnAnnot->name)) { |
|
823 | + if ( ! empty($joinColumnAnnot->name)) { |
|
824 | 824 | $joinColumn->setColumnName($joinColumnAnnot->name); |
825 | 825 | } |
826 | 826 | |
827 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
827 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
828 | 828 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
829 | 829 | } |
830 | 830 | |
831 | 831 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
832 | 832 | $joinColumn->setUnique($joinColumnAnnot->unique); |
833 | 833 | |
834 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
834 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
835 | 835 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
836 | 836 | } |
837 | 837 | |
838 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
838 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
839 | 839 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
840 | 840 | } |
841 | 841 | |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | $fieldName = null |
858 | 858 | ) : Mapping\CacheMetadata { |
859 | 859 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
860 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
860 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
861 | 861 | |
862 | 862 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
863 | 863 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | $fieldName = $associationOverride->name; |
917 | 917 | $property = $metadata->getProperty($fieldName); |
918 | 918 | |
919 | - if (! $property) { |
|
919 | + if ( ! $property) { |
|
920 | 920 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
921 | 921 | } |
922 | 922 | |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | // Check for fetch |
951 | 951 | if ($associationOverride->fetch) { |
952 | 952 | $override->setFetchMode( |
953 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
953 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
954 | 954 | ); |
955 | 955 | } |
956 | 956 | |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | { |
1040 | 1040 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
1041 | 1041 | |
1042 | - if (! defined($fetchModeConstant)) { |
|
1042 | + if ( ! defined($fetchModeConstant)) { |
|
1043 | 1043 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
1044 | 1044 | } |
1045 | 1045 | |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
1086 | 1086 | |
1087 | 1087 | foreach ($classAnnotations as $key => $annot) { |
1088 | - if (! is_numeric($key)) { |
|
1088 | + if ( ! is_numeric($key)) { |
|
1089 | 1089 | continue; |
1090 | 1090 | } |
1091 | 1091 | |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
1104 | 1104 | |
1105 | 1105 | foreach ($propertyAnnotations as $key => $annot) { |
1106 | - if (! is_numeric($key)) { |
|
1106 | + if ( ! is_numeric($key)) { |
|
1107 | 1107 | continue; |
1108 | 1108 | } |
1109 | 1109 | |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
1122 | 1122 | |
1123 | 1123 | foreach ($methodAnnotations as $key => $annot) { |
1124 | - if (! is_numeric($key)) { |
|
1124 | + if ( ! is_numeric($key)) { |
|
1125 | 1125 | continue; |
1126 | 1126 | } |
1127 | 1127 |