@@ -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 . static::VARIABLE; |
|
25 | + $objectReference = $indentation.static::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 | } |
@@ -23,24 +23,24 @@ |
||
23 | 23 | /** @var TableMetadata $value */ |
24 | 24 | $variableExporter = new VariableExporter(); |
25 | 25 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
26 | - $objectReference = $indentation . static::VARIABLE; |
|
26 | + $objectReference = $indentation.static::VARIABLE; |
|
27 | 27 | $lines = []; |
28 | 28 | |
29 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
29 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
30 | 30 | |
31 | - if (! empty($value->getSchema())) { |
|
32 | - $lines[] = $objectReference . '->setSchema("' . $value->getSchema() . '");'; |
|
31 | + if ( ! empty($value->getSchema())) { |
|
32 | + $lines[] = $objectReference.'->setSchema("'.$value->getSchema().'");'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | foreach ($value->getIndexes() as $index) { |
36 | - $lines[] = $objectReference . '->addIndex(' . ltrim($variableExporter->export($index, $indentationLevel + 1)) . ');'; |
|
36 | + $lines[] = $objectReference.'->addIndex('.ltrim($variableExporter->export($index, $indentationLevel + 1)).');'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | foreach ($value->getUniqueConstraints() as $uniqueConstraint) { |
40 | - $lines[] = $objectReference . '->addUniqueConstraint(' . ltrim($variableExporter->export($uniqueConstraint, $indentationLevel + 1)) . ');'; |
|
40 | + $lines[] = $objectReference.'->addUniqueConstraint('.ltrim($variableExporter->export($uniqueConstraint, $indentationLevel + 1)).');'; |
|
41 | 41 | } |
42 | 42 | |
43 | - $lines[] = $objectReference . '->setOptions(' . ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)) . ');'; |
|
43 | + $lines[] = $objectReference.'->setOptions('.ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)).');'; |
|
44 | 44 | |
45 | 45 | return implode(PHP_EOL, $lines); |
46 | 46 | } |
@@ -19,16 +19,16 @@ |
||
19 | 19 | /** @var ToManyAssociationMetadata $value */ |
20 | 20 | $variableExporter = new VariableExporter(); |
21 | 21 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
22 | - $objectReference = $indentation . static::VARIABLE; |
|
22 | + $objectReference = $indentation.static::VARIABLE; |
|
23 | 23 | $lines = []; |
24 | 24 | |
25 | 25 | $lines[] = parent::export($value, $indentationLevel); |
26 | 26 | |
27 | - if (! empty($value->getIndexedBy())) { |
|
28 | - $lines[] = $objectReference . '->setIndexedBy("' . $value->getIndexedBy() . '"");'; |
|
27 | + if ( ! empty($value->getIndexedBy())) { |
|
28 | + $lines[] = $objectReference.'->setIndexedBy("'.$value->getIndexedBy().'"");'; |
|
29 | 29 | } |
30 | 30 | |
31 | - $lines[] = $objectReference . '->setOderBy(' . $variableExporter->export($value->getOrderBy(), $indentationLevel + 1) . ');'; |
|
31 | + $lines[] = $objectReference.'->setOderBy('.$variableExporter->export($value->getOrderBy(), $indentationLevel + 1).');'; |
|
32 | 32 | |
33 | 33 | return implode(PHP_EOL, $lines); |
34 | 34 | } |
@@ -22,10 +22,10 @@ |
||
22 | 22 | { |
23 | 23 | /** @var CacheMetadata $value */ |
24 | 24 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
25 | - $objectReference = $indentation . static::VARIABLE; |
|
25 | + $objectReference = $indentation.static::VARIABLE; |
|
26 | 26 | $lines = []; |
27 | 27 | |
28 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
28 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
29 | 29 | |
30 | 30 | return implode(PHP_EOL, $lines); |
31 | 31 | } |
@@ -20,18 +20,18 @@ |
||
20 | 20 | { |
21 | 21 | /** @var LocalColumnMetadata $value */ |
22 | 22 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
23 | - $objectReference = $indentation . static::VARIABLE; |
|
23 | + $objectReference = $indentation.static::VARIABLE; |
|
24 | 24 | $lines = []; |
25 | 25 | |
26 | 26 | $lines[] = parent::export($value, $indentationLevel); |
27 | 27 | |
28 | - $lines[] = $objectReference . '->setLength(' . $value->getLength() . ');'; |
|
29 | - $lines[] = $objectReference . '->setScale(' . $value->getScale() . ');'; |
|
30 | - $lines[] = $objectReference . '->setPrecision(' . $value->getPrecision() . ');'; |
|
28 | + $lines[] = $objectReference.'->setLength('.$value->getLength().');'; |
|
29 | + $lines[] = $objectReference.'->setScale('.$value->getScale().');'; |
|
30 | + $lines[] = $objectReference.'->setPrecision('.$value->getPrecision().');'; |
|
31 | 31 | |
32 | 32 | if ($value->hasValueGenerator()) { |
33 | 33 | $lines[] = sprintf( |
34 | - $objectReference . '->setValueGenerator(new ValueGenerator(%s, %s));', |
|
34 | + $objectReference.'->setValueGenerator(new ValueGenerator(%s, %s));', |
|
35 | 35 | var_export($value->getValueGenerator()->getType(), true), |
36 | 36 | var_export($value->getValueGenerator()->getDefinition(), true) |
37 | 37 | ); |
@@ -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 . static::VARIABLE; |
|
27 | + $objectReference = $indentation.static::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,9 +19,9 @@ |
||
19 | 19 | { |
20 | 20 | /** @var TransientMetadata $value */ |
21 | 21 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
22 | - $objectReference = $indentation . static::VARIABLE; |
|
22 | + $objectReference = $indentation.static::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 |
@@ -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 | |
@@ -65,31 +65,31 @@ discard block |
||
65 | 65 | { |
66 | 66 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
67 | 67 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
68 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
68 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
69 | 69 | $lines = []; |
70 | 70 | |
71 | - $lines[] = $indentation . 'public function __construct('; |
|
72 | - $lines[] = $bodyIndentation . 'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
73 | - $lines[] = $bodyIndentation . '?ClassMetadata $parent = null'; |
|
74 | - $lines[] = $indentation . ')'; |
|
75 | - $lines[] = $indentation . '{'; |
|
76 | - $lines[] = $bodyIndentation . 'parent::__construct("' . $metadata->getClassName() . '", $parent);'; |
|
71 | + $lines[] = $indentation.'public function __construct('; |
|
72 | + $lines[] = $bodyIndentation.'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
73 | + $lines[] = $bodyIndentation.'?ClassMetadata $parent = null'; |
|
74 | + $lines[] = $indentation.')'; |
|
75 | + $lines[] = $indentation.'{'; |
|
76 | + $lines[] = $bodyIndentation.'parent::__construct("'.$metadata->getClassName().'", $parent);'; |
|
77 | 77 | |
78 | 78 | if ($metadata->getCustomRepositoryClassName()) { |
79 | 79 | $lines[] = null; |
80 | - $lines[] = $objectReference . '->setCustomRepositoryClassName("' . $metadata->getCustomRepositoryClassName() . '");'; |
|
80 | + $lines[] = $objectReference.'->setCustomRepositoryClassName("'.$metadata->getCustomRepositoryClassName().'");'; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if ($metadata->changeTrackingPolicy) { |
84 | 84 | $lines[] = null; |
85 | - $lines[] = $objectReference . '->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . strtoupper($metadata->changeTrackingPolicy) . ');'; |
|
85 | + $lines[] = $objectReference.'->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.strtoupper($metadata->changeTrackingPolicy).');'; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | $lines[] = $this->exportInheritance($metadata, $indentationLevel); |
89 | 89 | $lines[] = $this->exportTable($metadata, $indentationLevel); |
90 | 90 | $lines[] = $this->exportProperties($metadata, $indentationLevel); |
91 | 91 | $lines[] = $this->exportLifecycleCallbacks($metadata, $indentationLevel); |
92 | - $lines[] = $indentation . '}'; |
|
92 | + $lines[] = $indentation.'}'; |
|
93 | 93 | |
94 | 94 | return implode(PHP_EOL, $lines); |
95 | 95 | } |
@@ -97,17 +97,17 @@ discard block |
||
97 | 97 | private function exportInheritance(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
98 | 98 | { |
99 | 99 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
100 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
100 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
101 | 101 | $lines = []; |
102 | 102 | |
103 | 103 | if ($metadata->inheritanceType) { |
104 | 104 | $lines[] = null; |
105 | - $lines[] = $objectReference . '->setInheritanceType(Mapping\InheritanceType::' . strtoupper($metadata->inheritanceType) . ');'; |
|
105 | + $lines[] = $objectReference.'->setInheritanceType(Mapping\InheritanceType::'.strtoupper($metadata->inheritanceType).');'; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if ($metadata->discriminatorColumn) { |
109 | 109 | $lines[] = null; |
110 | - $lines[] = $bodyIndentation . '// Discriminator mapping'; |
|
110 | + $lines[] = $bodyIndentation.'// Discriminator mapping'; |
|
111 | 111 | $lines[] = $this->exportDiscriminatorMetadata($metadata, $indentationLevel + 1); |
112 | 112 | } |
113 | 113 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | if ($metadata->table) { |
123 | 123 | $lines[] = null; |
124 | - $lines[] = $bodyIndentation . '// Table'; |
|
124 | + $lines[] = $bodyIndentation.'// Table'; |
|
125 | 125 | $lines[] = $this->exportTableMetadata($metadata->table, $indentationLevel + 1); |
126 | 126 | } |
127 | 127 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
137 | 137 | $lines[] = null; |
138 | - $lines[] = $bodyIndentation . '// Property: ' . $name; |
|
138 | + $lines[] = $bodyIndentation.'// Property: '.$name; |
|
139 | 139 | $lines[] = $this->exportProperty($property, $indentationLevel + 1); |
140 | 140 | } |
141 | 141 | |
@@ -145,16 +145,16 @@ discard block |
||
145 | 145 | private function exportLifecycleCallbacks(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
146 | 146 | { |
147 | 147 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
148 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
148 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
149 | 149 | $lines = []; |
150 | 150 | |
151 | 151 | if ($metadata->lifecycleCallbacks) { |
152 | 152 | $lines[] = null; |
153 | - $lines[] = $bodyIndentation . '// Lifecycle callbacks'; |
|
153 | + $lines[] = $bodyIndentation.'// Lifecycle callbacks'; |
|
154 | 154 | |
155 | 155 | foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { |
156 | 156 | foreach ($callbacks as $callback) { |
157 | - $lines[] = $objectReference . '->addLifecycleCallback("' . $callback . '", "' . $event . '");'; |
|
157 | + $lines[] = $objectReference.'->addLifecycleCallback("'.$callback.'", "'.$event.'");'; |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |
@@ -167,17 +167,17 @@ discard block |
||
167 | 167 | $variableExporter = new VariableExporter(); |
168 | 168 | $discriminatorExporter = new DiscriminatorColumnMetadataExporter(); |
169 | 169 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
170 | - $objectReference = $indentation . static::VARIABLE; |
|
170 | + $objectReference = $indentation.static::VARIABLE; |
|
171 | 171 | $lines = []; |
172 | 172 | |
173 | 173 | $lines[] = $discriminatorExporter->export($metadata->discriminatorColumn, $indentationLevel); |
174 | 174 | $lines[] = null; |
175 | - $lines[] = $objectReference . '->setDiscriminatorColumn(' . $discriminatorExporter::VARIABLE . ');'; |
|
175 | + $lines[] = $objectReference.'->setDiscriminatorColumn('.$discriminatorExporter::VARIABLE.');'; |
|
176 | 176 | |
177 | 177 | if ($metadata->discriminatorMap) { |
178 | 178 | $discriminatorMap = $variableExporter->export($metadata->discriminatorMap, $indentationLevel + 1); |
179 | 179 | |
180 | - $lines[] = $objectReference . '->setDiscriminatorMap(' . $discriminatorMap . ');'; |
|
180 | + $lines[] = $objectReference.'->setDiscriminatorMap('.$discriminatorMap.');'; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | return implode(PHP_EOL, $lines); |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | { |
188 | 188 | $tableExporter = new TableMetadataExporter(); |
189 | 189 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
190 | - $objectReference = $indentation . static::VARIABLE; |
|
190 | + $objectReference = $indentation.static::VARIABLE; |
|
191 | 191 | $lines = []; |
192 | 192 | |
193 | 193 | $lines[] = $tableExporter->export($table, $indentationLevel); |
194 | 194 | $lines[] = null; |
195 | - $lines[] = $objectReference . '->setTable(' . $tableExporter::VARIABLE . ');'; |
|
195 | + $lines[] = $objectReference.'->setTable('.$tableExporter::VARIABLE.');'; |
|
196 | 196 | |
197 | 197 | return implode(PHP_EOL, $lines); |
198 | 198 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | private function exportProperty(Mapping\Property $property, int $indentationLevel) : string |
201 | 201 | { |
202 | 202 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
203 | - $objectReference = $indentation . static::VARIABLE; |
|
203 | + $objectReference = $indentation.static::VARIABLE; |
|
204 | 204 | $lines = []; |
205 | 205 | |
206 | 206 | switch (true) { |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | $lines[] = $propertyExporter->export($property, $indentationLevel); |
237 | 237 | $lines[] = null; |
238 | - $lines[] = $objectReference . '->addProperty(' . $propertyExporter::VARIABLE . ');'; |
|
238 | + $lines[] = $objectReference.'->addProperty('.$propertyExporter::VARIABLE.');'; |
|
239 | 239 | |
240 | 240 | return implode(PHP_EOL, $lines); |
241 | 241 | } |
@@ -23,13 +23,13 @@ |
||
23 | 23 | { |
24 | 24 | /** @var JoinColumnMetadata $value */ |
25 | 25 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
26 | - $objectReference = $indentation . static::VARIABLE; |
|
26 | + $objectReference = $indentation.static::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 | } |