@@ -19,9 +19,9 @@ |
||
19 | 19 | { |
20 | 20 | /** @var TransientMetadata $value */ |
21 | 21 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
22 | - $objectReference = $indentation . self::VARIABLE; |
|
22 | + $objectReference = $indentation.self::VARIABLE; |
|
23 | 23 | |
24 | - return $objectReference . ' = ' . $this->exportInstantiation($value); |
|
24 | + return $objectReference.' = '.$this->exportInstantiation($value); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | protected function exportInstantiation(TransientMetadata $metadata) : string |
@@ -25,11 +25,11 @@ |
||
25 | 25 | /** @var FieldMetadata $value */ |
26 | 26 | $variableExporter = new VariableExporter(); |
27 | 27 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
28 | - $objectReference = $indentation . self::VARIABLE; |
|
28 | + $objectReference = $indentation.self::VARIABLE; |
|
29 | 29 | |
30 | 30 | $lines = []; |
31 | 31 | $lines[] = parent::export($value, $indentationLevel); |
32 | - $lines[] = $objectReference . '->setVersioned(' . \ltrim($variableExporter->export($value->isVersioned(), $indentationLevel + 1)) . ');'; |
|
32 | + $lines[] = $objectReference.'->setVersioned('.\ltrim($variableExporter->export($value->isVersioned(), $indentationLevel + 1)).');'; |
|
33 | 33 | |
34 | 34 | return \implode(PHP_EOL, $lines); |
35 | 35 | } |
@@ -23,13 +23,13 @@ |
||
23 | 23 | { |
24 | 24 | /** @var JoinColumnMetadata $value */ |
25 | 25 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
26 | - $objectReference = $indentation . self::VARIABLE; |
|
26 | + $objectReference = $indentation.self::VARIABLE; |
|
27 | 27 | $lines = []; |
28 | 28 | |
29 | 29 | $lines[] = parent::export($value, $indentationLevel); |
30 | - $lines[] = $objectReference . '->setReferencedColumnName("' . $value->getReferencedColumnName() . '");'; |
|
31 | - $lines[] = $objectReference . '->setAliasedName("' . $value->getAliasedName() . '");'; |
|
32 | - $lines[] = $objectReference . '->setOnDelete("' . $value->getOnDelete() . '");'; |
|
30 | + $lines[] = $objectReference.'->setReferencedColumnName("'.$value->getReferencedColumnName().'");'; |
|
31 | + $lines[] = $objectReference.'->setAliasedName("'.$value->getAliasedName().'");'; |
|
32 | + $lines[] = $objectReference.'->setOnDelete("'.$value->getOnDelete().'");'; |
|
33 | 33 | |
34 | 34 | return \implode(PHP_EOL, $lines); |
35 | 35 | } |
@@ -22,20 +22,20 @@ |
||
22 | 22 | /** @var ColumnMetadata $value */ |
23 | 23 | $variableExporter = new VariableExporter(); |
24 | 24 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
25 | - $objectReference = $indentation . self::VARIABLE; |
|
25 | + $objectReference = $indentation.self::VARIABLE; |
|
26 | 26 | $lines = []; |
27 | 27 | |
28 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
28 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
29 | 29 | |
30 | - if (! empty($value->getColumnDefinition())) { |
|
31 | - $lines[] = $objectReference . '->setColumnDefinition("' . $value->getColumnDefinition() . '");'; |
|
30 | + if ( ! empty($value->getColumnDefinition())) { |
|
31 | + $lines[] = $objectReference.'->setColumnDefinition("'.$value->getColumnDefinition().'");'; |
|
32 | 32 | } |
33 | 33 | |
34 | - $lines[] = $objectReference . '->setTableName("' . $value->getTableName() . '");'; |
|
35 | - $lines[] = $objectReference . '->setOptions(' . \ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)) . ');'; |
|
36 | - $lines[] = $objectReference . '->setPrimaryKey(' . \ltrim($variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1)) . ');'; |
|
37 | - $lines[] = $objectReference . '->setNullable(' . \ltrim($variableExporter->export($value->isNullable(), $indentationLevel + 1)) . ');'; |
|
38 | - $lines[] = $objectReference . '->setUnique(' . \ltrim($variableExporter->export($value->isUnique(), $indentationLevel + 1)) . ');'; |
|
34 | + $lines[] = $objectReference.'->setTableName("'.$value->getTableName().'");'; |
|
35 | + $lines[] = $objectReference.'->setOptions('.\ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)).');'; |
|
36 | + $lines[] = $objectReference.'->setPrimaryKey('.\ltrim($variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1)).');'; |
|
37 | + $lines[] = $objectReference.'->setNullable('.\ltrim($variableExporter->export($value->isNullable(), $indentationLevel + 1)).');'; |
|
38 | + $lines[] = $objectReference.'->setUnique('.\ltrim($variableExporter->export($value->isUnique(), $indentationLevel + 1)).');'; |
|
39 | 39 | |
40 | 40 | return \implode(PHP_EOL, $lines); |
41 | 41 | } |
@@ -24,33 +24,33 @@ |
||
24 | 24 | $cacheExporter = new CacheMetadataExporter(); |
25 | 25 | $variableExporter = new VariableExporter(); |
26 | 26 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
27 | - $objectReference = $indentation . self::VARIABLE; |
|
27 | + $objectReference = $indentation.self::VARIABLE; |
|
28 | 28 | $cascade = $this->resolveCascade($value->getCascade()); |
29 | 29 | $lines = []; |
30 | 30 | |
31 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
31 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
32 | 32 | |
33 | - if (! empty($value->getCache())) { |
|
33 | + if ( ! empty($value->getCache())) { |
|
34 | 34 | $lines[] = $cacheExporter->export($value->getCache(), $indentationLevel); |
35 | 35 | $lines[] = null; |
36 | - $lines[] = $objectReference . '->setCache(' . $cacheExporter::VARIABLE . ');'; |
|
36 | + $lines[] = $objectReference.'->setCache('.$cacheExporter::VARIABLE.');'; |
|
37 | 37 | } |
38 | 38 | |
39 | - if (! empty($value->getMappedBy())) { |
|
40 | - $lines[] = $objectReference . '->setMappedBy("' . $value->getMappedBy() . '");'; |
|
41 | - $lines[] = $objectReference . '->setOwningSide(false);'; |
|
39 | + if ( ! empty($value->getMappedBy())) { |
|
40 | + $lines[] = $objectReference.'->setMappedBy("'.$value->getMappedBy().'");'; |
|
41 | + $lines[] = $objectReference.'->setOwningSide(false);'; |
|
42 | 42 | } |
43 | 43 | |
44 | - if (! empty($value->getInversedBy())) { |
|
45 | - $lines[] = $objectReference . '->setInversedBy("' . $value->getInversedBy() . '");'; |
|
44 | + if ( ! empty($value->getInversedBy())) { |
|
45 | + $lines[] = $objectReference.'->setInversedBy("'.$value->getInversedBy().'");'; |
|
46 | 46 | } |
47 | 47 | |
48 | - $lines[] = $objectReference . '->setSourceEntity("' . $value->getSourceEntity() . '");'; |
|
49 | - $lines[] = $objectReference . '->setTargetEntity("' . $value->getTargetEntity() . '");'; |
|
50 | - $lines[] = $objectReference . '->setFetchMode(Mapping\FetchMode::' . \strtoupper($value->getFetchMode()) . '");'; |
|
51 | - $lines[] = $objectReference . '->setCascade(' . $variableExporter->export($cascade, $indentationLevel + 1) . ');'; |
|
52 | - $lines[] = $objectReference . '->setOrphanRemoval(' . $variableExporter->export($value->isOrphanRemoval(), $indentationLevel + 1) . ');'; |
|
53 | - $lines[] = $objectReference . '->setPrimaryKey(' . $variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1) . ');'; |
|
48 | + $lines[] = $objectReference.'->setSourceEntity("'.$value->getSourceEntity().'");'; |
|
49 | + $lines[] = $objectReference.'->setTargetEntity("'.$value->getTargetEntity().'");'; |
|
50 | + $lines[] = $objectReference.'->setFetchMode(Mapping\FetchMode::'.\strtoupper($value->getFetchMode()).'");'; |
|
51 | + $lines[] = $objectReference.'->setCascade('.$variableExporter->export($cascade, $indentationLevel + 1).');'; |
|
52 | + $lines[] = $objectReference.'->setOrphanRemoval('.$variableExporter->export($value->isOrphanRemoval(), $indentationLevel + 1).');'; |
|
53 | + $lines[] = $objectReference.'->setPrimaryKey('.$variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1).');'; |
|
54 | 54 | |
55 | 55 | return \implode(PHP_EOL, $lines); |
56 | 56 | } |
@@ -24,19 +24,19 @@ |
||
24 | 24 | /** @var JoinTableMetadata $value */ |
25 | 25 | $joinColumnExporter = new JoinColumnMetadataExporter(); |
26 | 26 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
27 | - $objectReference = $indentation . self::VARIABLE; |
|
27 | + $objectReference = $indentation.self::VARIABLE; |
|
28 | 28 | $lines = []; |
29 | 29 | |
30 | 30 | $lines[] = parent::export($value, $indentationLevel); |
31 | 31 | |
32 | 32 | foreach ($value->getJoinColumns() as $joinColumn) { |
33 | 33 | $lines[] = $joinColumnExporter->export($joinColumn, $indentationLevel); |
34 | - $lines[] = $objectReference . '->addJoinColumn(' . $joinColumnExporter::VARIABLE . ');'; |
|
34 | + $lines[] = $objectReference.'->addJoinColumn('.$joinColumnExporter::VARIABLE.');'; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | foreach ($value->getInverseJoinColumns() as $inverseJoinColumn) { |
38 | 38 | $lines[] = $joinColumnExporter->export($inverseJoinColumn, $indentationLevel); |
39 | - $lines[] = $objectReference . '->addInverseJoinColumn(' . $joinColumnExporter::VARIABLE . ');'; |
|
39 | + $lines[] = $objectReference.'->addInverseJoinColumn('.$joinColumnExporter::VARIABLE.');'; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return \implode(PHP_EOL, $lines); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** @var ToOneAssociationMetadata $value */ |
20 | 20 | $joinColumnExporter = new JoinColumnMetadataExporter(); |
21 | 21 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
22 | - $objectReference = $indentation . self::VARIABLE; |
|
22 | + $objectReference = $indentation.self::VARIABLE; |
|
23 | 23 | $lines = []; |
24 | 24 | |
25 | 25 | $lines[] = parent::export($value, $indentationLevel); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $lines[] = null; |
29 | 29 | $lines[] = $joinColumnExporter->export($joinColumn, $indentationLevel); |
30 | 30 | $lines[] = null; |
31 | - $lines[] = $objectReference . '->addJoinColumn(' . $joinColumnExporter::VARIABLE . ');'; |
|
31 | + $lines[] = $objectReference.'->addJoinColumn('.$joinColumnExporter::VARIABLE.');'; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | return \implode(PHP_EOL, $lines); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $lines[] = null; |
30 | 30 | |
31 | 31 | if ($namespace) { |
32 | - $lines[] = 'namespace ' . $namespace . ';'; |
|
32 | + $lines[] = 'namespace '.$namespace.';'; |
|
33 | 33 | $lines[] = null; |
34 | 34 | } |
35 | 35 | |
@@ -64,31 +64,31 @@ discard block |
||
64 | 64 | { |
65 | 65 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
66 | 66 | $bodyIndentation = \str_repeat(self::INDENTATION, $indentationLevel + 1); |
67 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
67 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
68 | 68 | $lines = []; |
69 | 69 | |
70 | - $lines[] = $indentation . 'public function __construct('; |
|
71 | - $lines[] = $bodyIndentation . 'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
72 | - $lines[] = $bodyIndentation . '?ClassMetadata $parent = null'; |
|
73 | - $lines[] = $indentation . ')'; |
|
74 | - $lines[] = $indentation . '{'; |
|
75 | - $lines[] = $bodyIndentation . 'parent::__construct("' . $metadata->getClassName() . '", $parent, $metadataBuildingContext);'; |
|
70 | + $lines[] = $indentation.'public function __construct('; |
|
71 | + $lines[] = $bodyIndentation.'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
72 | + $lines[] = $bodyIndentation.'?ClassMetadata $parent = null'; |
|
73 | + $lines[] = $indentation.')'; |
|
74 | + $lines[] = $indentation.'{'; |
|
75 | + $lines[] = $bodyIndentation.'parent::__construct("'.$metadata->getClassName().'", $parent, $metadataBuildingContext);'; |
|
76 | 76 | |
77 | 77 | if ($metadata->getCustomRepositoryClassName()) { |
78 | 78 | $lines[] = null; |
79 | - $lines[] = $objectReference . '->setCustomRepositoryClassName("' . $metadata->getCustomRepositoryClassName() . '");'; |
|
79 | + $lines[] = $objectReference.'->setCustomRepositoryClassName("'.$metadata->getCustomRepositoryClassName().'");'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | if ($metadata->changeTrackingPolicy) { |
83 | 83 | $lines[] = null; |
84 | - $lines[] = $objectReference . '->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . \strtoupper($metadata->changeTrackingPolicy) . ');'; |
|
84 | + $lines[] = $objectReference.'->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.\strtoupper($metadata->changeTrackingPolicy).');'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $lines[] = $this->exportInheritance($metadata, $indentationLevel); |
88 | 88 | $lines[] = $this->exportTable($metadata, $indentationLevel); |
89 | 89 | $lines[] = $this->exportProperties($metadata, $indentationLevel); |
90 | 90 | $lines[] = $this->exportLifecycleCallbacks($metadata, $indentationLevel); |
91 | - $lines[] = $indentation . '}'; |
|
91 | + $lines[] = $indentation.'}'; |
|
92 | 92 | |
93 | 93 | return \implode(PHP_EOL, $lines); |
94 | 94 | } |
@@ -96,17 +96,17 @@ discard block |
||
96 | 96 | private function exportInheritance(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
97 | 97 | { |
98 | 98 | $bodyIndentation = \str_repeat(self::INDENTATION, $indentationLevel + 1); |
99 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
99 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
100 | 100 | $lines = []; |
101 | 101 | |
102 | 102 | if ($metadata->inheritanceType) { |
103 | 103 | $lines[] = null; |
104 | - $lines[] = $objectReference . '->setInheritanceType(Mapping\InheritanceType::' . \strtoupper($metadata->inheritanceType) . ');'; |
|
104 | + $lines[] = $objectReference.'->setInheritanceType(Mapping\InheritanceType::'.\strtoupper($metadata->inheritanceType).');'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | if ($metadata->discriminatorColumn) { |
108 | 108 | $lines[] = null; |
109 | - $lines[] = $bodyIndentation . '// Discriminator mapping'; |
|
109 | + $lines[] = $bodyIndentation.'// Discriminator mapping'; |
|
110 | 110 | $lines[] = $this->exportDiscriminatorMetadata($metadata, $indentationLevel + 1); |
111 | 111 | } |
112 | 112 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | if ($metadata->table) { |
122 | 122 | $lines[] = null; |
123 | - $lines[] = $bodyIndentation . '// Table'; |
|
123 | + $lines[] = $bodyIndentation.'// Table'; |
|
124 | 124 | $lines[] = $this->exportTableMetadata($metadata->table, $indentationLevel + 1); |
125 | 125 | } |
126 | 126 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | foreach ($metadata->getPropertiesIterator() as $name => $property) { |
136 | 136 | $lines[] = null; |
137 | - $lines[] = $bodyIndentation . '// Property: ' . $name; |
|
137 | + $lines[] = $bodyIndentation.'// Property: '.$name; |
|
138 | 138 | $lines[] = $this->exportProperty($property, $indentationLevel + 1); |
139 | 139 | } |
140 | 140 | |
@@ -144,16 +144,16 @@ discard block |
||
144 | 144 | private function exportLifecycleCallbacks(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
145 | 145 | { |
146 | 146 | $bodyIndentation = \str_repeat(self::INDENTATION, $indentationLevel + 1); |
147 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
147 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
148 | 148 | $lines = []; |
149 | 149 | |
150 | 150 | if ($metadata->lifecycleCallbacks) { |
151 | 151 | $lines[] = null; |
152 | - $lines[] = $bodyIndentation . '// Lifecycle callbacks'; |
|
152 | + $lines[] = $bodyIndentation.'// Lifecycle callbacks'; |
|
153 | 153 | |
154 | 154 | foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { |
155 | 155 | foreach ($callbacks as $callback) { |
156 | - $lines[] = $objectReference . '->addLifecycleCallback("' . $callback . '", "' . $event . '");'; |
|
156 | + $lines[] = $objectReference.'->addLifecycleCallback("'.$callback.'", "'.$event.'");'; |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | } |
@@ -166,17 +166,17 @@ discard block |
||
166 | 166 | $variableExporter = new VariableExporter(); |
167 | 167 | $discriminatorExporter = new DiscriminatorColumnMetadataExporter(); |
168 | 168 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
169 | - $objectReference = $indentation . self::VARIABLE; |
|
169 | + $objectReference = $indentation.self::VARIABLE; |
|
170 | 170 | $lines = []; |
171 | 171 | |
172 | 172 | $lines[] = $discriminatorExporter->export($metadata->discriminatorColumn, $indentationLevel); |
173 | 173 | $lines[] = null; |
174 | - $lines[] = $objectReference . '->setDiscriminatorColumn(' . $discriminatorExporter::VARIABLE . ');'; |
|
174 | + $lines[] = $objectReference.'->setDiscriminatorColumn('.$discriminatorExporter::VARIABLE.');'; |
|
175 | 175 | |
176 | 176 | if ($metadata->discriminatorMap) { |
177 | 177 | $discriminatorMap = $variableExporter->export($metadata->discriminatorMap, $indentationLevel + 1); |
178 | 178 | |
179 | - $lines[] = $objectReference . '->setDiscriminatorMap(' . $discriminatorMap . ');'; |
|
179 | + $lines[] = $objectReference.'->setDiscriminatorMap('.$discriminatorMap.');'; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | return \implode(PHP_EOL, $lines); |
@@ -186,12 +186,12 @@ discard block |
||
186 | 186 | { |
187 | 187 | $tableExporter = new TableMetadataExporter(); |
188 | 188 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
189 | - $objectReference = $indentation . self::VARIABLE; |
|
189 | + $objectReference = $indentation.self::VARIABLE; |
|
190 | 190 | $lines = []; |
191 | 191 | |
192 | 192 | $lines[] = $tableExporter->export($table, $indentationLevel); |
193 | 193 | $lines[] = null; |
194 | - $lines[] = $objectReference . '->setTable(' . $tableExporter::VARIABLE . ');'; |
|
194 | + $lines[] = $objectReference.'->setTable('.$tableExporter::VARIABLE.');'; |
|
195 | 195 | |
196 | 196 | return \implode(PHP_EOL, $lines); |
197 | 197 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | private function exportProperty(Mapping\Property $property, int $indentationLevel) : string |
200 | 200 | { |
201 | 201 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
202 | - $objectReference = $indentation . self::VARIABLE; |
|
202 | + $objectReference = $indentation.self::VARIABLE; |
|
203 | 203 | $lines = []; |
204 | 204 | |
205 | 205 | switch (true) { |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | $lines[] = $propertyExporter->export($property, $indentationLevel); |
232 | 232 | $lines[] = null; |
233 | - $lines[] = $objectReference . '->addProperty(' . $propertyExporter::VARIABLE . ');'; |
|
233 | + $lines[] = $objectReference.'->addProperty('.$propertyExporter::VARIABLE.');'; |
|
234 | 234 | |
235 | 235 | return \implode(PHP_EOL, $lines); |
236 | 236 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | /** @var ManyToManyAssociationMetadata $value */ |
23 | 23 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
24 | - $objectReference = $indentation . self::VARIABLE; |
|
24 | + $objectReference = $indentation.self::VARIABLE; |
|
25 | 25 | $lines = []; |
26 | 26 | |
27 | 27 | $lines[] = parent::export($value, $indentationLevel); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $lines[] = null; |
33 | 33 | $lines[] = $joinTableExporter->export($value->getJoinTable(), $indentationLevel); |
34 | 34 | $lines[] = null; |
35 | - $lines[] = $objectReference . '->setJoinTable(' . $joinTableExporter::VARIABLE . ');'; |
|
35 | + $lines[] = $objectReference.'->setJoinTable('.$joinTableExporter::VARIABLE.');'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | return \implode(PHP_EOL, $lines); |