@@ -1,42 +1,42 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Mapping\Exporter; |
| 6 | 6 | |
| 7 | 7 | class VariableExporter implements Exporter |
| 8 | 8 | { |
| 9 | - public const INDENTATION = ' '; |
|
| 9 | + public const INDENTATION = ' '; |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * {@inheritdoc} |
| 13 | 13 | */ |
| 14 | 14 | public function export($value, int $indentationLevel = 0) : string |
| 15 | 15 | { |
| 16 | - if (! is_array($value)) { |
|
| 16 | + if ( ! is_array($value)) { |
|
| 17 | 17 | return var_export($value, true); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 21 | - $longestKey = array_reduce(array_keys($value), function ($k, $v) { |
|
| 21 | + $longestKey = array_reduce(array_keys($value), function($k, $v) { |
|
| 22 | 22 | return (string) (strlen((string) $k) > strlen((string) $v) ? $k : $v); |
| 23 | 23 | }); |
| 24 | 24 | $maxKeyLength = strlen($longestKey) + (is_numeric($longestKey) ? 0 : 2); |
| 25 | 25 | |
| 26 | 26 | $lines = []; |
| 27 | 27 | |
| 28 | - $lines[] = $indentation . '['; |
|
| 28 | + $lines[] = $indentation.'['; |
|
| 29 | 29 | |
| 30 | 30 | foreach ($value as $entryKey => $entryValue) { |
| 31 | 31 | $lines[] = sprintf( |
| 32 | 32 | '%s%s => %s,', |
| 33 | - $indentation . self::INDENTATION, |
|
| 33 | + $indentation.self::INDENTATION, |
|
| 34 | 34 | str_pad(var_export($entryKey, true), $maxKeyLength), |
| 35 | 35 | ltrim($this->export($entryValue, $indentationLevel + 1)) |
| 36 | 36 | ); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $lines[] = $indentation . ']'; |
|
| 39 | + $lines[] = $indentation.']'; |
|
| 40 | 40 | |
| 41 | 41 | return implode(PHP_EOL, $lines); |
| 42 | 42 | } |
@@ -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\Exporter; |
| 6 | 6 | |
@@ -15,18 +15,18 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | /** @var LocalColumnMetadata $value */ |
| 17 | 17 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 18 | - $objectReference = $indentation . static::VARIABLE; |
|
| 18 | + $objectReference = $indentation.static::VARIABLE; |
|
| 19 | 19 | $lines = []; |
| 20 | 20 | |
| 21 | 21 | $lines[] = parent::export($value, $indentationLevel); |
| 22 | 22 | |
| 23 | - $lines[] = $objectReference . '->setLength(' . $value->getLength() . ');'; |
|
| 24 | - $lines[] = $objectReference . '->setScale(' . $value->getScale() . ');'; |
|
| 25 | - $lines[] = $objectReference . '->setPrecision(' . $value->getPrecision() . ');'; |
|
| 23 | + $lines[] = $objectReference.'->setLength('.$value->getLength().');'; |
|
| 24 | + $lines[] = $objectReference.'->setScale('.$value->getScale().');'; |
|
| 25 | + $lines[] = $objectReference.'->setPrecision('.$value->getPrecision().');'; |
|
| 26 | 26 | |
| 27 | 27 | if ($value->hasValueGenerator()) { |
| 28 | 28 | $lines[] = sprintf( |
| 29 | - $objectReference . '->setValueGenerator(new ValueGenerator(%s, %s));', |
|
| 29 | + $objectReference.'->setValueGenerator(new ValueGenerator(%s, %s));', |
|
| 30 | 30 | var_export($value->getValueGenerator()->getType(), true), |
| 31 | 31 | var_export($value->getValueGenerator()->getDefinition(), true) |
| 32 | 32 | ); |
@@ -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\Exporter; |
| 6 | 6 | |
@@ -18,20 +18,20 @@ discard block |
||
| 18 | 18 | /** @var ColumnMetadata $value */ |
| 19 | 19 | $variableExporter = new VariableExporter(); |
| 20 | 20 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 21 | - $objectReference = $indentation . static::VARIABLE; |
|
| 21 | + $objectReference = $indentation.static::VARIABLE; |
|
| 22 | 22 | $lines = []; |
| 23 | 23 | |
| 24 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
| 24 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
| 25 | 25 | |
| 26 | - if (! empty($value->getColumnDefinition())) { |
|
| 27 | - $lines[] = $objectReference . '->setColumnDefinition("' . $value->getColumnDefinition() . '");'; |
|
| 26 | + if ( ! empty($value->getColumnDefinition())) { |
|
| 27 | + $lines[] = $objectReference.'->setColumnDefinition("'.$value->getColumnDefinition().'");'; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - $lines[] = $objectReference . '->setTableName("' . $value->getTableName() . '");'; |
|
| 31 | - $lines[] = $objectReference . '->setOptions(' . ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)) . ');'; |
|
| 32 | - $lines[] = $objectReference . '->setPrimaryKey(' . ltrim($variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1)) . ');'; |
|
| 33 | - $lines[] = $objectReference . '->setNullable(' . ltrim($variableExporter->export($value->isNullable(), $indentationLevel + 1)) . ');'; |
|
| 34 | - $lines[] = $objectReference . '->setUnique(' . ltrim($variableExporter->export($value->isUnique(), $indentationLevel + 1)) . ');'; |
|
| 30 | + $lines[] = $objectReference.'->setTableName("'.$value->getTableName().'");'; |
|
| 31 | + $lines[] = $objectReference.'->setOptions('.ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)).');'; |
|
| 32 | + $lines[] = $objectReference.'->setPrimaryKey('.ltrim($variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1)).');'; |
|
| 33 | + $lines[] = $objectReference.'->setNullable('.ltrim($variableExporter->export($value->isNullable(), $indentationLevel + 1)).');'; |
|
| 34 | + $lines[] = $objectReference.'->setUnique('.ltrim($variableExporter->export($value->isUnique(), $indentationLevel + 1)).');'; |
|
| 35 | 35 | |
| 36 | 36 | return implode(PHP_EOL, $lines); |
| 37 | 37 | } |
@@ -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\Exporter; |
| 6 | 6 | |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | /** @var TransientMetadata $value */ |
| 19 | 19 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 20 | - $objectReference = $indentation . static::VARIABLE; |
|
| 20 | + $objectReference = $indentation.static::VARIABLE; |
|
| 21 | 21 | |
| 22 | - return $objectReference . ' = ' . $this->exportInstantiation($value); |
|
| 22 | + return $objectReference.' = '.$this->exportInstantiation($value); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | protected function exportInstantiation(TransientMetadata $metadata) : string |
@@ -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 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | string $className, |
| 81 | 81 | ClassMetadataBuildingContext $metadataBuildingContext |
| 82 | 82 | ) : ?ClassMetadata { |
| 83 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 83 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -141,20 +141,20 @@ discard block |
||
| 141 | 141 | $classMetadata->setCache(clone $parent->getCache()); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if (! empty($parent->namedNativeQueries)) { |
|
| 144 | + if ( ! empty($parent->namedNativeQueries)) { |
|
| 145 | 145 | $this->addInheritedNamedNativeQueries($classMetadata, $parent); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - if (! empty($parent->sqlResultSetMappings)) { |
|
| 148 | + if ( ! empty($parent->sqlResultSetMappings)) { |
|
| 149 | 149 | $this->addInheritedSqlResultSetMappings($classMetadata, $parent); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 152 | + if ( ! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 153 | 153 | $classMetadata->entityListeners = $parent->entityListeners; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 157 | + if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 158 | 158 | $this->addDefaultDiscriminatorMap($classMetadata); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | protected function completeRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 176 | 176 | { |
| 177 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
| 177 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
| 178 | 178 | return; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | continue; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
| 195 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
| 196 | 196 | continue; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 213 | 213 | { |
| 214 | - if (! $class->getReflectionClass()) { |
|
| 214 | + if ( ! $class->getReflectionClass()) { |
|
| 215 | 215 | // only validate if there is a reflection class instance |
| 216 | 216 | return; |
| 217 | 217 | } |
@@ -221,13 +221,13 @@ discard block |
||
| 221 | 221 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
| 222 | 222 | |
| 223 | 223 | // verify inheritance |
| 224 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 225 | - if (! $parent) { |
|
| 226 | - if (! $class->discriminatorMap) { |
|
| 224 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 225 | + if ( ! $parent) { |
|
| 226 | + if ( ! $class->discriminatorMap) { |
|
| 227 | 227 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - if (! $class->discriminatorColumn) { |
|
| 230 | + if ( ! $class->discriminatorColumn) { |
|
| 231 | 231 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
| 232 | 232 | } |
| 233 | 233 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | private function completeIdentifierGeneratorMappings(ClassMetadata $class) : void |
| 438 | 438 | { |
| 439 | 439 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 440 | - if (! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 440 | + if ( ! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 441 | 441 | continue; |
| 442 | 442 | } |
| 443 | 443 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | |
| 448 | 448 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
| 449 | 449 | { |
| 450 | - if (! $field->hasValueGenerator()) { |
|
| 450 | + if ( ! $field->hasValueGenerator()) { |
|
| 451 | 451 | return; |
| 452 | 452 | } |
| 453 | 453 | |
@@ -499,10 +499,10 @@ discard block |
||
| 499 | 499 | |
| 500 | 500 | case GeneratorType::CUSTOM: |
| 501 | 501 | $definition = $generator->getDefinition(); |
| 502 | - if (! isset($definition['class'])) { |
|
| 502 | + if ( ! isset($definition['class'])) { |
|
| 503 | 503 | throw new ORMException(sprintf('Cannot instantiate custom generator, no class has been defined')); |
| 504 | 504 | } |
| 505 | - if (! class_exists($definition['class'])) { |
|
| 505 | + if ( ! class_exists($definition['class'])) { |
|
| 506 | 506 | throw new ORMException(sprintf('Cannot instantiate custom generator : %s', var_export($definition, true))); //$definition['class'])); |
| 507 | 507 | } |
| 508 | 508 | |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | break; |
| 515 | 515 | |
| 516 | 516 | default: |
| 517 | - throw new ORMException('Unknown generator type: ' . $generator->getType()); |
|
| 517 | + throw new ORMException('Unknown generator type: '.$generator->getType()); |
|
| 518 | 518 | } |
| 519 | 519 | } |
| 520 | 520 | |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | */ |
| 524 | 524 | protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) : string |
| 525 | 525 | { |
| 526 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 526 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | /** |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | |
| 545 | 545 | private function getTargetPlatform() : Platforms\AbstractPlatform |
| 546 | 546 | { |
| 547 | - if (! $this->targetPlatform) { |
|
| 547 | + if ( ! $this->targetPlatform) { |
|
| 548 | 548 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 549 | 549 | } |
| 550 | 550 | |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $generatedProperties = []; |
| 558 | 558 | |
| 559 | 559 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 560 | - if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
| 560 | + if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
| 561 | 561 | continue; |
| 562 | 562 | } |
| 563 | 563 | |
@@ -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 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function getQuotedQualifiedName(AbstractPlatform $platform) : string |
| 61 | 61 | { |
| 62 | - if (! $this->schema) { |
|
| 62 | + if ( ! $this->schema) { |
|
| 63 | 63 | return $platform->quoteIdentifier($this->name); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function addIndex(array $index) : void |
| 133 | 133 | { |
| 134 | - if (! isset($index['name'])) { |
|
| 134 | + if ( ! isset($index['name'])) { |
|
| 135 | 135 | $this->indexes[] = $index; |
| 136 | 136 | |
| 137 | 137 | return; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function addUniqueConstraint(array $constraint) : void |
| 168 | 168 | { |
| 169 | - if (! isset($constraint['name'])) { |
|
| 169 | + if ( ! isset($constraint['name'])) { |
|
| 170 | 170 | $this->uniqueConstraints[] = $constraint; |
| 171 | 171 | |
| 172 | 172 | return; |
@@ -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\Factory; |
| 6 | 6 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function getReflectionService() : StaticReflectionService |
| 19 | 19 | { |
| 20 | - if (! $this->reflectionService) { |
|
| 20 | + if ( ! $this->reflectionService) { |
|
| 21 | 21 | $this->reflectionService = new StaticReflectionService(); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -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\Factory; |
| 6 | 6 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function getReflectionService() : RuntimeReflectionService |
| 19 | 19 | { |
| 20 | - if (! $this->reflectionService) { |
|
| 20 | + if ( ! $this->reflectionService) { |
|
| 21 | 21 | $this->reflectionService = new RuntimeReflectionService(); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -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\Factory\Strategy; |
| 6 | 6 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function generate(string $filePath, ClassMetadataDefinition $definition) : void |
| 15 | 15 | { |
| 16 | - if (! file_exists($filePath)) { |
|
| 16 | + if ( ! file_exists($filePath)) { |
|
| 17 | 17 | parent::generate($filePath, $definition); |
| 18 | 18 | |
| 19 | 19 | return; |