@@ -1,6 +1,6 @@ |
||
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 |
@@ -1,6 +1,6 @@ |
||
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 |
@@ -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 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | return $this->classNames; |
186 | 186 | } |
187 | 187 | |
188 | - if (!$this->paths) { |
|
188 | + if ( ! $this->paths) { |
|
189 | 189 | throw Mapping\MappingException::pathRequired(); |
190 | 190 | } |
191 | 191 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
203 | 203 | \RecursiveIteratorIterator::LEAVES_ONLY |
204 | 204 | ), |
205 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
205 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
206 | 206 | \RecursiveRegexIterator::GET_MATCH |
207 | 207 | ); |
208 | 208 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | { |
251 | 251 | $reflClass = $metadata->getReflectionClass(); |
252 | 252 | |
253 | - if (! $reflClass) { |
|
253 | + if ( ! $reflClass) { |
|
254 | 254 | // this happens when running annotation driver in combination with |
255 | 255 | // static reflection services. This is not the nicest fix |
256 | 256 | $reflClass = new \ReflectionClass($metadata->getClassName()); |
@@ -392,11 +392,11 @@ discard block |
||
392 | 392 | $discriminatorColumn->setType(Type::getType($typeName)); |
393 | 393 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
394 | 394 | |
395 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
395 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
396 | 396 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
397 | 397 | } |
398 | 398 | |
399 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
399 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
400 | 400 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
401 | 401 | } |
402 | 402 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | if (isset($classAnnotations[Annotation\DiscriminatorMap::class])) { |
408 | 408 | $discriminatorMapAnnotation = $classAnnotations[Annotation\DiscriminatorMap::class]; |
409 | 409 | $discriminatorMap = array_map( |
410 | - function ($className) use ($metadata) { |
|
410 | + function($className) use ($metadata) { |
|
411 | 411 | return $metadata->fullyQualifiedClassName($className); |
412 | 412 | }, |
413 | 413 | $discriminatorMapAnnotation->value |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | foreach ($entityListenersAnnot->value as $item) { |
436 | 436 | $listenerClassName = $metadata->fullyQualifiedClassName($item); |
437 | 437 | |
438 | - if (! class_exists($listenerClassName)) { |
|
438 | + if ( ! class_exists($listenerClassName)) { |
|
439 | 439 | throw Mapping\MappingException::entityListenerClassNotFound( |
440 | 440 | $listenerClassName, |
441 | 441 | $reflClass->getName() |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflProperty); |
474 | 474 | |
475 | 475 | foreach ($propertyAnnotations as $key => $annot) { |
476 | - if (!is_numeric($key)) { |
|
476 | + if ( ! is_numeric($key)) { |
|
477 | 477 | continue; |
478 | 478 | } |
479 | 479 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | $fieldName = $associationOverride->name; |
560 | 560 | $property = $metadata->getProperty($fieldName); |
561 | 561 | |
562 | - if (! $property) { |
|
562 | + if ( ! $property) { |
|
563 | 563 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
564 | 564 | } |
565 | 565 | |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | // Check for fetch |
594 | 594 | if ($associationOverride->fetch) { |
595 | 595 | $override->setFetchMode( |
596 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
596 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
597 | 597 | ); |
598 | 598 | } |
599 | 599 | |
@@ -793,11 +793,11 @@ discard block |
||
793 | 793 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
794 | 794 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
795 | 795 | |
796 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
796 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
797 | 797 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
798 | 798 | } |
799 | 799 | |
800 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
800 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
801 | 801 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
802 | 802 | } |
803 | 803 | |
@@ -850,13 +850,13 @@ discard block |
||
850 | 850 | $fieldName = $reflProperty->getName(); |
851 | 851 | $manyToOneAnnot = $propertyAnnotations[Annotation\ManyToOne::class]; |
852 | 852 | $assocMetadata = new Mapping\ManyToOneAssociationMetadata($fieldName); |
853 | - $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity); |
|
853 | + $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity); |
|
854 | 854 | |
855 | 855 | $assocMetadata->setTargetEntity($targetEntity); |
856 | 856 | $assocMetadata->setCascade($manyToOneAnnot->cascade); |
857 | 857 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
858 | 858 | |
859 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
859 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
860 | 860 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
861 | 861 | } |
862 | 862 | |
@@ -909,18 +909,18 @@ discard block |
||
909 | 909 | $fieldName = $reflProperty->getName(); |
910 | 910 | $oneToManyAnnot = $propertyAnnotations[Annotation\OneToMany::class]; |
911 | 911 | $assocMetadata = new Mapping\OneToManyAssociationMetadata($fieldName); |
912 | - $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity); |
|
912 | + $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity); |
|
913 | 913 | |
914 | 914 | $assocMetadata->setTargetEntity($targetEntity); |
915 | 915 | $assocMetadata->setCascade($oneToManyAnnot->cascade); |
916 | 916 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
917 | 917 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
918 | 918 | |
919 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
919 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
920 | 920 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
921 | 921 | } |
922 | 922 | |
923 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
923 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
924 | 924 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
925 | 925 | } |
926 | 926 | |
@@ -964,15 +964,15 @@ discard block |
||
964 | 964 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
965 | 965 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
966 | 966 | |
967 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
967 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
968 | 968 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
969 | 969 | } |
970 | 970 | |
971 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
971 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
972 | 972 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
973 | 973 | } |
974 | 974 | |
975 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
975 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
976 | 976 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
977 | 977 | } |
978 | 978 | |
@@ -1025,15 +1025,15 @@ discard block |
||
1025 | 1025 | |
1026 | 1026 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
1027 | 1027 | |
1028 | - if (! empty($columnAnnot->name)) { |
|
1028 | + if ( ! empty($columnAnnot->name)) { |
|
1029 | 1029 | $fieldMetadata->setColumnName($columnAnnot->name); |
1030 | 1030 | } |
1031 | 1031 | |
1032 | - if (! empty($columnAnnot->columnDefinition)) { |
|
1032 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
1033 | 1033 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
1034 | 1034 | } |
1035 | 1035 | |
1036 | - if (! empty($columnAnnot->length)) { |
|
1036 | + if ( ! empty($columnAnnot->length)) { |
|
1037 | 1037 | $fieldMetadata->setLength($columnAnnot->length); |
1038 | 1038 | } |
1039 | 1039 | |
@@ -1060,11 +1060,11 @@ discard block |
||
1060 | 1060 | { |
1061 | 1061 | $table = new Mapping\TableMetadata(); |
1062 | 1062 | |
1063 | - if (! empty($tableAnnot->name)) { |
|
1063 | + if ( ! empty($tableAnnot->name)) { |
|
1064 | 1064 | $table->setName($tableAnnot->name); |
1065 | 1065 | } |
1066 | 1066 | |
1067 | - if (! empty($tableAnnot->schema)) { |
|
1067 | + if ( ! empty($tableAnnot->schema)) { |
|
1068 | 1068 | $table->setSchema($tableAnnot->schema); |
1069 | 1069 | } |
1070 | 1070 | |
@@ -1105,11 +1105,11 @@ discard block |
||
1105 | 1105 | { |
1106 | 1106 | $joinTable = new Mapping\JoinTableMetadata(); |
1107 | 1107 | |
1108 | - if (! empty($joinTableAnnot->name)) { |
|
1108 | + if ( ! empty($joinTableAnnot->name)) { |
|
1109 | 1109 | $joinTable->setName($joinTableAnnot->name); |
1110 | 1110 | } |
1111 | 1111 | |
1112 | - if (! empty($joinTableAnnot->schema)) { |
|
1112 | + if ( ! empty($joinTableAnnot->schema)) { |
|
1113 | 1113 | $joinTable->setSchema($joinTableAnnot->schema); |
1114 | 1114 | } |
1115 | 1115 | |
@@ -1140,22 +1140,22 @@ discard block |
||
1140 | 1140 | $joinColumn = new Mapping\JoinColumnMetadata(); |
1141 | 1141 | |
1142 | 1142 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
1143 | - if (! empty($joinColumnAnnot->name)) { |
|
1143 | + if ( ! empty($joinColumnAnnot->name)) { |
|
1144 | 1144 | $joinColumn->setColumnName($joinColumnAnnot->name); |
1145 | 1145 | } |
1146 | 1146 | |
1147 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
1147 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
1148 | 1148 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
1149 | 1149 | } |
1150 | 1150 | |
1151 | 1151 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
1152 | 1152 | $joinColumn->setUnique($joinColumnAnnot->unique); |
1153 | 1153 | |
1154 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
1154 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
1155 | 1155 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
1156 | 1156 | } |
1157 | 1157 | |
1158 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
1158 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
1159 | 1159 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
1160 | 1160 | } |
1161 | 1161 | |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | ) |
1183 | 1183 | { |
1184 | 1184 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
1185 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
1185 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
1186 | 1186 | |
1187 | 1187 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
1188 | 1188 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1200,7 +1200,7 @@ discard block |
||
1200 | 1200 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
1201 | 1201 | |
1202 | 1202 | foreach ($methodAnnotations as $key => $annot) { |
1203 | - if (! is_numeric($key)) { |
|
1203 | + if ( ! is_numeric($key)) { |
|
1204 | 1204 | continue; |
1205 | 1205 | } |
1206 | 1206 |
@@ -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 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $this->reverseEngineerMappingFromDatabase(); |
165 | 165 | |
166 | 166 | if ( ! isset($this->classToTableNames[$className])) { |
167 | - throw new \InvalidArgumentException("Unknown class " . $className); |
|
167 | + throw new \InvalidArgumentException("Unknown class ".$className); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | // @todo guilhermeblanco This should somehow disappear... =) |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | |
280 | 280 | if ( ! $table->hasPrimaryKey()) { |
281 | 281 | throw new MappingException( |
282 | - "Table " . $table->getName() . " has no primary key. Doctrine does not ". |
|
282 | + "Table ".$table->getName()." has no primary key. Doctrine does not ". |
|
283 | 283 | "support reverse engineering from tables that don't have a primary key." |
284 | 284 | ); |
285 | 285 | } |
@@ -524,10 +524,10 @@ discard block |
||
524 | 524 | private function getClassNameForTable($tableName) |
525 | 525 | { |
526 | 526 | if (isset($this->classNamesForTables[$tableName])) { |
527 | - return $this->namespace . $this->classNamesForTables[$tableName]; |
|
527 | + return $this->namespace.$this->classNamesForTables[$tableName]; |
|
528 | 528 | } |
529 | 529 | |
530 | - return $this->namespace . Inflector::classify(strtolower($tableName)); |
|
530 | + return $this->namespace.Inflector::classify(strtolower($tableName)); |
|
531 | 531 | } |
532 | 532 | |
533 | 533 | /** |
@@ -1,6 +1,6 @@ |
||
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 |
@@ -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 | |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | |
460 | 460 | if (isset($manyToOneElement['fetch'])) { |
461 | 461 | $association->setFetchMode( |
462 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
462 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
463 | 463 | ); |
464 | 464 | } |
465 | 465 | |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | $fieldName = (string) $overrideElement['name']; |
608 | 608 | $property = $metadata->getProperty($fieldName); |
609 | 609 | |
610 | - if (! $property) { |
|
610 | + if ( ! $property) { |
|
611 | 611 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
612 | 612 | } |
613 | 613 | |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | // Check for fetch |
666 | 666 | if (isset($overrideElement['fetch'])) { |
667 | 667 | $override->setFetchMode( |
668 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
668 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
669 | 669 | ); |
670 | 670 | } |
671 | 671 | |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | // Evaluate <lifecycle-callbacks...> |
677 | 677 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
678 | 678 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
679 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
679 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
680 | 680 | $methodName = (string) $lifecycleCallback['method']; |
681 | 681 | |
682 | 682 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
689 | 689 | $listenerClassName = $metadata->fullyQualifiedClassName((string) $listenerElement['class']); |
690 | 690 | |
691 | - if (! class_exists($listenerClassName)) { |
|
691 | + if ( ! class_exists($listenerClassName)) { |
|
692 | 692 | throw Mapping\MappingException::entityListenerClassNotFound( |
693 | 693 | $listenerClassName, |
694 | 694 | $metadata->getClassName() |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | ) |
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 = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : $defaultRegion; |
869 | 869 | $usage = isset($cacheMapping['usage']) |
@@ -894,7 +894,7 @@ discard block |
||
894 | 894 | Events::preFlush, |
895 | 895 | ]; |
896 | 896 | |
897 | - return array_filter($events, function ($eventName) use ($method) { |
|
897 | + return array_filter($events, function($eventName) use ($method) { |
|
898 | 898 | return $eventName === $method->getName(); |
899 | 899 | }); |
900 | 900 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Mapping; |
7 | 7 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Mapping; |
6 | 6 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Mapping; |
7 | 7 |