@@ -47,18 +47,18 @@ discard block |
||
47 | 47 | protected function configure() |
48 | 48 | { |
49 | 49 | $this->setName('orm:generate-entities') |
50 | - ->setAliases(['orm:generate:entities']) |
|
51 | - ->setDescription('Generate entity classes and method stubs from your mapping information') |
|
52 | - ->addArgument('dest-path', InputArgument::REQUIRED, 'The path to generate your entity classes.') |
|
53 | - ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.') |
|
54 | - ->addOption('generate-annotations', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should generate annotation metadata on entities.', false) |
|
55 | - ->addOption('generate-methods', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should generate stub methods on entities.', true) |
|
56 | - ->addOption('regenerate-entities', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should regenerate entity if it exists.', false) |
|
57 | - ->addOption('update-entities', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should only update entity if it exists.', true) |
|
58 | - ->addOption('extend', null, InputOption::VALUE_REQUIRED, 'Defines a base class to be extended by generated entity classes.') |
|
59 | - ->addOption('num-spaces', null, InputOption::VALUE_REQUIRED, 'Defines the number of indentation spaces', 4) |
|
60 | - ->addOption('no-backup', null, InputOption::VALUE_NONE, 'Flag to define if generator should avoid backuping existing entity file if it exists.') |
|
61 | - ->setHelp(<<<EOT |
|
50 | + ->setAliases(['orm:generate:entities']) |
|
51 | + ->setDescription('Generate entity classes and method stubs from your mapping information') |
|
52 | + ->addArgument('dest-path', InputArgument::REQUIRED, 'The path to generate your entity classes.') |
|
53 | + ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.') |
|
54 | + ->addOption('generate-annotations', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should generate annotation metadata on entities.', false) |
|
55 | + ->addOption('generate-methods', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should generate stub methods on entities.', true) |
|
56 | + ->addOption('regenerate-entities', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should regenerate entity if it exists.', false) |
|
57 | + ->addOption('update-entities', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should only update entity if it exists.', true) |
|
58 | + ->addOption('extend', null, InputOption::VALUE_REQUIRED, 'Defines a base class to be extended by generated entity classes.') |
|
59 | + ->addOption('num-spaces', null, InputOption::VALUE_REQUIRED, 'Defines the number of indentation spaces', 4) |
|
60 | + ->addOption('no-backup', null, InputOption::VALUE_NONE, 'Flag to define if generator should avoid backuping existing entity file if it exists.') |
|
61 | + ->setHelp(<<<EOT |
|
62 | 62 | Generate entity classes and method stubs from your mapping information. |
63 | 63 | |
64 | 64 | If you use the <comment>--update-entities</comment> or <comment>--regenerate-entities</comment> flags your existing |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | class is supposed to extend which. You have to adjust the entity |
79 | 79 | code manually for inheritance to work! |
80 | 80 | EOT |
81 | - ); |
|
81 | + ); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -122,7 +122,7 @@ |
||
122 | 122 | $entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities')); |
123 | 123 | $entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities')); |
124 | 124 | $entityGenerator->setNumSpaces($input->getOption('num-spaces')); |
125 | - $entityGenerator->setBackupExisting(!$input->getOption('no-backup')); |
|
125 | + $entityGenerator->setBackupExisting( ! $input->getOption('no-backup')); |
|
126 | 126 | |
127 | 127 | if (($extend = $input->getOption('extend')) !== null) { |
128 | 128 | $entityGenerator->setClassToExtend($extend); |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | protected function configure() |
41 | 41 | { |
42 | 42 | $this->setName('orm:info') |
43 | - ->setDescription('Show basic information about all mapped entities') |
|
44 | - ->setHelp(<<<EOT |
|
43 | + ->setDescription('Show basic information about all mapped entities') |
|
44 | + ->setHelp(<<<EOT |
|
45 | 45 | The <info>%command.name%</info> shows basic information about which |
46 | 46 | entities exist and possibly if their mapping information contains errors or |
47 | 47 | not. |
48 | 48 | EOT |
49 | - ); |
|
49 | + ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | $entityManager = $this->getHelper('em')->getEntityManager(); |
61 | 61 | |
62 | 62 | $entityClassNames = $entityManager->getConfiguration() |
63 | - ->getMetadataDriverImpl() |
|
64 | - ->getAllClassNames(); |
|
63 | + ->getMetadataDriverImpl() |
|
64 | + ->getAllClassNames(); |
|
65 | 65 | |
66 | 66 | if ( ! $entityClassNames) { |
67 | 67 | $ui->caution( |
@@ -45,9 +45,9 @@ |
||
45 | 45 | protected function configure() |
46 | 46 | { |
47 | 47 | $this->setName('orm:ensure-production-settings') |
48 | - ->setDescription('Verify that Doctrine is properly configured for a production environment') |
|
49 | - ->addOption('complete', null, InputOption::VALUE_NONE, 'Flag to also inspect database connection existence.') |
|
50 | - ->setHelp('Verify that Doctrine is properly configured for a production environment.'); |
|
48 | + ->setDescription('Verify that Doctrine is properly configured for a production environment') |
|
49 | + ->addOption('complete', null, InputOption::VALUE_NONE, 'Flag to also inspect database connection existence.') |
|
50 | + ->setHelp('Verify that Doctrine is properly configured for a production environment.'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -46,11 +46,11 @@ |
||
46 | 46 | protected function configure() |
47 | 47 | { |
48 | 48 | $this->setName('orm:generate-proxies') |
49 | - ->setAliases(['orm:generate:proxies']) |
|
50 | - ->setDescription('Generates proxy classes for entity classes') |
|
51 | - ->addArgument('dest-path', InputArgument::OPTIONAL, 'The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration.') |
|
52 | - ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.') |
|
53 | - ->setHelp('Generates proxy classes for entity classes.'); |
|
49 | + ->setAliases(['orm:generate:proxies']) |
|
50 | + ->setDescription('Generates proxy classes for entity classes') |
|
51 | + ->addArgument('dest-path', InputArgument::OPTIONAL, 'The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration.') |
|
52 | + ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.') |
|
53 | + ->setHelp('Generates proxy classes for entity classes.'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | protected function configure() |
43 | 43 | { |
44 | 44 | $this->setName('orm:mapping:describe') |
45 | - ->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity') |
|
46 | - ->setDescription('Display information about mapped objects') |
|
47 | - ->setHelp(<<<EOT |
|
45 | + ->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity') |
|
46 | + ->setDescription('Display information about mapped objects') |
|
47 | + ->setHelp(<<<EOT |
|
48 | 48 | The %command.full_name% command describes the metadata for the given full or partial entity class name. |
49 | 49 | |
50 | 50 | <info>%command.full_name%</info> My\Namespace\Entity\MyEntity |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | <info>%command.full_name%</info> MyEntity |
55 | 55 | EOT |
56 | - ); |
|
56 | + ); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | private function getMappedEntities(EntityManagerInterface $entityManager) |
135 | 135 | { |
136 | 136 | $entityClassNames = $entityManager->getConfiguration() |
137 | - ->getMetadataDriverImpl() |
|
138 | - ->getAllClassNames(); |
|
137 | + ->getMetadataDriverImpl() |
|
138 | + ->getAllClassNames(); |
|
139 | 139 | |
140 | 140 | if ( ! $entityClassNames) { |
141 | 141 | throw new \InvalidArgumentException( |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | |
166 | 166 | $matches = array_filter( |
167 | 167 | $this->getMappedEntities($entityManager), |
168 | - function ($mappedEntity) use ($entityName) { |
|
169 | - return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity); |
|
168 | + function($mappedEntity) use ($entityName) { |
|
169 | + return preg_match('{'.preg_quote($entityName).'}', $mappedEntity); |
|
170 | 170 | } |
171 | 171 | ); |
172 | 172 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | if (is_bool($value)) { |
208 | - return '<comment>' . ($value ? 'True' : 'False') . '</comment>'; |
|
208 | + return '<comment>'.($value ? 'True' : 'False').'</comment>'; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | if (empty($value)) { |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | public function testMixedParametersWithZeroNumber() : void |
21 | 21 | { |
22 | 22 | $query = $this->_em->createQueryBuilder() |
23 | - ->select('u') |
|
24 | - ->from(CmsUser::class, 'u') |
|
25 | - ->andWhere('u.username = :username') |
|
26 | - ->andWhere('u.id = ?0') |
|
27 | - ->getQuery(); |
|
23 | + ->select('u') |
|
24 | + ->from(CmsUser::class, 'u') |
|
25 | + ->andWhere('u.username = :username') |
|
26 | + ->andWhere('u.id = ?0') |
|
27 | + ->getQuery(); |
|
28 | 28 | |
29 | 29 | $query->setParameter('username', 'bar'); |
30 | 30 | $query->setParameter(0, 0); |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | public function testMixedParametersWithZeroNumberOnQueryBuilder() : void |
40 | 40 | { |
41 | 41 | $query = $this->_em->createQueryBuilder() |
42 | - ->select('u') |
|
43 | - ->from(CmsUser::class, 'u') |
|
44 | - ->andWhere('u.username = :username') |
|
45 | - ->andWhere('u.id = ?0') |
|
46 | - ->setParameter('username', 'bar') |
|
47 | - ->setParameter(0, 0) |
|
48 | - ->getQuery(); |
|
42 | + ->select('u') |
|
43 | + ->from(CmsUser::class, 'u') |
|
44 | + ->andWhere('u.username = :username') |
|
45 | + ->andWhere('u.id = ?0') |
|
46 | + ->setParameter('username', 'bar') |
|
47 | + ->setParameter(0, 0) |
|
48 | + ->getQuery(); |
|
49 | 49 | |
50 | 50 | $query->execute(); |
51 | 51 |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function registerAutoloadDirectory($directory) |
46 | 46 | { |
47 | - if (!class_exists('Doctrine\Common\ClassLoader', false)) { |
|
48 | - require_once $directory . "/Doctrine/Common/ClassLoader.php"; |
|
47 | + if ( ! class_exists('Doctrine\Common\ClassLoader', false)) { |
|
48 | + require_once $directory."/Doctrine/Common/ClassLoader.php"; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | $loader = new ClassLoader("Doctrine", $directory); |
52 | 52 | $loader->register(); |
53 | 53 | |
54 | - $loader = new ClassLoader("Symfony\Component", $directory . "/Doctrine"); |
|
54 | + $loader = new ClassLoader("Symfony\Component", $directory."/Doctrine"); |
|
55 | 55 | $loader->register(); |
56 | 56 | } |
57 | 57 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return $config; |
137 | 137 | } |
138 | 138 | |
139 | - private static function createCacheConfiguration(bool $isDevMode, string $proxyDir, ?Cache $cache) : Cache |
|
139 | + private static function createCacheConfiguration(bool $isDevMode, string $proxyDir, ?Cache $cache) : Cache |
|
140 | 140 | { |
141 | 141 | $cache = self::createCacheInstance($isDevMode, $cache); |
142 | 142 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $namespace .= ':'; |
151 | 151 | } |
152 | 152 | |
153 | - $cache->setNamespace($namespace . 'dc2_' . md5($proxyDir) . '_'); // to avoid collisions |
|
153 | + $cache->setNamespace($namespace.'dc2_'.md5($proxyDir).'_'); // to avoid collisions |
|
154 | 154 | |
155 | 155 | return $cache; |
156 | 156 | } |
@@ -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("ClassMetadata::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 | |
@@ -3108,7 +3108,7 @@ discard block |
||
3108 | 3108 | public function getAssociationTargetClass($assocName) |
3109 | 3109 | { |
3110 | 3110 | if ( ! isset($this->associationMappings[$assocName])) { |
3111 | - throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); |
|
3111 | + throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association."); |
|
3112 | 3112 | } |
3113 | 3113 | |
3114 | 3114 | return $this->associationMappings[$assocName]['targetEntity']; |
@@ -3147,7 +3147,7 @@ discard block |
||
3147 | 3147 | // Association defined as Id field |
3148 | 3148 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
3149 | 3149 | $assocQuotedColumnNames = array_map( |
3150 | - function ($joinColumn) use ($platform) { |
|
3150 | + function($joinColumn) use ($platform) { |
|
3151 | 3151 | return isset($joinColumn['quoted']) |
3152 | 3152 | ? $platform->quoteIdentifier($joinColumn['name']) |
3153 | 3153 | : $joinColumn['name']; |
@@ -3258,7 +3258,7 @@ discard block |
||
3258 | 3258 | } |
3259 | 3259 | |
3260 | 3260 | if ($className !== null && strpos($className, '\\') === false && $this->namespace) { |
3261 | - return $this->namespace . '\\' . $className; |
|
3261 | + return $this->namespace.'\\'.$className; |
|
3262 | 3262 | } |
3263 | 3263 | |
3264 | 3264 | return $className; |
@@ -3310,13 +3310,13 @@ discard block |
||
3310 | 3310 | foreach ($embeddable->fieldMappings as $fieldMapping) { |
3311 | 3311 | $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name; |
3312 | 3312 | $fieldMapping['declaredField'] = isset($fieldMapping['declaredField']) |
3313 | - ? $property . '.' . $fieldMapping['declaredField'] |
|
3313 | + ? $property.'.'.$fieldMapping['declaredField'] |
|
3314 | 3314 | : $property; |
3315 | 3315 | $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName']; |
3316 | - $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName']; |
|
3316 | + $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName']; |
|
3317 | 3317 | |
3318 | - if (! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3319 | - $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']; |
|
3318 | + if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3319 | + $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName']; |
|
3320 | 3320 | } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) { |
3321 | 3321 | $fieldMapping['columnName'] = $this->namingStrategy |
3322 | 3322 | ->embeddedFieldToColumnName( |
@@ -3357,7 +3357,7 @@ discard block |
||
3357 | 3357 | { |
3358 | 3358 | $sequencePrefix = $this->getSequencePrefix($platform); |
3359 | 3359 | $columnName = $this->getSingleIdentifierColumnName(); |
3360 | - $sequenceName = $sequencePrefix . '_' . $columnName . '_seq'; |
|
3360 | + $sequenceName = $sequencePrefix.'_'.$columnName.'_seq'; |
|
3361 | 3361 | |
3362 | 3362 | return $sequenceName; |
3363 | 3363 | } |
@@ -3377,10 +3377,10 @@ discard block |
||
3377 | 3377 | |
3378 | 3378 | // Prepend the schema name to the table name if there is one |
3379 | 3379 | if ($schemaName = $this->getSchemaName()) { |
3380 | - $sequencePrefix = $schemaName . '.' . $tableName; |
|
3380 | + $sequencePrefix = $schemaName.'.'.$tableName; |
|
3381 | 3381 | |
3382 | 3382 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
3383 | - $sequencePrefix = $schemaName . '__' . $tableName; |
|
3383 | + $sequencePrefix = $schemaName.'__'.$tableName; |
|
3384 | 3384 | } |
3385 | 3385 | } |
3386 | 3386 | |
@@ -3392,8 +3392,8 @@ discard block |
||
3392 | 3392 | */ |
3393 | 3393 | private function assertMappingOrderBy(array $mapping) |
3394 | 3394 | { |
3395 | - if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) { |
|
3396 | - throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy'])); |
|
3395 | + if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) { |
|
3396 | + throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); |
|
3397 | 3397 | } |
3398 | 3398 | } |
3399 | 3399 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $schema = []; |
76 | 76 | foreach ($this->from as $path) { |
77 | 77 | if (is_dir($path)) { |
78 | - $files = glob($path . '/*.yml'); |
|
78 | + $files = glob($path.'/*.yml'); |
|
79 | 79 | foreach ($files as $file) { |
80 | 80 | $schema = array_merge($schema, (array) Yaml::parse(file_get_contents($file))); |
81 | 81 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_SEQUENCE); |
239 | 239 | |
240 | 240 | $definition = [ |
241 | - 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name']:$column['sequence'] |
|
241 | + 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name'] : $column['sequence'] |
|
242 | 242 | ]; |
243 | 243 | |
244 | 244 | if (isset($column['sequence']['size'])) { |