@@ -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 |
@@ -18,7 +18,7 @@ discard block |
||
| 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\Exporter; |
| 24 | 24 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $lines[] = null; |
| 44 | 44 | |
| 45 | 45 | if ($namespace) { |
| 46 | - $lines[] = 'namespace ' . $namespace . ';'; |
|
| 46 | + $lines[] = 'namespace '.$namespace.';'; |
|
| 47 | 47 | $lines[] = null; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -91,31 +91,31 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 93 | 93 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
| 94 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
| 94 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
| 95 | 95 | $lines = []; |
| 96 | 96 | |
| 97 | - $lines[] = $indentation . 'public function __construct('; |
|
| 98 | - $lines[] = $bodyIndentation . 'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
| 99 | - $lines[] = $bodyIndentation . '?ClassMetadata $parent = null'; |
|
| 100 | - $lines[] = $indentation . ')'; |
|
| 101 | - $lines[] = $indentation . '{'; |
|
| 102 | - $lines[] = $bodyIndentation . 'parent::__construct("' . $metadata->getClassName() . '", $parent);'; |
|
| 97 | + $lines[] = $indentation.'public function __construct('; |
|
| 98 | + $lines[] = $bodyIndentation.'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
| 99 | + $lines[] = $bodyIndentation.'?ClassMetadata $parent = null'; |
|
| 100 | + $lines[] = $indentation.')'; |
|
| 101 | + $lines[] = $indentation.'{'; |
|
| 102 | + $lines[] = $bodyIndentation.'parent::__construct("'.$metadata->getClassName().'", $parent);'; |
|
| 103 | 103 | |
| 104 | 104 | if ($metadata->getCustomRepositoryClassName()) { |
| 105 | 105 | $lines[] = null; |
| 106 | - $lines[] = $objectReference . '->setCustomRepositoryClassName("' . $metadata->getCustomRepositoryClassName() . '");'; |
|
| 106 | + $lines[] = $objectReference.'->setCustomRepositoryClassName("'.$metadata->getCustomRepositoryClassName().'");'; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | if ($metadata->changeTrackingPolicy) { |
| 110 | 110 | $lines[] = null; |
| 111 | - $lines[] = $objectReference . '->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . strtoupper($metadata->changeTrackingPolicy) . ');'; |
|
| 111 | + $lines[] = $objectReference.'->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.strtoupper($metadata->changeTrackingPolicy).');'; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $lines[] = $this->exportInheritance($metadata, $indentationLevel); |
| 115 | 115 | $lines[] = $this->exportTable($metadata, $indentationLevel); |
| 116 | 116 | $lines[] = $this->exportProperties($metadata, $indentationLevel); |
| 117 | 117 | $lines[] = $this->exportLifecycleCallbacks($metadata, $indentationLevel); |
| 118 | - $lines[] = $indentation . '}'; |
|
| 118 | + $lines[] = $indentation.'}'; |
|
| 119 | 119 | |
| 120 | 120 | return implode(PHP_EOL, $lines); |
| 121 | 121 | } |
@@ -129,17 +129,17 @@ discard block |
||
| 129 | 129 | private function exportInheritance(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
| 130 | 130 | { |
| 131 | 131 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
| 132 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
| 132 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
| 133 | 133 | $lines = []; |
| 134 | 134 | |
| 135 | 135 | if ($metadata->inheritanceType) { |
| 136 | 136 | $lines[] = null; |
| 137 | - $lines[] = $objectReference . '->setInheritanceType(Mapping\InheritanceType::' . strtoupper($metadata->inheritanceType) . ');'; |
|
| 137 | + $lines[] = $objectReference.'->setInheritanceType(Mapping\InheritanceType::'.strtoupper($metadata->inheritanceType).');'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if ($metadata->discriminatorColumn) { |
| 141 | 141 | $lines[] = null; |
| 142 | - $lines[] = $bodyIndentation . '// Discriminator mapping'; |
|
| 142 | + $lines[] = $bodyIndentation.'// Discriminator mapping'; |
|
| 143 | 143 | $lines[] = $this->exportDiscriminatorMetadata($metadata, $indentationLevel + 1); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | if ($metadata->table) { |
| 161 | 161 | $lines[] = null; |
| 162 | - $lines[] = $bodyIndentation . '// Table'; |
|
| 162 | + $lines[] = $bodyIndentation.'// Table'; |
|
| 163 | 163 | $lines[] = $this->exportTableMetadata($metadata->table, $indentationLevel + 1); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | foreach ($metadata->getProperties() as $name => $property) { |
| 181 | 181 | $lines[] = null; |
| 182 | - $lines[] = $bodyIndentation . '// Property: ' . $name; |
|
| 182 | + $lines[] = $bodyIndentation.'// Property: '.$name; |
|
| 183 | 183 | $lines[] = $this->exportProperty($property, $indentationLevel + 1); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -195,16 +195,16 @@ discard block |
||
| 195 | 195 | private function exportLifecycleCallbacks(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
| 196 | 196 | { |
| 197 | 197 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
| 198 | - $objectReference = $bodyIndentation . static::VARIABLE; |
|
| 198 | + $objectReference = $bodyIndentation.static::VARIABLE; |
|
| 199 | 199 | $lines = []; |
| 200 | 200 | |
| 201 | 201 | if ($metadata->lifecycleCallbacks) { |
| 202 | 202 | $lines[] = null; |
| 203 | - $lines[] = $bodyIndentation . '// Lifecycle callbacks'; |
|
| 203 | + $lines[] = $bodyIndentation.'// Lifecycle callbacks'; |
|
| 204 | 204 | |
| 205 | 205 | foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { |
| 206 | 206 | foreach ($callbacks as $callback) { |
| 207 | - $lines[] = $objectReference . '->addLifecycleCallback("' . $callback . '", "' . $event . '");'; |
|
| 207 | + $lines[] = $objectReference.'->addLifecycleCallback("'.$callback.'", "'.$event.'");'; |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | } |
@@ -223,17 +223,17 @@ discard block |
||
| 223 | 223 | $variableExporter = new VariableExporter(); |
| 224 | 224 | $discriminatorExporter = new DiscriminatorColumnMetadataExporter(); |
| 225 | 225 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 226 | - $objectReference = $indentation . static::VARIABLE; |
|
| 226 | + $objectReference = $indentation.static::VARIABLE; |
|
| 227 | 227 | $lines = []; |
| 228 | 228 | |
| 229 | 229 | $lines[] = $discriminatorExporter->export($metadata->discriminatorColumn, $indentationLevel); |
| 230 | 230 | $lines[] = null; |
| 231 | - $lines[] = $objectReference . '->setDiscriminatorColumn(' . $discriminatorExporter::VARIABLE . ');'; |
|
| 231 | + $lines[] = $objectReference.'->setDiscriminatorColumn('.$discriminatorExporter::VARIABLE.');'; |
|
| 232 | 232 | |
| 233 | 233 | if ($metadata->discriminatorMap) { |
| 234 | 234 | $discriminatorMap = $variableExporter->export($metadata->discriminatorMap, $indentationLevel + 1); |
| 235 | 235 | |
| 236 | - $lines[] = $objectReference . '->setDiscriminatorMap(' . $discriminatorMap . ');'; |
|
| 236 | + $lines[] = $objectReference.'->setDiscriminatorMap('.$discriminatorMap.');'; |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | return implode(PHP_EOL, $lines); |
@@ -249,12 +249,12 @@ discard block |
||
| 249 | 249 | { |
| 250 | 250 | $tableExporter = new TableMetadataExporter(); |
| 251 | 251 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 252 | - $objectReference = $indentation . static::VARIABLE; |
|
| 252 | + $objectReference = $indentation.static::VARIABLE; |
|
| 253 | 253 | $lines = []; |
| 254 | 254 | |
| 255 | 255 | $lines[] = $tableExporter->export($table, $indentationLevel); |
| 256 | 256 | $lines[] = null; |
| 257 | - $lines[] = $objectReference . '->setTable(' . $tableExporter::VARIABLE . ');'; |
|
| 257 | + $lines[] = $objectReference.'->setTable('.$tableExporter::VARIABLE.');'; |
|
| 258 | 258 | |
| 259 | 259 | return implode(PHP_EOL, $lines); |
| 260 | 260 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | private function exportProperty(Mapping\Property $property, int $indentationLevel) : string |
| 269 | 269 | { |
| 270 | 270 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 271 | - $objectReference = $indentation . static::VARIABLE; |
|
| 271 | + $objectReference = $indentation.static::VARIABLE; |
|
| 272 | 272 | $lines = []; |
| 273 | 273 | |
| 274 | 274 | switch (true) { |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | $lines[] = $propertyExporter->export($property, $indentationLevel); |
| 305 | 305 | $lines[] = null; |
| 306 | - $lines[] = $objectReference . '->addProperty(' . $propertyExporter::VARIABLE . ');'; |
|
| 306 | + $lines[] = $objectReference.'->addProperty('.$propertyExporter::VARIABLE.');'; |
|
| 307 | 307 | |
| 308 | 308 | return implode(PHP_EOL, $lines); |
| 309 | 309 | } |
@@ -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\Factory; |
| 24 | 24 | |
@@ -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\Factory; |
| 24 | 24 | |