@@ -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; |
6 | 6 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * @return null|string |
54 | 54 | */ |
55 | - public function getIndexedBy() : ?string |
|
55 | + public function getIndexedBy() : ? string |
|
56 | 56 | { |
57 | 57 | return $this->indexedBy; |
58 | 58 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // If $value is not a Collection then use an ArrayCollection. |
78 | - if (! $collection instanceof Collection) { |
|
78 | + if ( ! $collection instanceof Collection) { |
|
79 | 79 | // @todo guilhermeblanco Conceptually, support to custom collections by replacing ArrayCollection creation. |
80 | 80 | $collection = new ArrayCollection((array) $collection); |
81 | 81 | } |
@@ -1,7 +1,7 @@ discard block |
||
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\Exporter; |
7 | 7 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $lines[] = null; |
27 | 27 | |
28 | 28 | if ($namespace) { |
29 | - $lines[] = 'namespace ' . $namespace . ';'; |
|
29 | + $lines[] = 'namespace '.$namespace.';'; |
|
30 | 30 | $lines[] = null; |
31 | 31 | } |
32 | 32 | |
@@ -74,31 +74,31 @@ discard block |
||
74 | 74 | { |
75 | 75 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
76 | 76 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
77 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
77 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
78 | 78 | $lines = []; |
79 | 79 | |
80 | - $lines[] = $indentation . 'public function __construct('; |
|
81 | - $lines[] = $bodyIndentation . 'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
82 | - $lines[] = $bodyIndentation . '?ClassMetadata $parent = null'; |
|
83 | - $lines[] = $indentation . ')'; |
|
84 | - $lines[] = $indentation . '{'; |
|
85 | - $lines[] = $bodyIndentation . 'parent::__construct("' . $metadata->getClassName() . '", $parent);'; |
|
80 | + $lines[] = $indentation.'public function __construct('; |
|
81 | + $lines[] = $bodyIndentation.'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
82 | + $lines[] = $bodyIndentation.'?ClassMetadata $parent = null'; |
|
83 | + $lines[] = $indentation.')'; |
|
84 | + $lines[] = $indentation.'{'; |
|
85 | + $lines[] = $bodyIndentation.'parent::__construct("'.$metadata->getClassName().'", $parent);'; |
|
86 | 86 | |
87 | 87 | if ($metadata->getCustomRepositoryClassName()) { |
88 | 88 | $lines[] = null; |
89 | - $lines[] = $objectReference . '->setCustomRepositoryClassName("' . $metadata->getCustomRepositoryClassName() . '");'; |
|
89 | + $lines[] = $objectReference.'->setCustomRepositoryClassName("'.$metadata->getCustomRepositoryClassName().'");'; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if ($metadata->changeTrackingPolicy) { |
93 | 93 | $lines[] = null; |
94 | - $lines[] = $objectReference . '->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . strtoupper($metadata->changeTrackingPolicy) . ');'; |
|
94 | + $lines[] = $objectReference.'->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.strtoupper($metadata->changeTrackingPolicy).');'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | $lines[] = $this->exportInheritance($metadata, $indentationLevel); |
98 | 98 | $lines[] = $this->exportTable($metadata, $indentationLevel); |
99 | 99 | $lines[] = $this->exportProperties($metadata, $indentationLevel); |
100 | 100 | $lines[] = $this->exportLifecycleCallbacks($metadata, $indentationLevel); |
101 | - $lines[] = $indentation . '}'; |
|
101 | + $lines[] = $indentation.'}'; |
|
102 | 102 | |
103 | 103 | return implode(PHP_EOL, $lines); |
104 | 104 | } |
@@ -112,17 +112,17 @@ discard block |
||
112 | 112 | private function exportInheritance(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
113 | 113 | { |
114 | 114 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
115 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
115 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
116 | 116 | $lines = []; |
117 | 117 | |
118 | 118 | if ($metadata->inheritanceType) { |
119 | 119 | $lines[] = null; |
120 | - $lines[] = $objectReference . '->setInheritanceType(Mapping\InheritanceType::' . strtoupper($metadata->inheritanceType) . ');'; |
|
120 | + $lines[] = $objectReference.'->setInheritanceType(Mapping\InheritanceType::'.strtoupper($metadata->inheritanceType).');'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | if ($metadata->discriminatorColumn) { |
124 | 124 | $lines[] = null; |
125 | - $lines[] = $bodyIndentation . '// Discriminator mapping'; |
|
125 | + $lines[] = $bodyIndentation.'// Discriminator mapping'; |
|
126 | 126 | $lines[] = $this->exportDiscriminatorMetadata($metadata, $indentationLevel + 1); |
127 | 127 | } |
128 | 128 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | if ($metadata->table) { |
144 | 144 | $lines[] = null; |
145 | - $lines[] = $bodyIndentation . '// Table'; |
|
145 | + $lines[] = $bodyIndentation.'// Table'; |
|
146 | 146 | $lines[] = $this->exportTableMetadata($metadata->table, $indentationLevel + 1); |
147 | 147 | } |
148 | 148 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
164 | 164 | $lines[] = null; |
165 | - $lines[] = $bodyIndentation . '// Property: ' . $name; |
|
165 | + $lines[] = $bodyIndentation.'// Property: '.$name; |
|
166 | 166 | $lines[] = $this->exportProperty($property, $indentationLevel + 1); |
167 | 167 | } |
168 | 168 | |
@@ -178,16 +178,16 @@ discard block |
||
178 | 178 | private function exportLifecycleCallbacks(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
179 | 179 | { |
180 | 180 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
181 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
181 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
182 | 182 | $lines = []; |
183 | 183 | |
184 | 184 | if ($metadata->lifecycleCallbacks) { |
185 | 185 | $lines[] = null; |
186 | - $lines[] = $bodyIndentation . '// Lifecycle callbacks'; |
|
186 | + $lines[] = $bodyIndentation.'// Lifecycle callbacks'; |
|
187 | 187 | |
188 | 188 | foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { |
189 | 189 | foreach ($callbacks as $callback) { |
190 | - $lines[] = $objectReference . '->addLifecycleCallback("' . $callback . '", "' . $event . '");'; |
|
190 | + $lines[] = $objectReference.'->addLifecycleCallback("'.$callback.'", "'.$event.'");'; |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 | } |
@@ -206,17 +206,17 @@ discard block |
||
206 | 206 | $variableExporter = new VariableExporter(); |
207 | 207 | $discriminatorExporter = new DiscriminatorColumnMetadataExporter(); |
208 | 208 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
209 | - $objectReference = $indentation . static::VARIABLE; |
|
209 | + $objectReference = $indentation.static::VARIABLE; |
|
210 | 210 | $lines = []; |
211 | 211 | |
212 | 212 | $lines[] = $discriminatorExporter->export($metadata->discriminatorColumn, $indentationLevel); |
213 | 213 | $lines[] = null; |
214 | - $lines[] = $objectReference . '->setDiscriminatorColumn(' . $discriminatorExporter::VARIABLE . ');'; |
|
214 | + $lines[] = $objectReference.'->setDiscriminatorColumn('.$discriminatorExporter::VARIABLE.');'; |
|
215 | 215 | |
216 | 216 | if ($metadata->discriminatorMap) { |
217 | 217 | $discriminatorMap = $variableExporter->export($metadata->discriminatorMap, $indentationLevel + 1); |
218 | 218 | |
219 | - $lines[] = $objectReference . '->setDiscriminatorMap(' . $discriminatorMap . ');'; |
|
219 | + $lines[] = $objectReference.'->setDiscriminatorMap('.$discriminatorMap.');'; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | return implode(PHP_EOL, $lines); |
@@ -232,12 +232,12 @@ discard block |
||
232 | 232 | { |
233 | 233 | $tableExporter = new TableMetadataExporter(); |
234 | 234 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
235 | - $objectReference = $indentation . static::VARIABLE; |
|
235 | + $objectReference = $indentation.static::VARIABLE; |
|
236 | 236 | $lines = []; |
237 | 237 | |
238 | 238 | $lines[] = $tableExporter->export($table, $indentationLevel); |
239 | 239 | $lines[] = null; |
240 | - $lines[] = $objectReference . '->setTable(' . $tableExporter::VARIABLE . ');'; |
|
240 | + $lines[] = $objectReference.'->setTable('.$tableExporter::VARIABLE.');'; |
|
241 | 241 | |
242 | 242 | return implode(PHP_EOL, $lines); |
243 | 243 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | private function exportProperty(Mapping\Property $property, int $indentationLevel) : string |
252 | 252 | { |
253 | 253 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
254 | - $objectReference = $indentation . static::VARIABLE; |
|
254 | + $objectReference = $indentation.static::VARIABLE; |
|
255 | 255 | $lines = []; |
256 | 256 | |
257 | 257 | switch (true) { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | $lines[] = $propertyExporter->export($property, $indentationLevel); |
288 | 288 | $lines[] = null; |
289 | - $lines[] = $objectReference . '->addProperty(' . $propertyExporter::VARIABLE . ');'; |
|
289 | + $lines[] = $objectReference.'->addProperty('.$propertyExporter::VARIABLE.');'; |
|
290 | 290 | |
291 | 291 | return implode(PHP_EOL, $lines); |
292 | 292 | } |
@@ -1,7 +1,7 @@ discard block |
||
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 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | /** |
75 | 75 | * @return string|null |
76 | 76 | */ |
77 | - public function getTableName() : ?string |
|
77 | + public function getTableName() : ? string |
|
78 | 78 | { |
79 | 79 | return $this->tableName; |
80 | 80 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | /** |
93 | 93 | * @return string|null |
94 | 94 | */ |
95 | - public function getColumnName() : ?string |
|
95 | + public function getColumnName() : ? string |
|
96 | 96 | { |
97 | 97 | return $this->columnName; |
98 | 98 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | /** |
109 | 109 | * @return Type|null |
110 | 110 | */ |
111 | - public function getType() : ?Type |
|
111 | + public function getType() : ? Type |
|
112 | 112 | { |
113 | 113 | return $this->type; |
114 | 114 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * @return string|null |
134 | 134 | */ |
135 | - public function getColumnDefinition() : ?string |
|
135 | + public function getColumnDefinition() : ? string |
|
136 | 136 | { |
137 | 137 | return $this->columnDefinition; |
138 | 138 | } |
@@ -1,7 +1,7 @@ discard block |
||
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 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * @return null|string |
30 | 30 | */ |
31 | - public function getCustomRepositoryClassName() : ?string |
|
31 | + public function getCustomRepositoryClassName() : ? string |
|
32 | 32 | { |
33 | 33 | return $this->customRepositoryClassName; |
34 | 34 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * @param null|string customRepositoryClassName |
38 | 38 | */ |
39 | - public function setCustomRepositoryClassName(?string $customRepositoryClassName) : void |
|
39 | + public function setCustomRepositoryClassName(? string $customRepositoryClassName) : void |
|
40 | 40 | { |
41 | 41 | $this->customRepositoryClassName = $customRepositoryClassName; |
42 | 42 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * @return Property|null |
46 | 46 | */ |
47 | - public function getDeclaredVersion() : ?Property |
|
47 | + public function getDeclaredVersion() : ? Property |
|
48 | 48 | { |
49 | 49 | return $this->declaredVersion; |
50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * @return Property|null |
62 | 62 | */ |
63 | - public function getVersion() : ?Property |
|
63 | + public function getVersion() : ? Property |
|
64 | 64 | { |
65 | 65 | /** @var MappedSuperClassMetadata|null $parent */ |
66 | 66 | $parent = $this->parent; |
@@ -1,7 +1,7 @@ discard block |
||
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 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public function __toString() |
312 | 312 | { |
313 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
313 | + return __CLASS__.'@'.spl_object_hash($this); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | // Restore ReflectionClass and properties |
414 | 414 | $this->reflectionClass = $reflService->getClass($this->className); |
415 | 415 | |
416 | - if (! $this->reflectionClass) { |
|
416 | + if ( ! $this->reflectionClass) { |
|
417 | 417 | return; |
418 | 418 | } |
419 | 419 | |
@@ -492,11 +492,11 @@ discard block |
||
492 | 492 | } |
493 | 493 | |
494 | 494 | // Verify & complete identifier mapping |
495 | - if (! $this->identifier) { |
|
495 | + if ( ! $this->identifier) { |
|
496 | 496 | throw MappingException::identifierRequired($this->className); |
497 | 497 | } |
498 | 498 | |
499 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
499 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
500 | 500 | return $property instanceof FieldMetadata |
501 | 501 | && $property->isPrimaryKey() |
502 | 502 | && $property->hasValueGenerator(); |
@@ -517,14 +517,14 @@ discard block |
||
517 | 517 | public function validateAssociations() : void |
518 | 518 | { |
519 | 519 | array_map( |
520 | - function (Property $property) { |
|
521 | - if (! ($property instanceof AssociationMetadata)) { |
|
520 | + function(Property $property) { |
|
521 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
522 | 522 | return; |
523 | 523 | } |
524 | 524 | |
525 | 525 | $targetEntity = $property->getTargetEntity(); |
526 | 526 | |
527 | - if (! class_exists($targetEntity)) { |
|
527 | + if ( ! class_exists($targetEntity)) { |
|
528 | 528 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
529 | 529 | } |
530 | 530 | }, |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | foreach ($this->lifecycleCallbacks as $callbacks) { |
547 | 547 | /** @var array $callbacks */ |
548 | 548 | foreach ($callbacks as $callbackFuncName) { |
549 | - if (! $reflService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
549 | + if ( ! $reflService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
550 | 550 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
551 | 551 | } |
552 | 552 | } |
@@ -574,11 +574,11 @@ discard block |
||
574 | 574 | */ |
575 | 575 | public function isIdentifier(string $fieldName) : bool |
576 | 576 | { |
577 | - if (! $this->identifier) { |
|
577 | + if ( ! $this->identifier) { |
|
578 | 578 | return false; |
579 | 579 | } |
580 | 580 | |
581 | - if (! $this->isIdentifierComposite()) { |
|
581 | + if ( ! $this->isIdentifierComposite()) { |
|
582 | 582 | return $fieldName === $this->identifier[0]; |
583 | 583 | } |
584 | 584 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | */ |
607 | 607 | public function getNamedQuery($queryName) : string |
608 | 608 | { |
609 | - if (! isset($this->namedQueries[$queryName])) { |
|
609 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
610 | 610 | throw MappingException::queryNotFound($this->className, $queryName); |
611 | 611 | } |
612 | 612 | |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | */ |
667 | 667 | public function getSqlResultSetMapping($name) |
668 | 668 | { |
669 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
669 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
670 | 670 | throw MappingException::resultMappingNotFound($this->className, $name); |
671 | 671 | } |
672 | 672 | |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | $property->setColumnName($columnName); |
702 | 702 | } |
703 | 703 | |
704 | - if (! $this->isMappedSuperclass) { |
|
704 | + if ( ! $this->isMappedSuperclass) { |
|
705 | 705 | $property->setTableName($this->getTableName()); |
706 | 706 | } |
707 | 707 | |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
722 | 722 | }; |
723 | 723 | |
724 | - if (! in_array($fieldName, $this->identifier)) { |
|
724 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
725 | 725 | $this->identifier[] = $fieldName; |
726 | 726 | } |
727 | 727 | } |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | $fieldName = $property->getName(); |
776 | 776 | $targetEntity = $property->getTargetEntity(); |
777 | 777 | |
778 | - if (! $targetEntity) { |
|
778 | + if ( ! $targetEntity) { |
|
779 | 779 | throw MappingException::missingTargetEntity($fieldName); |
780 | 780 | } |
781 | 781 | |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | $this->identifier[] = $property->getName(); |
807 | 807 | } |
808 | 808 | |
809 | - if ($this->cache && !$property->getCache()) { |
|
809 | + if ($this->cache && ! $property->getCache()) { |
|
810 | 810 | throw CacheException::nonCacheableEntityAssociation($this->className, $fieldName); |
811 | 811 | } |
812 | 812 | |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | /** @var JoinColumnMetadata $joinColumn */ |
861 | 861 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
862 | 862 | if (1 === count($property->getJoinColumns())) { |
863 | - if (! $property->isPrimaryKey()) { |
|
863 | + if ( ! $property->isPrimaryKey()) { |
|
864 | 864 | $joinColumn->setUnique(true); |
865 | 865 | } |
866 | 866 | } else { |
@@ -868,13 +868,13 @@ discard block |
||
868 | 868 | } |
869 | 869 | } |
870 | 870 | |
871 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
871 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
872 | 872 | |
873 | - if (! $joinColumn->getColumnName()) { |
|
873 | + if ( ! $joinColumn->getColumnName()) { |
|
874 | 874 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
875 | 875 | } |
876 | 876 | |
877 | - if (! $joinColumn->getReferencedColumnName()) { |
|
877 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
878 | 878 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
879 | 879 | } |
880 | 880 | |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | if ($property->isOrphanRemoval()) { |
903 | 903 | $cascades = $property->getCascade(); |
904 | 904 | |
905 | - if (! in_array('remove', $cascades)) { |
|
905 | + if ( ! in_array('remove', $cascades)) { |
|
906 | 906 | $cascades[] = 'remove'; |
907 | 907 | |
908 | 908 | $property->setCascade($cascades); |
@@ -970,14 +970,14 @@ discard block |
||
970 | 970 | $property->setOwningSide(false); |
971 | 971 | |
972 | 972 | // OneToMany MUST have mappedBy |
973 | - if (! $property->getMappedBy()) { |
|
973 | + if ( ! $property->getMappedBy()) { |
|
974 | 974 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
975 | 975 | } |
976 | 976 | |
977 | 977 | if ($property->isOrphanRemoval()) { |
978 | 978 | $cascades = $property->getCascade(); |
979 | 979 | |
980 | - if (! in_array('remove', $cascades)) { |
|
980 | + if ( ! in_array('remove', $cascades)) { |
|
981 | 981 | $cascades[] = 'remove'; |
982 | 982 | |
983 | 983 | $property->setCascade($cascades); |
@@ -1000,7 +1000,7 @@ discard block |
||
1000 | 1000 | |
1001 | 1001 | $property->setJoinTable($joinTable); |
1002 | 1002 | |
1003 | - if (! $joinTable->getName()) { |
|
1003 | + if ( ! $joinTable->getName()) { |
|
1004 | 1004 | $joinTableName = $this->namingStrategy->joinTableName( |
1005 | 1005 | $property->getSourceEntity(), |
1006 | 1006 | $property->getTargetEntity(), |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | |
1013 | 1013 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
1014 | 1014 | |
1015 | - if (! $joinTable->getJoinColumns()) { |
|
1015 | + if ( ! $joinTable->getJoinColumns()) { |
|
1016 | 1016 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
1017 | 1017 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
1018 | 1018 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | $joinTable->addJoinColumn($joinColumn); |
1026 | 1026 | } |
1027 | 1027 | |
1028 | - if (! $joinTable->getInverseJoinColumns()) { |
|
1028 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
1029 | 1029 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
1030 | 1030 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
1031 | 1031 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -1040,13 +1040,13 @@ discard block |
||
1040 | 1040 | |
1041 | 1041 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
1042 | 1042 | /** @var JoinColumnMetadata $joinColumn */ |
1043 | - if (! $joinColumn->getReferencedColumnName()) { |
|
1043 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
1044 | 1044 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1045 | 1045 | } |
1046 | 1046 | |
1047 | 1047 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1048 | 1048 | |
1049 | - if (! $joinColumn->getColumnName()) { |
|
1049 | + if ( ! $joinColumn->getColumnName()) { |
|
1050 | 1050 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1051 | 1051 | $property->getSourceEntity(), |
1052 | 1052 | $referencedColumnName |
@@ -1058,13 +1058,13 @@ discard block |
||
1058 | 1058 | |
1059 | 1059 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
1060 | 1060 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
1061 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
1061 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
1062 | 1062 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1063 | 1063 | } |
1064 | 1064 | |
1065 | 1065 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
1066 | 1066 | |
1067 | - if (! $inverseJoinColumn->getColumnName()) { |
|
1067 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
1068 | 1068 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1069 | 1069 | $property->getTargetEntity(), |
1070 | 1070 | $referencedColumnName |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | // Association defined as Id field |
1162 | 1162 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1163 | 1163 | |
1164 | - if (! $property->isOwningSide()) { |
|
1164 | + if ( ! $property->isOwningSide()) { |
|
1165 | 1165 | $property = $targetClass->getProperty($property->getMappedBy()); |
1166 | 1166 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1167 | 1167 | } |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | $columnName = $joinColumn->getColumnName(); |
1177 | 1177 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1178 | 1178 | |
1179 | - if (! $joinColumn->getType()) { |
|
1179 | + if ( ! $joinColumn->getType()) { |
|
1180 | 1180 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
1181 | 1181 | } |
1182 | 1182 | |
@@ -1192,7 +1192,7 @@ discard block |
||
1192 | 1192 | * |
1193 | 1193 | * @return string|null |
1194 | 1194 | */ |
1195 | - public function getTableName() : ?string |
|
1195 | + public function getTableName() : ? string |
|
1196 | 1196 | { |
1197 | 1197 | return $this->table->getName(); |
1198 | 1198 | } |
@@ -1202,7 +1202,7 @@ discard block |
||
1202 | 1202 | * |
1203 | 1203 | * @return string|null |
1204 | 1204 | */ |
1205 | - public function getSchemaName() : ?string |
|
1205 | + public function getSchemaName() : ? string |
|
1206 | 1206 | { |
1207 | 1207 | return $this->table->getSchema(); |
1208 | 1208 | } |
@@ -1216,11 +1216,11 @@ discard block |
||
1216 | 1216 | { |
1217 | 1217 | $schema = null === $this->getSchemaName() |
1218 | 1218 | ? '' |
1219 | - : $this->getSchemaName() . '_' |
|
1219 | + : $this->getSchemaName().'_' |
|
1220 | 1220 | ; |
1221 | 1221 | |
1222 | 1222 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
1223 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
1223 | + return $schema.$this->getTableName().'_id_tmp'; |
|
1224 | 1224 | } |
1225 | 1225 | |
1226 | 1226 | /** |
@@ -1280,7 +1280,7 @@ discard block |
||
1280 | 1280 | { |
1281 | 1281 | $fieldName = $property->getName(); |
1282 | 1282 | |
1283 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1283 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1284 | 1284 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1285 | 1285 | } |
1286 | 1286 | |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | * |
1401 | 1401 | * @return LocalColumnMetadata|null |
1402 | 1402 | */ |
1403 | - public function getColumn(string $columnName): ?LocalColumnMetadata |
|
1403 | + public function getColumn(string $columnName): ? LocalColumnMetadata |
|
1404 | 1404 | { |
1405 | 1405 | foreach ($this->declaredProperties as $property) { |
1406 | 1406 | if ($property instanceof LocalColumnMetadata && $property->getColumnName() === $columnName) { |
@@ -1486,7 +1486,7 @@ discard block |
||
1486 | 1486 | $declaringClass = $property->getDeclaringClass(); |
1487 | 1487 | |
1488 | 1488 | if ($inheritedProperty instanceof FieldMetadata) { |
1489 | - if (! $declaringClass->isMappedSuperclass) { |
|
1489 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1490 | 1490 | $inheritedProperty->setTableName($property->getTableName()); |
1491 | 1491 | } |
1492 | 1492 | |
@@ -1554,7 +1554,7 @@ discard block |
||
1554 | 1554 | throw MappingException::duplicateQueryMapping($this->className, $name); |
1555 | 1555 | } |
1556 | 1556 | |
1557 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1557 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1558 | 1558 | throw MappingException::missingQueryMapping($this->className, $name); |
1559 | 1559 | } |
1560 | 1560 | |
@@ -1577,7 +1577,7 @@ discard block |
||
1577 | 1577 | */ |
1578 | 1578 | public function addSqlResultSetMapping(array $resultMapping) |
1579 | 1579 | { |
1580 | - if (!isset($resultMapping['name'])) { |
|
1580 | + if ( ! isset($resultMapping['name'])) { |
|
1581 | 1581 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
1582 | 1582 | } |
1583 | 1583 | |
@@ -1587,7 +1587,7 @@ discard block |
||
1587 | 1587 | |
1588 | 1588 | if (isset($resultMapping['entities'])) { |
1589 | 1589 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
1590 | - if (! isset($entityResult['entityClass'])) { |
|
1590 | + if ( ! isset($entityResult['entityClass'])) { |
|
1591 | 1591 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
1592 | 1592 | } |
1593 | 1593 | |
@@ -1600,11 +1600,11 @@ discard block |
||
1600 | 1600 | |
1601 | 1601 | if (isset($entityResult['fields'])) { |
1602 | 1602 | foreach ($entityResult['fields'] as $k => $field) { |
1603 | - if (! isset($field['name'])) { |
|
1603 | + if ( ! isset($field['name'])) { |
|
1604 | 1604 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
1605 | 1605 | } |
1606 | 1606 | |
1607 | - if (! isset($field['column'])) { |
|
1607 | + if ( ! isset($field['column'])) { |
|
1608 | 1608 | $fieldName = $field['name']; |
1609 | 1609 | |
1610 | 1610 | if (strpos($fieldName, '.')) { |
@@ -1628,7 +1628,7 @@ discard block |
||
1628 | 1628 | * |
1629 | 1629 | * @return void |
1630 | 1630 | */ |
1631 | - public function setCustomRepositoryClassName(?string $repositoryClassName) |
|
1631 | + public function setCustomRepositoryClassName(? string $repositoryClassName) |
|
1632 | 1632 | { |
1633 | 1633 | $this->customRepositoryClassName = $repositoryClassName; |
1634 | 1634 | } |
@@ -1636,7 +1636,7 @@ discard block |
||
1636 | 1636 | /** |
1637 | 1637 | * @return string|null |
1638 | 1638 | */ |
1639 | - public function getCustomRepositoryClassName() : ?string |
|
1639 | + public function getCustomRepositoryClassName() : ? string |
|
1640 | 1640 | { |
1641 | 1641 | return $this->customRepositoryClassName; |
1642 | 1642 | } |
@@ -1713,11 +1713,11 @@ discard block |
||
1713 | 1713 | 'method' => $method, |
1714 | 1714 | ]; |
1715 | 1715 | |
1716 | - if (! class_exists($class)) { |
|
1716 | + if ( ! class_exists($class)) { |
|
1717 | 1717 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1718 | 1718 | } |
1719 | 1719 | |
1720 | - if (! method_exists($class, $method)) { |
|
1720 | + if ( ! method_exists($class, $method)) { |
|
1721 | 1721 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1722 | 1722 | } |
1723 | 1723 | |
@@ -1793,7 +1793,7 @@ discard block |
||
1793 | 1793 | return; |
1794 | 1794 | } |
1795 | 1795 | |
1796 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1796 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1797 | 1797 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1798 | 1798 | } |
1799 | 1799 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * <http://www.doctrine-project.org>. |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace Doctrine\ORM\Mapping; |
24 | 24 |
@@ -1,7 +1,7 @@ discard block |
||
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 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | /** |
198 | 198 | * @return string|null |
199 | 199 | */ |
200 | - public function getMappedBy() : ?string |
|
200 | + public function getMappedBy() : ? string |
|
201 | 201 | { |
202 | 202 | return $this->mappedBy; |
203 | 203 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | /** |
214 | 214 | * @return null|string |
215 | 215 | */ |
216 | - public function getInversedBy() : ?string |
|
216 | + public function getInversedBy() : ? string |
|
217 | 217 | { |
218 | 218 | return $this->inversedBy; |
219 | 219 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | /** |
246 | 246 | * @return null|CacheMetadata |
247 | 247 | */ |
248 | - public function getCache() : ?CacheMetadata |
|
248 | + public function getCache() : ? CacheMetadata |
|
249 | 249 | { |
250 | 250 | return $this->cache; |
251 | 251 | } |
@@ -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 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $this->reverseEngineerMappingFromDatabase(); |
163 | 163 | |
164 | 164 | if ( ! isset($this->classToTableNames[$className])) { |
165 | - throw new \InvalidArgumentException("Unknown class " . $className); |
|
165 | + throw new \InvalidArgumentException("Unknown class ".$className); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | // @todo guilhermeblanco This should somehow disappear... =) |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | if ( ! $table->hasPrimaryKey()) { |
279 | 279 | throw new Mapping\MappingException( |
280 | - "Table " . $table->getName() . " has no primary key. Doctrine does not ". |
|
280 | + "Table ".$table->getName()." has no primary key. Doctrine does not ". |
|
281 | 281 | "support reverse engineering from tables that don't have a primary key." |
282 | 282 | ); |
283 | 283 | } |
@@ -522,10 +522,10 @@ discard block |
||
522 | 522 | private function getClassNameForTable($tableName) |
523 | 523 | { |
524 | 524 | if (isset($this->classNamesForTables[$tableName])) { |
525 | - return $this->namespace . $this->classNamesForTables[$tableName]; |
|
525 | + return $this->namespace.$this->classNamesForTables[$tableName]; |
|
526 | 526 | } |
527 | 527 | |
528 | - return $this->namespace . Inflector::classify(strtolower($tableName)); |
|
528 | + return $this->namespace.Inflector::classify(strtolower($tableName)); |
|
529 | 529 | } |
530 | 530 | |
531 | 531 | /** |
@@ -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 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | return $this->classNames; |
79 | 79 | } |
80 | 80 | |
81 | - if (!$this->paths) { |
|
81 | + if ( ! $this->paths) { |
|
82 | 82 | throw Mapping\MappingException::pathRequired(); |
83 | 83 | } |
84 | 84 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $includedFiles = []; |
87 | 87 | |
88 | 88 | foreach ($this->paths as $path) { |
89 | - if (!is_dir($path)) { |
|
89 | + if ( ! is_dir($path)) { |
|
90 | 90 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
91 | 91 | } |
92 | 92 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach ($declared as $className) { |
112 | 112 | $rc = new \ReflectionClass($className); |
113 | 113 | $sourceFile = $rc->getFileName(); |
114 | - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { |
|
114 | + if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { |
|
115 | 115 | $classes[] = $className; |
116 | 116 | } |
117 | 117 | } |