@@ -220,7 +220,7 @@ |
||
220 | 220 | $exporter->setMetadata($metadata); |
221 | 221 | $exporter->export(); |
222 | 222 | |
223 | - $output->writeln(PHP_EOL . sprintf( |
|
223 | + $output->writeln(PHP_EOL.sprintf( |
|
224 | 224 | 'Converting Doctrine 1.X schema to "<info>%s</info>" mapping type in "<info>%s</info>"', $toType, $destPath |
225 | 225 | )); |
226 | 226 | } else { |
@@ -100,15 +100,15 @@ |
||
100 | 100 | protected function configure() |
101 | 101 | { |
102 | 102 | $this->setName('orm:convert-d1-schema') |
103 | - ->setAliases(['orm:convert:d1-schema']) |
|
104 | - ->setDescription('Converts Doctrine 1.x schema into a Doctrine 2.x schema') |
|
105 | - ->addArgument('from-path', InputArgument::REQUIRED, 'The path of Doctrine 1.X schema information.') |
|
106 | - ->addArgument('to-type', InputArgument::REQUIRED, 'The destination Doctrine 2.X mapping type.') |
|
107 | - ->addArgument('dest-path', InputArgument::REQUIRED, 'The path to generate your Doctrine 2.X mapping information.') |
|
108 | - ->addOption('from', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Optional paths of Doctrine 1.X schema information.', []) |
|
109 | - ->addOption('extend', null, InputOption::VALUE_OPTIONAL, 'Defines a base class to be extended by generated entity classes.') |
|
110 | - ->addOption('num-spaces', null, InputOption::VALUE_OPTIONAL, 'Defines the number of indentation spaces', 4) |
|
111 | - ->setHelp('Converts Doctrine 1.x schema into a Doctrine 2.x schema.'); |
|
103 | + ->setAliases(['orm:convert:d1-schema']) |
|
104 | + ->setDescription('Converts Doctrine 1.x schema into a Doctrine 2.x schema') |
|
105 | + ->addArgument('from-path', InputArgument::REQUIRED, 'The path of Doctrine 1.X schema information.') |
|
106 | + ->addArgument('to-type', InputArgument::REQUIRED, 'The destination Doctrine 2.X mapping type.') |
|
107 | + ->addArgument('dest-path', InputArgument::REQUIRED, 'The path to generate your Doctrine 2.X mapping information.') |
|
108 | + ->addOption('from', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Optional paths of Doctrine 1.X schema information.', []) |
|
109 | + ->addOption('extend', null, InputOption::VALUE_OPTIONAL, 'Defines a base class to be extended by generated entity classes.') |
|
110 | + ->addOption('num-spaces', null, InputOption::VALUE_OPTIONAL, 'Defines the number of indentation spaces', 4) |
|
111 | + ->setHelp('Converts Doctrine 1.x schema into a Doctrine 2.x schema.'); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -1428,7 +1428,7 @@ |
||
1428 | 1428 | |
1429 | 1429 | if (Type::hasType($mapping['type']) && Type::getType($mapping['type'])->canRequireSQLConversion()) { |
1430 | 1430 | if (isset($mapping['id']) && true === $mapping['id']) { |
1431 | - throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); |
|
1431 | + throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); |
|
1432 | 1432 | } |
1433 | 1433 | |
1434 | 1434 | $mapping['requireSQLConversion'] = true; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | public function getSingleIdReflectionProperty() |
697 | 697 | { |
698 | 698 | if ($this->isIdentifierComposite) { |
699 | - throw new BadMethodCallException("Class " . $this->name . " has a composite identifier."); |
|
699 | + throw new BadMethodCallException("Class ".$this->name." has a composite identifier."); |
|
700 | 700 | } |
701 | 701 | |
702 | 702 | return $this->reflFields[$this->identifier[0]]; |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | */ |
792 | 792 | public function __toString() |
793 | 793 | { |
794 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
794 | + return __CLASS__.'@'.spl_object_hash($this); |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | /** |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | public function validateAssociations() |
1026 | 1026 | { |
1027 | 1027 | foreach ($this->associationMappings as $mapping) { |
1028 | - if ( ! ClassLoader::classExists($mapping['targetEntity']) ) { |
|
1028 | + if ( ! ClassLoader::classExists($mapping['targetEntity'])) { |
|
1029 | 1029 | throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']); |
1030 | 1030 | } |
1031 | 1031 | } |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | } |
1104 | 1104 | |
1105 | 1105 | if ( ! isset($cache['region'])) { |
1106 | - $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName; |
|
1106 | + $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName; |
|
1107 | 1107 | } |
1108 | 1108 | |
1109 | 1109 | return $cache; |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | protected function _validateAndCompleteFieldMapping(array &$mapping) |
1384 | 1384 | { |
1385 | 1385 | // Check mandatory fields |
1386 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
1386 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
1387 | 1387 | throw MappingException::missingFieldName($this->name); |
1388 | 1388 | } |
1389 | 1389 | |
@@ -1496,14 +1496,14 @@ discard block |
||
1496 | 1496 | $this->isIdentifierComposite = true; |
1497 | 1497 | } |
1498 | 1498 | |
1499 | - if ($this->cache && !isset($mapping['cache'])) { |
|
1499 | + if ($this->cache && ! isset($mapping['cache'])) { |
|
1500 | 1500 | throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']); |
1501 | 1501 | } |
1502 | 1502 | } |
1503 | 1503 | |
1504 | 1504 | // Mandatory attributes for both sides |
1505 | 1505 | // Mandatory: fieldName, targetEntity |
1506 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
1506 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
1507 | 1507 | throw MappingException::missingFieldName($this->name); |
1508 | 1508 | } |
1509 | 1509 | |
@@ -1625,7 +1625,7 @@ discard block |
||
1625 | 1625 | throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship."); |
1626 | 1626 | } |
1627 | 1627 | |
1628 | - $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = [ |
|
1628 | + $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = [ |
|
1629 | 1629 | 'columns' => $uniqueConstraintColumns |
1630 | 1630 | ]; |
1631 | 1631 | } |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | unset($mapping['unique']); |
1641 | 1641 | } |
1642 | 1642 | |
1643 | - if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { |
|
1643 | + if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) { |
|
1644 | 1644 | throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']); |
1645 | 1645 | } |
1646 | 1646 | |
@@ -1694,7 +1694,7 @@ discard block |
||
1694 | 1694 | } |
1695 | 1695 | |
1696 | 1696 | $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity'] |
1697 | - && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
1697 | + && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
1698 | 1698 | |
1699 | 1699 | if ( ! isset($mapping['joinTable']['joinColumns'])) { |
1700 | 1700 | $mapping['joinTable']['joinColumns'] = [ |
@@ -1887,7 +1887,7 @@ discard block |
||
1887 | 1887 | |
1888 | 1888 | // Association defined as Id field |
1889 | 1889 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
1890 | - $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
1890 | + $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
1891 | 1891 | |
1892 | 1892 | $columnNames = array_merge($columnNames, $assocColumnNames); |
1893 | 1893 | } |
@@ -2068,7 +2068,7 @@ discard block |
||
2068 | 2068 | public function getTemporaryIdTableName() |
2069 | 2069 | { |
2070 | 2070 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
2071 | - return str_replace('.', '_', $this->getTableName() . '_id_tmp'); |
|
2071 | + return str_replace('.', '_', $this->getTableName().'_id_tmp'); |
|
2072 | 2072 | } |
2073 | 2073 | |
2074 | 2074 | /** |
@@ -2405,7 +2405,7 @@ discard block |
||
2405 | 2405 | */ |
2406 | 2406 | public function addNamedQuery(array $queryMapping) |
2407 | 2407 | { |
2408 | - if (!isset($queryMapping['name'])) { |
|
2408 | + if ( ! isset($queryMapping['name'])) { |
|
2409 | 2409 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
2410 | 2410 | } |
2411 | 2411 | |
@@ -2413,7 +2413,7 @@ discard block |
||
2413 | 2413 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
2414 | 2414 | } |
2415 | 2415 | |
2416 | - if (!isset($queryMapping['query'])) { |
|
2416 | + if ( ! isset($queryMapping['query'])) { |
|
2417 | 2417 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
2418 | 2418 | } |
2419 | 2419 | |
@@ -2440,7 +2440,7 @@ discard block |
||
2440 | 2440 | */ |
2441 | 2441 | public function addNamedNativeQuery(array $queryMapping) |
2442 | 2442 | { |
2443 | - if (!isset($queryMapping['name'])) { |
|
2443 | + if ( ! isset($queryMapping['name'])) { |
|
2444 | 2444 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
2445 | 2445 | } |
2446 | 2446 | |
@@ -2448,11 +2448,11 @@ discard block |
||
2448 | 2448 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
2449 | 2449 | } |
2450 | 2450 | |
2451 | - if (!isset($queryMapping['query'])) { |
|
2451 | + if ( ! isset($queryMapping['query'])) { |
|
2452 | 2452 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
2453 | 2453 | } |
2454 | 2454 | |
2455 | - if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) { |
|
2455 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
2456 | 2456 | throw MappingException::missingQueryMapping($this->name, $queryMapping['name']); |
2457 | 2457 | } |
2458 | 2458 | |
@@ -2484,7 +2484,7 @@ discard block |
||
2484 | 2484 | */ |
2485 | 2485 | public function addSqlResultSetMapping(array $resultMapping) |
2486 | 2486 | { |
2487 | - if (!isset($resultMapping['name'])) { |
|
2487 | + if ( ! isset($resultMapping['name'])) { |
|
2488 | 2488 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
2489 | 2489 | } |
2490 | 2490 | |
@@ -2494,7 +2494,7 @@ discard block |
||
2494 | 2494 | |
2495 | 2495 | if (isset($resultMapping['entities'])) { |
2496 | 2496 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
2497 | - if (!isset($entityResult['entityClass'])) { |
|
2497 | + if ( ! isset($entityResult['entityClass'])) { |
|
2498 | 2498 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
2499 | 2499 | } |
2500 | 2500 | |
@@ -2513,11 +2513,11 @@ discard block |
||
2513 | 2513 | |
2514 | 2514 | if (isset($entityResult['fields'])) { |
2515 | 2515 | foreach ($entityResult['fields'] as $k => $field) { |
2516 | - if (!isset($field['name'])) { |
|
2516 | + if ( ! isset($field['name'])) { |
|
2517 | 2517 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
2518 | 2518 | } |
2519 | 2519 | |
2520 | - if (!isset($field['column'])) { |
|
2520 | + if ( ! isset($field['column'])) { |
|
2521 | 2521 | $fieldName = $field['name']; |
2522 | 2522 | if (strpos($fieldName, '.')) { |
2523 | 2523 | list(, $fieldName) = explode('.', $fieldName); |
@@ -3008,7 +3008,7 @@ discard block |
||
3008 | 3008 | } |
3009 | 3009 | |
3010 | 3010 | if ($definition['sequenceName'][0] == '`') { |
3011 | - $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
3011 | + $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
3012 | 3012 | $definition['quoted'] = true; |
3013 | 3013 | } |
3014 | 3014 | |
@@ -3100,7 +3100,7 @@ discard block |
||
3100 | 3100 | public function getAssociationTargetClass($assocName) |
3101 | 3101 | { |
3102 | 3102 | if ( ! isset($this->associationMappings[$assocName])) { |
3103 | - throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); |
|
3103 | + throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association."); |
|
3104 | 3104 | } |
3105 | 3105 | |
3106 | 3106 | return $this->associationMappings[$assocName]['targetEntity']; |
@@ -3139,7 +3139,7 @@ discard block |
||
3139 | 3139 | // Association defined as Id field |
3140 | 3140 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
3141 | 3141 | $assocQuotedColumnNames = array_map( |
3142 | - function ($joinColumn) use ($platform) { |
|
3142 | + function($joinColumn) use ($platform) { |
|
3143 | 3143 | return isset($joinColumn['quoted']) |
3144 | 3144 | ? $platform->quoteIdentifier($joinColumn['name']) |
3145 | 3145 | : $joinColumn['name']; |
@@ -3250,7 +3250,7 @@ discard block |
||
3250 | 3250 | } |
3251 | 3251 | |
3252 | 3252 | if ($className !== null && strpos($className, '\\') === false && $this->namespace) { |
3253 | - return $this->namespace . '\\' . $className; |
|
3253 | + return $this->namespace.'\\'.$className; |
|
3254 | 3254 | } |
3255 | 3255 | |
3256 | 3256 | return $className; |
@@ -3302,13 +3302,13 @@ discard block |
||
3302 | 3302 | foreach ($embeddable->fieldMappings as $fieldMapping) { |
3303 | 3303 | $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name; |
3304 | 3304 | $fieldMapping['declaredField'] = isset($fieldMapping['declaredField']) |
3305 | - ? $property . '.' . $fieldMapping['declaredField'] |
|
3305 | + ? $property.'.'.$fieldMapping['declaredField'] |
|
3306 | 3306 | : $property; |
3307 | 3307 | $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName']; |
3308 | - $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName']; |
|
3308 | + $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName']; |
|
3309 | 3309 | |
3310 | - if (! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3311 | - $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']; |
|
3310 | + if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3311 | + $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName']; |
|
3312 | 3312 | } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) { |
3313 | 3313 | $fieldMapping['columnName'] = $this->namingStrategy |
3314 | 3314 | ->embeddedFieldToColumnName( |
@@ -3349,7 +3349,7 @@ discard block |
||
3349 | 3349 | { |
3350 | 3350 | $sequencePrefix = $this->getSequencePrefix($platform); |
3351 | 3351 | $columnName = $this->getSingleIdentifierColumnName(); |
3352 | - $sequenceName = $sequencePrefix . '_' . $columnName . '_seq'; |
|
3352 | + $sequenceName = $sequencePrefix.'_'.$columnName.'_seq'; |
|
3353 | 3353 | |
3354 | 3354 | return $sequenceName; |
3355 | 3355 | } |
@@ -3369,10 +3369,10 @@ discard block |
||
3369 | 3369 | |
3370 | 3370 | // Prepend the schema name to the table name if there is one |
3371 | 3371 | if ($schemaName = $this->getSchemaName()) { |
3372 | - $sequencePrefix = $schemaName . '.' . $tableName; |
|
3372 | + $sequencePrefix = $schemaName.'.'.$tableName; |
|
3373 | 3373 | |
3374 | 3374 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
3375 | - $sequencePrefix = $schemaName . '__' . $tableName; |
|
3375 | + $sequencePrefix = $schemaName.'__'.$tableName; |
|
3376 | 3376 | } |
3377 | 3377 | } |
3378 | 3378 | |
@@ -3384,8 +3384,8 @@ discard block |
||
3384 | 3384 | */ |
3385 | 3385 | private function assertMappingOrderBy(array $mapping) |
3386 | 3386 | { |
3387 | - if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) { |
|
3388 | - throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy'])); |
|
3387 | + if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) { |
|
3388 | + throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); |
|
3389 | 3389 | } |
3390 | 3390 | } |
3391 | 3391 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | // Evaluate named native queries |
110 | 110 | if (isset($element['namedNativeQueries'])) { |
111 | 111 | foreach ($element['namedNativeQueries'] as $name => $mappingElement) { |
112 | - if (!isset($mappingElement['name'])) { |
|
112 | + if ( ! isset($mappingElement['name'])) { |
|
113 | 113 | $mappingElement['name'] = $name; |
114 | 114 | } |
115 | 115 | $metadata->addNamedNativeQuery( |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | // Evaluate sql result set mappings |
127 | 127 | if (isset($element['sqlResultSetMappings'])) { |
128 | 128 | foreach ($element['sqlResultSetMappings'] as $name => $resultSetMapping) { |
129 | - if (!isset($resultSetMapping['name'])) { |
|
129 | + if ( ! isset($resultSetMapping['name'])) { |
|
130 | 130 | $resultSetMapping['name'] = $name; |
131 | 131 | } |
132 | 132 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | if (isset($element['inheritanceType'])) { |
176 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType']))); |
|
176 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.strtoupper($element['inheritanceType']))); |
|
177 | 177 | |
178 | 178 | if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) { |
179 | 179 | // Evaluate discriminatorColumn |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | } |
363 | 363 | |
364 | 364 | if (isset($oneToOneElement['fetch'])) { |
365 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToOneElement['fetch']); |
|
365 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToOneElement['fetch']); |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | if (isset($oneToOneElement['mappedBy'])) { |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | ]; |
417 | 417 | |
418 | 418 | if (isset($oneToManyElement['fetch'])) { |
419 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToManyElement['fetch']); |
|
419 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToManyElement['fetch']); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | if (isset($oneToManyElement['cascade'])) { |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | if (isset($manyToOneElement['fetch'])) { |
461 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToOneElement['fetch']); |
|
461 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToOneElement['fetch']); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | if (isset($manyToOneElement['inversedBy'])) { |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | ]; |
504 | 504 | |
505 | 505 | if (isset($manyToManyElement['fetch'])) { |
506 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToManyElement['fetch']); |
|
506 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToManyElement['fetch']); |
|
507 | 507 | } |
508 | 508 | |
509 | 509 | if (isset($manyToManyElement['mappedBy'])) { |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | if (isset($element['associationOverride']) && is_array($element['associationOverride'])) { |
574 | 574 | |
575 | 575 | foreach ($element['associationOverride'] as $fieldName => $associationOverrideElement) { |
576 | - $override = []; |
|
576 | + $override = []; |
|
577 | 577 | |
578 | 578 | // Check for joinColumn |
579 | 579 | if (isset($associationOverrideElement['joinColumn'])) { |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | if (isset($associationOverrideElement['joinTable'])) { |
592 | 592 | |
593 | 593 | $joinTableElement = $associationOverrideElement['joinTable']; |
594 | - $joinTable = [ |
|
594 | + $joinTable = [ |
|
595 | 595 | 'name' => $joinTableElement['name'] |
596 | 596 | ]; |
597 | 597 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | |
626 | 626 | // Check for `fetch` |
627 | 627 | if (isset($associationOverrideElement['fetch'])) { |
628 | - $override['fetch'] = constant(Metadata::class . '::FETCH_' . $associationOverrideElement['fetch']); |
|
628 | + $override['fetch'] = constant(Metadata::class.'::FETCH_'.$associationOverrideElement['fetch']); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | $metadata->setAssociationOverride($fieldName, $override); |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | if (isset($element['lifecycleCallbacks'])) { |
646 | 646 | foreach ($element['lifecycleCallbacks'] as $type => $methods) { |
647 | 647 | foreach ($methods as $method) { |
648 | - $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::' . $type)); |
|
648 | + $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::'.$type)); |
|
649 | 649 | } |
650 | 650 | } |
651 | 651 | } |
@@ -787,12 +787,12 @@ discard block |
||
787 | 787 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
788 | 788 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
789 | 789 | |
790 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
790 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
791 | 791 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
792 | 792 | } |
793 | 793 | |
794 | 794 | if ($usage) { |
795 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
795 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
796 | 796 | } |
797 | 797 | |
798 | 798 | return [ |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | $em = $this->createMock(EntityManagerInterface::class); |
61 | 61 | |
62 | 62 | $mappingDriver->method('getAllClassNames') |
63 | - ->willReturn([]); |
|
63 | + ->willReturn([]); |
|
64 | 64 | |
65 | 65 | $configuration->method('getMetadataDriverImpl') |
66 | - ->willReturn($mappingDriver); |
|
66 | + ->willReturn($mappingDriver); |
|
67 | 67 | |
68 | 68 | $em->method('getConfiguration') |
69 | - ->willReturn($configuration); |
|
69 | + ->willReturn($configuration); |
|
70 | 70 | |
71 | 71 | $application = new Application(); |
72 | 72 | $application->setHelperSet(new HelperSet(['em' => new EntityManagerHelper($em)])); |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | $em = $this->createMock(EntityManagerInterface::class); |
96 | 96 | |
97 | 97 | $mappingDriver->method('getAllClassNames') |
98 | - ->willReturn(['InvalidEntity']); |
|
98 | + ->willReturn(['InvalidEntity']); |
|
99 | 99 | |
100 | 100 | $configuration->method('getMetadataDriverImpl') |
101 | - ->willReturn($mappingDriver); |
|
101 | + ->willReturn($mappingDriver); |
|
102 | 102 | |
103 | 103 | $em->method('getConfiguration') |
104 | - ->willReturn($configuration); |
|
104 | + ->willReturn($configuration); |
|
105 | 105 | |
106 | 106 | $em->method('getClassMetadata') |
107 | - ->with('InvalidEntity') |
|
108 | - ->willThrowException(new MappingException('exception message')); |
|
107 | + ->with('InvalidEntity') |
|
108 | + ->willThrowException(new MappingException('exception message')); |
|
109 | 109 | |
110 | 110 | $application = new Application(); |
111 | 111 | $application->setHelperSet(new HelperSet(['em' => new EntityManagerHelper($em)])); |
@@ -143,16 +143,16 @@ |
||
143 | 143 | $em = $this->createMock(EntityManagerInterface::class); |
144 | 144 | |
145 | 145 | $configuration->method('getDefaultRepositoryClassName') |
146 | - ->willReturn('fooRepository'); |
|
146 | + ->willReturn('fooRepository'); |
|
147 | 147 | |
148 | 148 | $metadataFactory->method('getAllMetadata') |
149 | 149 | ->willReturn([]); |
150 | 150 | |
151 | 151 | $em->method('getMetadataFactory') |
152 | - ->willReturn($metadataFactory); |
|
152 | + ->willReturn($metadataFactory); |
|
153 | 153 | |
154 | 154 | $em->method('getConfiguration') |
155 | - ->willReturn($configuration); |
|
155 | + ->willReturn($configuration); |
|
156 | 156 | |
157 | 157 | $application = new Application(); |
158 | 158 | $application->setHelperSet(new HelperSet(['em' => new EntityManagerHelper($em)])); |
@@ -45,14 +45,14 @@ |
||
45 | 45 | protected function configure() |
46 | 46 | { |
47 | 47 | $this->setName('orm:run-dql') |
48 | - ->setDescription('Executes arbitrary DQL directly from the command line') |
|
49 | - ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
50 | - ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
51 | - ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
52 | - ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
53 | - ->addOption('depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of Entity graph.', 7) |
|
54 | - ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
55 | - ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
48 | + ->setDescription('Executes arbitrary DQL directly from the command line') |
|
49 | + ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
50 | + ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
51 | + ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
52 | + ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
53 | + ->addOption('depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of Entity graph.', 7) |
|
54 | + ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
55 | + ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | protected function configure() |
44 | 44 | { |
45 | 45 | $this->setName('orm:schema-tool:create') |
46 | - ->setDescription('Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output') |
|
47 | - ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.') |
|
48 | - ->setHelp(<<<EOT |
|
46 | + ->setDescription('Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output') |
|
47 | + ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.') |
|
48 | + ->setHelp(<<<EOT |
|
49 | 49 | Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output. |
50 | 50 | |
51 | 51 | <comment>Hint:</comment> If you have a database with tables that should not be managed |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | \$config->setFilterSchemaAssetsExpression(\$regexp); |
56 | 56 | EOT |
57 | - ); |
|
57 | + ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | protected function configure() |
44 | 44 | { |
45 | 45 | $this->setName('orm:schema-tool:drop') |
46 | - ->setDescription('Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output') |
|
47 | - ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.') |
|
48 | - ->addOption('force', 'f', InputOption::VALUE_NONE, "Don't ask for the deletion of the database, but force the operation to run.") |
|
49 | - ->addOption('full-database', null, InputOption::VALUE_NONE, 'Instead of using the Class Metadata to detect the database table schema, drop ALL assets that the database contains.') |
|
50 | - ->setHelp(<<<EOT |
|
46 | + ->setDescription('Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output') |
|
47 | + ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.') |
|
48 | + ->addOption('force', 'f', InputOption::VALUE_NONE, "Don't ask for the deletion of the database, but force the operation to run.") |
|
49 | + ->addOption('full-database', null, InputOption::VALUE_NONE, 'Instead of using the Class Metadata to detect the database table schema, drop ALL assets that the database contains.') |
|
50 | + ->setHelp(<<<EOT |
|
51 | 51 | Processes the schema and either drop the database schema of EntityManager Storage Connection or generate the SQL output. |
52 | 52 | Beware that the complete database is dropped by this command, even tables that are not relevant to your metadata model. |
53 | 53 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | \$config->setFilterSchemaAssetsExpression(\$regexp); |
59 | 59 | EOT |
60 | - ); |
|
60 | + ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | protected function configure() |
51 | 51 | { |
52 | 52 | $this->setName($this->name) |
53 | - ->setDescription('Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata') |
|
54 | - ->addOption('complete', null, InputOption::VALUE_NONE, 'If defined, all assets of the database which are not relevant to the current metadata will be dropped.') |
|
55 | - ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Dumps the generated SQL statements to the screen (does not execute them).') |
|
56 | - ->addOption('force', 'f', InputOption::VALUE_NONE, 'Causes the generated SQL statements to be physically executed against your database.') |
|
57 | - ->setHelp(<<<EOT |
|
53 | + ->setDescription('Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata') |
|
54 | + ->addOption('complete', null, InputOption::VALUE_NONE, 'If defined, all assets of the database which are not relevant to the current metadata will be dropped.') |
|
55 | + ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Dumps the generated SQL statements to the screen (does not execute them).') |
|
56 | + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Causes the generated SQL statements to be physically executed against your database.') |
|
57 | + ->setHelp(<<<EOT |
|
58 | 58 | The <info>%command.name%</info> command generates the SQL needed to |
59 | 59 | synchronize the database schema with the current mapping metadata of the |
60 | 60 | default entity manager. |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | \$config->setFilterSchemaAssetsExpression(\$regexp); |
86 | 86 | EOT |
87 | - ); |
|
87 | + ); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |