@@ -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\Performance\LazyLoading; |
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\Performance\Mock; |
6 | 6 |
@@ -22,7 +22,6 @@ |
||
22 | 22 | |
23 | 23 | namespace Doctrine\ORM\Mapping\Exporter; |
24 | 24 | |
25 | -use Doctrine\Common\Inflector\Inflector; |
|
26 | 25 | use Doctrine\ORM\Mapping; |
27 | 26 | |
28 | 27 | class ClassMetadataExporter implements Exporter |
@@ -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 @@ |
||
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,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\Exporter; |
7 | 7 |
@@ -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 | |
@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | { |
19 | 19 | /** @var JoinColumnMetadata $value */ |
20 | 20 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
21 | - $objectReference = $indentation . static::VARIABLE; |
|
21 | + $objectReference = $indentation.static::VARIABLE; |
|
22 | 22 | $lines = []; |
23 | 23 | |
24 | 24 | $lines[] = parent::export($value, $indentationLevel); |
25 | - $lines[] = $objectReference . '->setReferencedColumnName("' . $value->getReferencedColumnName() . '");'; |
|
26 | - $lines[] = $objectReference . '->setAliasedName("' . $value->getAliasedName() . '");'; |
|
27 | - $lines[] = $objectReference . '->setOnDelete("' . $value->getOnDelete() . '");'; |
|
25 | + $lines[] = $objectReference.'->setReferencedColumnName("'.$value->getReferencedColumnName().'");'; |
|
26 | + $lines[] = $objectReference.'->setAliasedName("'.$value->getAliasedName().'");'; |
|
27 | + $lines[] = $objectReference.'->setOnDelete("'.$value->getOnDelete().'");'; |
|
28 | 28 | |
29 | 29 | return implode(PHP_EOL, $lines); |
30 | 30 | } |
@@ -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 | |
@@ -20,33 +20,33 @@ discard block |
||
20 | 20 | $cacheExporter = new CacheMetadataExporter(); |
21 | 21 | $variableExporter = new VariableExporter(); |
22 | 22 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
23 | - $objectReference = $indentation . static::VARIABLE; |
|
23 | + $objectReference = $indentation.static::VARIABLE; |
|
24 | 24 | $cascade = $this->resolveCascade($value->getCascade()); |
25 | 25 | $lines = []; |
26 | 26 | |
27 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
27 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
28 | 28 | |
29 | - if (! empty($value->getCache())) { |
|
29 | + if ( ! empty($value->getCache())) { |
|
30 | 30 | $lines[] = $cacheExporter->export($value->getCache(), $indentationLevel); |
31 | 31 | $lines[] = null; |
32 | - $lines[] = $objectReference . '->setCache(' . $cacheExporter::VARIABLE . ');'; |
|
32 | + $lines[] = $objectReference.'->setCache('.$cacheExporter::VARIABLE.');'; |
|
33 | 33 | } |
34 | 34 | |
35 | - if (! empty($value->getMappedBy())) { |
|
36 | - $lines[] = $objectReference . '->setMappedBy("' . $value->getMappedBy() . '");'; |
|
35 | + if ( ! empty($value->getMappedBy())) { |
|
36 | + $lines[] = $objectReference.'->setMappedBy("'.$value->getMappedBy().'");'; |
|
37 | 37 | } |
38 | 38 | |
39 | - if (! empty($value->getInversedBy())) { |
|
40 | - $lines[] = $objectReference . '->setInversedBy("' . $value->getInversedBy() . '");'; |
|
39 | + if ( ! empty($value->getInversedBy())) { |
|
40 | + $lines[] = $objectReference.'->setInversedBy("'.$value->getInversedBy().'");'; |
|
41 | 41 | } |
42 | 42 | |
43 | - $lines[] = $objectReference . '->setSourceEntity("' . $value->getSourceEntity() . '");'; |
|
44 | - $lines[] = $objectReference . '->setTargetEntity("' . $value->getTargetEntity() . '");'; |
|
45 | - $lines[] = $objectReference . '->setFetchMode(Mapping\FetchMode::' . strtoupper($value->getFetchMode()) . '");'; |
|
46 | - $lines[] = $objectReference . '->setCascade(' . $variableExporter->export($cascade, $indentationLevel + 1) . ');'; |
|
47 | - $lines[] = $objectReference . '->setOwningSide(' . $variableExporter->export($value->isOwningSide(), $indentationLevel + 1) . ');'; |
|
48 | - $lines[] = $objectReference . '->setOrphanRemoval(' . $variableExporter->export($value->isOrphanRemoval(), $indentationLevel + 1) . ');'; |
|
49 | - $lines[] = $objectReference . '->setPrimaryKey(' . $variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1) . ');'; |
|
43 | + $lines[] = $objectReference.'->setSourceEntity("'.$value->getSourceEntity().'");'; |
|
44 | + $lines[] = $objectReference.'->setTargetEntity("'.$value->getTargetEntity().'");'; |
|
45 | + $lines[] = $objectReference.'->setFetchMode(Mapping\FetchMode::'.strtoupper($value->getFetchMode()).'");'; |
|
46 | + $lines[] = $objectReference.'->setCascade('.$variableExporter->export($cascade, $indentationLevel + 1).');'; |
|
47 | + $lines[] = $objectReference.'->setOwningSide('.$variableExporter->export($value->isOwningSide(), $indentationLevel + 1).');'; |
|
48 | + $lines[] = $objectReference.'->setOrphanRemoval('.$variableExporter->export($value->isOrphanRemoval(), $indentationLevel + 1).');'; |
|
49 | + $lines[] = $objectReference.'->setPrimaryKey('.$variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1).');'; |
|
50 | 50 | |
51 | 51 | |
52 | 52 | return implode(PHP_EOL, $lines); |
@@ -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 | |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | /** @var ToManyAssociationMetadata $value */ |
18 | 18 | $variableExporter = new VariableExporter(); |
19 | 19 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
20 | - $objectReference = $indentation . static::VARIABLE; |
|
20 | + $objectReference = $indentation.static::VARIABLE; |
|
21 | 21 | $lines = []; |
22 | 22 | |
23 | 23 | $lines[] = parent::export($value, $indentationLevel); |
24 | 24 | |
25 | - if (! empty($value->getIndexedBy())) { |
|
26 | - $lines[] = $objectReference . '->setIndexedBy("' . $value->getIndexedBy() . '"");'; |
|
25 | + if ( ! empty($value->getIndexedBy())) { |
|
26 | + $lines[] = $objectReference.'->setIndexedBy("'.$value->getIndexedBy().'"");'; |
|
27 | 27 | } |
28 | 28 | |
29 | - $lines[] = $objectReference . '->setOderBy(' . $variableExporter->export($value->getOrderBy(), $indentationLevel + 1) . ');'; |
|
29 | + $lines[] = $objectReference.'->setOderBy('.$variableExporter->export($value->getOrderBy(), $indentationLevel + 1).');'; |
|
30 | 30 | |
31 | 31 | return implode(PHP_EOL, $lines); |
32 | 32 | } |
@@ -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 | |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** @var ToOneAssociationMetadata $value */ |
18 | 18 | $joinColumnExporter = new JoinColumnMetadataExporter(); |
19 | 19 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
20 | - $objectReference = $indentation . static::VARIABLE; |
|
20 | + $objectReference = $indentation.static::VARIABLE; |
|
21 | 21 | $lines = []; |
22 | 22 | |
23 | 23 | $lines[] = parent::export($value, $indentationLevel); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $lines[] = null; |
27 | 27 | $lines[] = $joinColumnExporter->export($joinColumn, $indentationLevel); |
28 | 28 | $lines[] = null; |
29 | - $lines[] = $objectReference . '->addJoinColumn(' . $joinColumnExporter::VARIABLE . ');'; |
|
29 | + $lines[] = $objectReference.'->addJoinColumn('.$joinColumnExporter::VARIABLE.');'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | return implode(PHP_EOL, $lines); |