@@ -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 | ) : Mapping\TableMetadata { |
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 |