@@ -48,6 +48,9 @@ discard block |
||
48 | 48 | return EntityManagerMock::create($conn, $config, $eventManager); |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param string $path |
|
53 | + */ |
|
51 | 54 | protected function _createMetadataDriver($type, $path) |
52 | 55 | { |
53 | 56 | $mappingDriver = [ |
@@ -67,6 +70,9 @@ discard block |
||
67 | 70 | return $driver; |
68 | 71 | } |
69 | 72 | |
73 | + /** |
|
74 | + * @param EntityManagerMock $em |
|
75 | + */ |
|
70 | 76 | protected function _createClassMetadataFactory($em, $type) |
71 | 77 | { |
72 | 78 | $factory = ($type === 'annotation') |
@@ -277,7 +283,6 @@ discard block |
||
277 | 283 | |
278 | 284 | /** |
279 | 285 | * @depends testOneToManyAssociationsAreExported |
280 | - * @param ClassMetadataInfo $metadata |
|
281 | 286 | */ |
282 | 287 | public function testManyToManyAssociationsAreExported($class) |
283 | 288 | { |
@@ -376,6 +381,9 @@ discard block |
||
376 | 381 | # $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType()); |
377 | 382 | } |
378 | 383 | |
384 | + /** |
|
385 | + * @param string $path |
|
386 | + */ |
|
379 | 387 | protected function _deleteDirectory($path) |
380 | 388 | { |
381 | 389 | if (is_file($path)) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $driverMock = new DriverMock(); |
41 | 41 | $config = new Configuration(); |
42 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
42 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
43 | 43 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
44 | 44 | $eventManager = new EventManager(); |
45 | 45 | $conn = new ConnectionMock([], $driverMock, $config, $eventManager); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 'yaml' => YamlDriver::class, |
58 | 58 | ]; |
59 | 59 | |
60 | - $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'."); |
|
60 | + $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'."); |
|
61 | 61 | |
62 | 62 | $class = $mappingDriver[$type]; |
63 | 63 | $driver = ($type === 'annotation') |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | |
81 | 81 | public function testExportDirectoryAndFilesAreCreated() |
82 | 82 | { |
83 | - $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType()); |
|
83 | + $this->_deleteDirectory(__DIR__.'/export/'.$this->_getType()); |
|
84 | 84 | |
85 | 85 | $type = $this->_getType(); |
86 | - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/' . $type); |
|
86 | + $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/'.$type); |
|
87 | 87 | $em = $this->_createEntityManager($metadataDriver); |
88 | 88 | $cmf = $this->_createClassMetadataFactory($em, $type); |
89 | 89 | $metadata = $cmf->getAllMetadata(); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $type = $this->_getType(); |
96 | 96 | $cme = new ClassMetadataExporter(); |
97 | - $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type); |
|
97 | + $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type); |
|
98 | 98 | |
99 | 99 | if ($type === 'annotation') { |
100 | 100 | $entityGenerator = new EntityGenerator(); |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | $exporter->export(); |
110 | 110 | |
111 | 111 | if ($type == 'annotation') { |
112 | - $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->_extension)); |
|
112 | + $this->assertTrue(file_exists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->_extension)); |
|
113 | 113 | } else { |
114 | - $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension)); |
|
114 | + $this->assertTrue(file_exists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension)); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $type = $this->_getType(); |
124 | 124 | |
125 | - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/export/' . $type); |
|
125 | + $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/export/'.$type); |
|
126 | 126 | $em = $this->_createEntityManager($metadataDriver); |
127 | 127 | $cmf = $this->_createClassMetadataFactory($em, $type); |
128 | 128 | $metadata = $cmf->getAllMetadata(); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $type = $this->_getType(); |
209 | 209 | |
210 | 210 | if ($type == 'xml') { |
211 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
211 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
212 | 212 | |
213 | 213 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
214 | 214 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:field[@name='name' and @type='string' and @nullable='true']"); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $type = $this->_getType(); |
353 | 353 | |
354 | 354 | if ($type == 'xml') { |
355 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
355 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
356 | 356 | |
357 | 357 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
358 | 358 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*"); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $this->assertEquals('cascade-all', $nodes[0]->getName()); |
362 | 362 | } else if ($type == 'yaml') { |
363 | 363 | $yaml = new Parser(); |
364 | - $value = $yaml->parse(file_get_contents(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); |
|
364 | + $value = $yaml->parse(file_get_contents(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); |
|
365 | 365 | |
366 | 366 | $this->assertTrue(isset($value[ExportedUser::class]['oneToMany']['interests']['cascade'])); |
367 | 367 | $this->assertEquals(1, count($value[ExportedUser::class]['oneToMany']['interests']['cascade'])); |
@@ -381,10 +381,10 @@ discard block |
||
381 | 381 | if (is_file($path)) { |
382 | 382 | return unlink($path); |
383 | 383 | } else if (is_dir($path)) { |
384 | - $files = glob(rtrim($path,'/').'/*'); |
|
384 | + $files = glob(rtrim($path, '/').'/*'); |
|
385 | 385 | |
386 | 386 | if (is_array($files)) { |
387 | - foreach ($files as $file){ |
|
387 | + foreach ($files as $file) { |
|
388 | 388 | $this->_deleteDirectory($file); |
389 | 389 | } |
390 | 390 | } |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
89 | 89 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $updateClause->aliasIdentificationVariable); |
90 | 90 | |
91 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
92 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
91 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
92 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
93 | 93 | |
94 | 94 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $updateClause->aliasIdentificationVariable); |
95 | 95 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->_insertSql .= $sqlWalker->walkFromClause($fromClause); |
98 | 98 | |
99 | 99 | // 2. Create ID subselect statement used in UPDATE ... WHERE ... IN (subselect) |
100 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
100 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
101 | 101 | |
102 | 102 | // 3. Create and store UPDATE statements |
103 | 103 | $classNames = array_merge($primaryClass->parentClasses, [$primaryClass->name], $primaryClass->subClasses); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | foreach (array_reverse($classNames) as $className) { |
107 | 107 | $affected = false; |
108 | 108 | $class = $em->getClassMetadata($className); |
109 | - $updateSql = 'UPDATE ' . $quoteStrategy->getTableName($class, $platform) . ' SET '; |
|
109 | + $updateSql = 'UPDATE '.$quoteStrategy->getTableName($class, $platform).' SET '; |
|
110 | 110 | |
111 | 111 | foreach ($updateItems as $updateItem) { |
112 | 112 | $field = $updateItem->pathExpression->field; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($affected) { |
136 | - $this->_sqlStatements[$i] = $updateSql . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
136 | + $this->_sqlStatements[$i] = $updateSql.' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | ]; |
153 | 153 | } |
154 | 154 | |
155 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
156 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
155 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
156 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
157 | 157 | |
158 | 158 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
159 | 159 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
78 | 78 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 't0', $primaryDqlAlias); |
79 | 79 | |
80 | - $this->_insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ')' |
|
81 | - . ' SELECT t0.' . implode(', t0.', $idColumnNames); |
|
80 | + $this->_insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnList.')' |
|
81 | + . ' SELECT t0.'.implode(', t0.', $idColumnNames); |
|
82 | 82 | |
83 | 83 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->name, $primaryDqlAlias); |
84 | 84 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | // 2. Create ID subselect statement used in DELETE ... WHERE ... IN (subselect) |
93 | - $idSubselect = 'SELECT ' . $idColumnList . ' FROM ' . $tempTable; |
|
93 | + $idSubselect = 'SELECT '.$idColumnList.' FROM '.$tempTable; |
|
94 | 94 | |
95 | 95 | // 3. Create and store DELETE statements |
96 | 96 | $classNames = array_merge($primaryClass->parentClasses, [$primaryClass->name], $primaryClass->subClasses); |
97 | 97 | foreach (array_reverse($classNames) as $className) { |
98 | 98 | $tableName = $quoteStrategy->getTableName($em->getClassMetadata($className), $platform); |
99 | - $this->_sqlStatements[] = 'DELETE FROM ' . $tableName |
|
100 | - . ' WHERE (' . $idColumnList . ') IN (' . $idSubselect . ')'; |
|
99 | + $this->_sqlStatements[] = 'DELETE FROM '.$tableName |
|
100 | + . ' WHERE ('.$idColumnList.') IN ('.$idSubselect.')'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // 4. Store DDL for temporary identifier table. |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | 'type' => Type::getType(PersisterHelper::getTypeOfColumn($idColumnName, $rootClass, $em)), |
109 | 109 | ]; |
110 | 110 | } |
111 | - $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
112 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
111 | + $this->_createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
112 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
113 | 113 | $this->_dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
114 | 114 | } |
115 | 115 |
@@ -444,7 +444,9 @@ discard block |
||
444 | 444 | foreach ($dqlAliases as $dqlAlias) { |
445 | 445 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
446 | 446 | |
447 | - if ( ! $class->isInheritanceTypeSingleTable()) continue; |
|
447 | + if ( ! $class->isInheritanceTypeSingleTable()) { |
|
448 | + continue; |
|
449 | + } |
|
448 | 450 | |
449 | 451 | $conn = $this->em->getConnection(); |
450 | 452 | $values = []; |
@@ -782,7 +784,9 @@ discard block |
||
782 | 784 | |
783 | 785 | foreach ($subClass->associationMappings as $assoc) { |
784 | 786 | // Skip if association is inherited |
785 | - if (isset($assoc['inherited'])) continue; |
|
787 | + if (isset($assoc['inherited'])) { |
|
788 | + continue; |
|
789 | + } |
|
786 | 790 | |
787 | 791 | if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { |
788 | 792 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
@@ -289,11 +289,11 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
291 | 291 | { |
292 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
292 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
293 | 293 | |
294 | 294 | if ( ! isset($this->tableAliasMap[$tableName])) { |
295 | 295 | $this->tableAliasMap[$tableName] = (preg_match('/[a-z]/i', $tableName[0]) ? strtolower($tableName[0]) : 't') |
296 | - . $this->tableAliasCounter++ . '_'; |
|
296 | + . $this->tableAliasCounter++.'_'; |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | return $this->tableAliasMap[$tableName]; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
313 | 313 | { |
314 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
314 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
315 | 315 | |
316 | 316 | $this->tableAliasMap[$tableName] = $alias; |
317 | 317 | |
@@ -352,12 +352,12 @@ discard block |
||
352 | 352 | |
353 | 353 | // If this is a joined association we must use left joins to preserve the correct result. |
354 | 354 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
355 | - $sql .= 'JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
355 | + $sql .= 'JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
356 | 356 | |
357 | 357 | $sqlParts = []; |
358 | 358 | |
359 | 359 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
360 | - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; |
|
360 | + $sqlParts[] = $baseTableAlias.'.'.$columnName.' = '.$tableAlias.'.'.$columnName; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | // Add filters on the root class |
@@ -378,12 +378,12 @@ discard block |
||
378 | 378 | $subClass = $this->em->getClassMetadata($subClassName); |
379 | 379 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
380 | 380 | |
381 | - $sql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
381 | + $sql .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON '; |
|
382 | 382 | |
383 | 383 | $sqlParts = []; |
384 | 384 | |
385 | 385 | foreach ($this->quoteStrategy->getIdentifierColumnNames($subClass, $this->platform) as $columnName) { |
386 | - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; |
|
386 | + $sqlParts[] = $baseTableAlias.'.'.$columnName.' = '.$tableAlias.'.'.$columnName; |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | $sql .= implode(' AND ', $sqlParts); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ? $persister->getOwningTable($fieldName) |
416 | 416 | : $qComp['metadata']->getTableName(); |
417 | 417 | |
418 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
418 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
419 | 419 | |
420 | 420 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
421 | 421 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | } |
424 | 424 | |
425 | 425 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
426 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
426 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
427 | 427 | } |
428 | 428 | } |
429 | 429 | |
@@ -458,15 +458,15 @@ discard block |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | $sqlTableAlias = ($this->useSqlTableAliases) |
461 | - ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.' |
|
461 | + ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.' |
|
462 | 462 | : ''; |
463 | 463 | |
464 | - $sqlParts[] = $sqlTableAlias . $class->discriminatorColumn['name'] . ' IN (' . implode(', ', $values) . ')'; |
|
464 | + $sqlParts[] = $sqlTableAlias.$class->discriminatorColumn['name'].' IN ('.implode(', ', $values).')'; |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | $sql = implode(' AND ', $sqlParts); |
468 | 468 | |
469 | - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
469 | + return (count($sqlParts) > 1) ? '('.$sql.')' : $sql; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
@@ -479,11 +479,11 @@ discard block |
||
479 | 479 | */ |
480 | 480 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
481 | 481 | { |
482 | - if (!$this->em->hasFilters()) { |
|
482 | + if ( ! $this->em->hasFilters()) { |
|
483 | 483 | return ''; |
484 | 484 | } |
485 | 485 | |
486 | - switch($targetEntity->inheritanceType) { |
|
486 | + switch ($targetEntity->inheritanceType) { |
|
487 | 487 | case ClassMetadata::INHERITANCE_TYPE_NONE: |
488 | 488 | break; |
489 | 489 | case ClassMetadata::INHERITANCE_TYPE_JOINED: |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | $filterClauses = []; |
507 | 507 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
508 | 508 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
509 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
509 | + $filterClauses[] = '('.$filterExpr.')'; |
|
510 | 510 | } |
511 | 511 | } |
512 | 512 | |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | |
540 | 540 | if ( ! $AST->orderByClause && ($orderBySql = $this->_generateOrderedCollectionOrderByItems())) { |
541 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
541 | + $sql .= ' ORDER BY '.$orderBySql; |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | if ($limit !== null || $offset !== null) { |
@@ -550,11 +550,11 @@ discard block |
||
550 | 550 | } |
551 | 551 | |
552 | 552 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
553 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
553 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
554 | 554 | } |
555 | 555 | |
556 | 556 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
557 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
557 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | $sqlParts = []; |
610 | 610 | |
611 | 611 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
612 | - $sqlParts[] = $tableAlias . '.' . $columnName; |
|
612 | + $sqlParts[] = $tableAlias.'.'.$columnName; |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | return implode(', ', $sqlParts); |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
653 | 653 | |
654 | 654 | if ($this->useSqlTableAliases) { |
655 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
655 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
656 | 656 | } |
657 | 657 | |
658 | 658 | $sql .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | } |
682 | 682 | |
683 | 683 | if ($this->useSqlTableAliases) { |
684 | - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; |
|
684 | + $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.'; |
|
685 | 685 | } |
686 | 686 | |
687 | 687 | $sql .= reset($assoc['targetToSourceKeyColumns']); |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | */ |
700 | 700 | public function walkSelectClause($selectClause) |
701 | 701 | { |
702 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
702 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
703 | 703 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
704 | 704 | |
705 | 705 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | $discrColumn = $rootClass->discriminatorColumn; |
737 | 737 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
738 | 738 | |
739 | - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
739 | + $sqlSelectExpressions[] = $tblAlias.'.'.$discrColumn['name'].' AS '.$columnAlias; |
|
740 | 740 | |
741 | 741 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
742 | 742 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName'], false, $discrColumn['type']); |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | foreach ($class->associationMappings as $assoc) { |
752 | 752 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
753 | 753 | continue; |
754 | - } else if ( !$addMetaColumns && !isset($assoc['id'])) { |
|
754 | + } else if ( ! $addMetaColumns && ! isset($assoc['id'])) { |
|
755 | 755 | continue; |
756 | 756 | } |
757 | 757 | |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
767 | 767 | |
768 | 768 | $quotedColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
769 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
769 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
770 | 770 | |
771 | 771 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $isIdentifier, $columnType); |
772 | 772 | } |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
796 | 796 | |
797 | 797 | $quotedColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $subClass, $this->platform); |
798 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
798 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
799 | 799 | |
800 | 800 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $subClass->isIdentifier($columnName), $columnType); |
801 | 801 | } |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
822 | 822 | } |
823 | 823 | |
824 | - return ' FROM ' . implode(', ', $sqlParts); |
|
824 | + return ' FROM '.implode(', ', $sqlParts); |
|
825 | 825 | } |
826 | 826 | |
827 | 827 | /** |
@@ -898,14 +898,14 @@ discard block |
||
898 | 898 | } |
899 | 899 | |
900 | 900 | $sql = $this->platform->appendLockHint( |
901 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
901 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
902 | 902 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
903 | 903 | $this->query->getHint(Query::HINT_LOCK_MODE) |
904 | 904 | ); |
905 | 905 | |
906 | 906 | if ($class->isInheritanceTypeJoined()) { |
907 | 907 | if ($buildNestedJoins) { |
908 | - $sql = '(' . $sql . $this->_generateClassTableInheritanceJoins($class, $dqlAlias) . ')'; |
|
908 | + $sql = '('.$sql.$this->_generateClassTableInheritanceJoins($class, $dqlAlias).')'; |
|
909 | 909 | } else { |
910 | 910 | $sql .= $this->_generateClassTableInheritanceJoins($class, $dqlAlias); |
911 | 911 | } |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | // Ensure we got the owning side, since it has all mapping info |
945 | 945 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
946 | 946 | |
947 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
947 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
948 | 948 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
949 | 949 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
950 | 950 | } |
@@ -964,12 +964,12 @@ discard block |
||
964 | 964 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
965 | 965 | |
966 | 966 | if ($relation['isOwningSide']) { |
967 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
967 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
968 | 968 | |
969 | 969 | continue; |
970 | 970 | } |
971 | 971 | |
972 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
972 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
973 | 973 | } |
974 | 974 | |
975 | 975 | // Apply remaining inheritance restrictions |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | } |
988 | 988 | |
989 | 989 | $targetTableJoin = [ |
990 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
990 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
991 | 991 | 'condition' => implode(' AND ', $conditions), |
992 | 992 | ]; |
993 | 993 | break; |
@@ -1007,10 +1007,10 @@ discard block |
||
1007 | 1007 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1008 | 1008 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1009 | 1009 | |
1010 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1010 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1011 | 1011 | } |
1012 | 1012 | |
1013 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1013 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1014 | 1014 | |
1015 | 1015 | // Join target table |
1016 | 1016 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1024,7 +1024,7 @@ discard block |
||
1024 | 1024 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1025 | 1025 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1026 | 1026 | |
1027 | - $conditions[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1027 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1028 | 1028 | } |
1029 | 1029 | |
1030 | 1030 | // Apply remaining inheritance restrictions |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | $targetTableJoin = [ |
1045 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1045 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1046 | 1046 | 'condition' => implode(' AND ', $conditions), |
1047 | 1047 | ]; |
1048 | 1048 | break; |
@@ -1052,22 +1052,22 @@ discard block |
||
1052 | 1052 | } |
1053 | 1053 | |
1054 | 1054 | // Handle WITH clause |
1055 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1055 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1056 | 1056 | |
1057 | 1057 | if ($targetClass->isInheritanceTypeJoined()) { |
1058 | 1058 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1059 | 1059 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1060 | 1060 | if ($withCondition) { |
1061 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1061 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1062 | 1062 | } else { |
1063 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1063 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1064 | 1064 | } |
1065 | 1065 | } else { |
1066 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1066 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1067 | 1067 | } |
1068 | 1068 | |
1069 | 1069 | if ($withCondition) { |
1070 | - $sql .= ' AND ' . $withCondition; |
|
1070 | + $sql .= ' AND '.$withCondition; |
|
1071 | 1071 | } |
1072 | 1072 | |
1073 | 1073 | // Apply the indexes |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1101 | 1101 | } |
1102 | 1102 | |
1103 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1103 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | /** |
@@ -1117,10 +1117,10 @@ discard block |
||
1117 | 1117 | $this->orderedColumnsMap[$sql] = $type; |
1118 | 1118 | |
1119 | 1119 | if ($expr instanceof AST\Subselect) { |
1120 | - return '(' . $sql . ') ' . $type; |
|
1120 | + return '('.$sql.') '.$type; |
|
1121 | 1121 | } |
1122 | 1122 | |
1123 | - return $sql . ' ' . $type; |
|
1123 | + return $sql.' '.$type; |
|
1124 | 1124 | } |
1125 | 1125 | |
1126 | 1126 | /** |
@@ -1128,7 +1128,7 @@ discard block |
||
1128 | 1128 | */ |
1129 | 1129 | public function walkHavingClause($havingClause) |
1130 | 1130 | { |
1131 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1131 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | /** |
@@ -1151,7 +1151,7 @@ discard block |
||
1151 | 1151 | $conditions = []; |
1152 | 1152 | |
1153 | 1153 | if ($join->conditionalExpression) { |
1154 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1154 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1155 | 1155 | } |
1156 | 1156 | |
1157 | 1157 | $isUnconditionalJoin = empty($conditions); |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | ? ' AND ' |
1160 | 1160 | : ' ON '; |
1161 | 1161 | |
1162 | - $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, !$isUnconditionalJoin); |
|
1162 | + $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, ! $isUnconditionalJoin); |
|
1163 | 1163 | |
1164 | 1164 | // Apply remaining inheritance restrictions |
1165 | 1165 | $discrSql = $this->_generateDiscriminatorColumnConditionSQL([$dqlAlias]); |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | if ($conditions) { |
1179 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1179 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | break; |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1207 | 1207 | } |
1208 | 1208 | |
1209 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1209 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1210 | 1210 | |
1211 | 1211 | return $sql; |
1212 | 1212 | } |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1229 | 1229 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1230 | 1230 | |
1231 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1231 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1232 | 1232 | } |
1233 | 1233 | |
1234 | 1234 | /** |
@@ -1243,11 +1243,11 @@ discard block |
||
1243 | 1243 | $sql = 'CASE'; |
1244 | 1244 | |
1245 | 1245 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1246 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1247 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1246 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1247 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1248 | 1248 | } |
1249 | 1249 | |
1250 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1250 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1251 | 1251 | |
1252 | 1252 | return $sql; |
1253 | 1253 | } |
@@ -1261,14 +1261,14 @@ discard block |
||
1261 | 1261 | */ |
1262 | 1262 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1263 | 1263 | { |
1264 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1264 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1265 | 1265 | |
1266 | 1266 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1267 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1268 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1267 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1268 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1269 | 1269 | } |
1270 | 1270 | |
1271 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1271 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1272 | 1272 | |
1273 | 1273 | return $sql; |
1274 | 1274 | } |
@@ -1302,14 +1302,14 @@ discard block |
||
1302 | 1302 | $fieldMapping = $class->fieldMappings[$fieldName]; |
1303 | 1303 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1304 | 1304 | $columnAlias = $this->getSQLColumnAlias($fieldMapping['columnName']); |
1305 | - $col = $sqlTableAlias . '.' . $columnName; |
|
1305 | + $col = $sqlTableAlias.'.'.$columnName; |
|
1306 | 1306 | |
1307 | 1307 | if (isset($fieldMapping['requireSQLConversion'])) { |
1308 | 1308 | $type = Type::getType($fieldMapping['type']); |
1309 | 1309 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
1310 | 1310 | } |
1311 | 1311 | |
1312 | - $sql .= $col . ' AS ' . $columnAlias; |
|
1312 | + $sql .= $col.' AS '.$columnAlias; |
|
1313 | 1313 | |
1314 | 1314 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1315 | 1315 | |
@@ -1334,7 +1334,7 @@ discard block |
||
1334 | 1334 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1335 | 1335 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1336 | 1336 | |
1337 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1337 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1338 | 1338 | |
1339 | 1339 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1340 | 1340 | |
@@ -1348,7 +1348,7 @@ discard block |
||
1348 | 1348 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1349 | 1349 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1350 | 1350 | |
1351 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1351 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1352 | 1352 | |
1353 | 1353 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1354 | 1354 | |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | break; |
1360 | 1360 | |
1361 | 1361 | case ($expr instanceof AST\NewObjectExpression): |
1362 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1362 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1363 | 1363 | break; |
1364 | 1364 | |
1365 | 1365 | default: |
@@ -1400,14 +1400,14 @@ discard block |
||
1400 | 1400 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1401 | 1401 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1402 | 1402 | |
1403 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1403 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1404 | 1404 | |
1405 | 1405 | if (isset($mapping['requireSQLConversion'])) { |
1406 | 1406 | $type = Type::getType($mapping['type']); |
1407 | 1407 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1408 | 1408 | } |
1409 | 1409 | |
1410 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
1410 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1411 | 1411 | |
1412 | 1412 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1413 | 1413 | |
@@ -1424,21 +1424,21 @@ discard block |
||
1424 | 1424 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
1425 | 1425 | |
1426 | 1426 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
1427 | - if (isset($mapping['inherited']) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
1427 | + if (isset($mapping['inherited']) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
1428 | 1428 | continue; |
1429 | 1429 | } |
1430 | 1430 | |
1431 | 1431 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1432 | 1432 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
1433 | 1433 | |
1434 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1434 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1435 | 1435 | |
1436 | 1436 | if (isset($mapping['requireSQLConversion'])) { |
1437 | 1437 | $type = Type::getType($mapping['type']); |
1438 | 1438 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1439 | 1439 | } |
1440 | 1440 | |
1441 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
1441 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1442 | 1442 | |
1443 | 1443 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1444 | 1444 | |
@@ -1458,7 +1458,7 @@ discard block |
||
1458 | 1458 | */ |
1459 | 1459 | public function walkQuantifiedExpression($qExpr) |
1460 | 1460 | { |
1461 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1461 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1462 | 1462 | } |
1463 | 1463 | |
1464 | 1464 | /** |
@@ -1498,7 +1498,7 @@ discard block |
||
1498 | 1498 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1499 | 1499 | } |
1500 | 1500 | |
1501 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1501 | + return ' FROM '.implode(', ', $sqlParts); |
|
1502 | 1502 | } |
1503 | 1503 | |
1504 | 1504 | /** |
@@ -1506,7 +1506,7 @@ discard block |
||
1506 | 1506 | */ |
1507 | 1507 | public function walkSimpleSelectClause($simpleSelectClause) |
1508 | 1508 | { |
1509 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1509 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1510 | 1510 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1511 | 1511 | } |
1512 | 1512 | |
@@ -1525,10 +1525,10 @@ discard block |
||
1525 | 1525 | * @param null|string $newObjectResultAlias |
1526 | 1526 | * @return string The SQL. |
1527 | 1527 | */ |
1528 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1528 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1529 | 1529 | { |
1530 | 1530 | $sqlSelectExpressions = []; |
1531 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
1531 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
1532 | 1532 | |
1533 | 1533 | foreach ($newObjectExpression->args as $argIndex => $e) { |
1534 | 1534 | $resultAlias = $this->scalarResultCounter++; |
@@ -1541,7 +1541,7 @@ discard block |
||
1541 | 1541 | break; |
1542 | 1542 | |
1543 | 1543 | case ($e instanceof AST\Subselect): |
1544 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1544 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1545 | 1545 | break; |
1546 | 1546 | |
1547 | 1547 | case ($e instanceof AST\PathExpression): |
@@ -1550,7 +1550,7 @@ discard block |
||
1550 | 1550 | $class = $qComp['metadata']; |
1551 | 1551 | $fieldType = $class->fieldMappings[$e->field]['type']; |
1552 | 1552 | |
1553 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1553 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1554 | 1554 | break; |
1555 | 1555 | |
1556 | 1556 | case ($e instanceof AST\Literal): |
@@ -1564,11 +1564,11 @@ discard block |
||
1564 | 1564 | break; |
1565 | 1565 | } |
1566 | 1566 | |
1567 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1567 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1568 | 1568 | break; |
1569 | 1569 | |
1570 | 1570 | default: |
1571 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1571 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1572 | 1572 | break; |
1573 | 1573 | } |
1574 | 1574 | |
@@ -1601,10 +1601,10 @@ discard block |
||
1601 | 1601 | case ($expr instanceof AST\Subselect): |
1602 | 1602 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1603 | 1603 | |
1604 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1604 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1605 | 1605 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1606 | 1606 | |
1607 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1607 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1608 | 1608 | break; |
1609 | 1609 | |
1610 | 1610 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1621,7 +1621,7 @@ discard block |
||
1621 | 1621 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1622 | 1622 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1623 | 1623 | |
1624 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1624 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1625 | 1625 | break; |
1626 | 1626 | |
1627 | 1627 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1641,8 +1641,8 @@ discard block |
||
1641 | 1641 | */ |
1642 | 1642 | public function walkAggregateExpression($aggExpression) |
1643 | 1643 | { |
1644 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1645 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1644 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1645 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1646 | 1646 | } |
1647 | 1647 | |
1648 | 1648 | /** |
@@ -1656,7 +1656,7 @@ discard block |
||
1656 | 1656 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1657 | 1657 | } |
1658 | 1658 | |
1659 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1659 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1660 | 1660 | } |
1661 | 1661 | |
1662 | 1662 | /** |
@@ -1713,7 +1713,7 @@ discard block |
||
1713 | 1713 | { |
1714 | 1714 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1715 | 1715 | $tableName = $class->getTableName(); |
1716 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1716 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1717 | 1717 | |
1718 | 1718 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1719 | 1719 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1728,12 +1728,12 @@ discard block |
||
1728 | 1728 | { |
1729 | 1729 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1730 | 1730 | $tableName = $class->getTableName(); |
1731 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1731 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1732 | 1732 | |
1733 | 1733 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1734 | 1734 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1735 | 1735 | |
1736 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1736 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1737 | 1737 | |
1738 | 1738 | return $sql; |
1739 | 1739 | } |
@@ -1746,7 +1746,7 @@ discard block |
||
1746 | 1746 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1747 | 1747 | $this->useSqlTableAliases = false; |
1748 | 1748 | |
1749 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1749 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1750 | 1750 | $newValue = $updateItem->newValue; |
1751 | 1751 | |
1752 | 1752 | switch (true) { |
@@ -1789,7 +1789,7 @@ discard block |
||
1789 | 1789 | |
1790 | 1790 | if (count($filterClauses)) { |
1791 | 1791 | if ($condSql) { |
1792 | - $condSql = '(' . $condSql . ') AND '; |
|
1792 | + $condSql = '('.$condSql.') AND '; |
|
1793 | 1793 | } |
1794 | 1794 | |
1795 | 1795 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1797,11 +1797,11 @@ discard block |
||
1797 | 1797 | } |
1798 | 1798 | |
1799 | 1799 | if ($condSql) { |
1800 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1800 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1801 | 1801 | } |
1802 | 1802 | |
1803 | 1803 | if ($discrSql) { |
1804 | - return ' WHERE ' . $discrSql; |
|
1804 | + return ' WHERE '.$discrSql; |
|
1805 | 1805 | } |
1806 | 1806 | |
1807 | 1807 | return ''; |
@@ -1844,7 +1844,7 @@ discard block |
||
1844 | 1844 | // if only one ConditionalPrimary is defined |
1845 | 1845 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1846 | 1846 | ? $this->walkConditionalPrimary($factor) |
1847 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1847 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1848 | 1848 | } |
1849 | 1849 | |
1850 | 1850 | /** |
@@ -1859,7 +1859,7 @@ discard block |
||
1859 | 1859 | if ($primary->isConditionalExpression()) { |
1860 | 1860 | $condExpr = $primary->conditionalExpression; |
1861 | 1861 | |
1862 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1862 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1863 | 1863 | } |
1864 | 1864 | } |
1865 | 1865 | |
@@ -1870,7 +1870,7 @@ discard block |
||
1870 | 1870 | { |
1871 | 1871 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1872 | 1872 | |
1873 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1873 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1874 | 1874 | |
1875 | 1875 | return $sql; |
1876 | 1876 | } |
@@ -1914,7 +1914,7 @@ discard block |
||
1914 | 1914 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1915 | 1915 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1916 | 1916 | |
1917 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
1917 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
1918 | 1918 | |
1919 | 1919 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
1920 | 1920 | $sqlParts = []; |
@@ -1922,7 +1922,7 @@ discard block |
||
1922 | 1922 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
1923 | 1923 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
1924 | 1924 | |
1925 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
1925 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
1926 | 1926 | } |
1927 | 1927 | |
1928 | 1928 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1930,7 +1930,7 @@ discard block |
||
1930 | 1930 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1931 | 1931 | } |
1932 | 1932 | |
1933 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
1933 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
1934 | 1934 | } |
1935 | 1935 | |
1936 | 1936 | $sql .= implode(' AND ', $sqlParts); |
@@ -1946,8 +1946,8 @@ discard block |
||
1946 | 1946 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1947 | 1947 | |
1948 | 1948 | // join to target table |
1949 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
1950 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
1949 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
1950 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
1951 | 1951 | |
1952 | 1952 | // join conditions |
1953 | 1953 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1956,7 +1956,7 @@ discard block |
||
1956 | 1956 | foreach ($joinColumns as $joinColumn) { |
1957 | 1957 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
1958 | 1958 | |
1959 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
1959 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
1960 | 1960 | } |
1961 | 1961 | |
1962 | 1962 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -1968,7 +1968,7 @@ discard block |
||
1968 | 1968 | foreach ($joinColumns as $joinColumn) { |
1969 | 1969 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
1970 | 1970 | |
1971 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
1971 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
1972 | 1972 | } |
1973 | 1973 | |
1974 | 1974 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1976,13 +1976,13 @@ discard block |
||
1976 | 1976 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1977 | 1977 | } |
1978 | 1978 | |
1979 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
1979 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
1980 | 1980 | } |
1981 | 1981 | |
1982 | 1982 | $sql .= implode(' AND ', $sqlParts); |
1983 | 1983 | } |
1984 | 1984 | |
1985 | - return $sql . ')'; |
|
1985 | + return $sql.')'; |
|
1986 | 1986 | } |
1987 | 1987 | |
1988 | 1988 | /** |
@@ -1993,7 +1993,7 @@ discard block |
||
1993 | 1993 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
1994 | 1994 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
1995 | 1995 | |
1996 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
1996 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
1997 | 1997 | } |
1998 | 1998 | |
1999 | 1999 | /** |
@@ -2002,19 +2002,19 @@ discard block |
||
2002 | 2002 | public function walkNullComparisonExpression($nullCompExpr) |
2003 | 2003 | { |
2004 | 2004 | $expression = $nullCompExpr->expression; |
2005 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2005 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2006 | 2006 | |
2007 | 2007 | // Handle ResultVariable |
2008 | 2008 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2009 | - return $this->walkResultVariable($expression) . $comparison; |
|
2009 | + return $this->walkResultVariable($expression).$comparison; |
|
2010 | 2010 | } |
2011 | 2011 | |
2012 | 2012 | // Handle InputParameter mapping inclusion to ParserResult |
2013 | 2013 | if ($expression instanceof AST\InputParameter) { |
2014 | - return $this->walkInputParameter($expression) . $comparison; |
|
2014 | + return $this->walkInputParameter($expression).$comparison; |
|
2015 | 2015 | } |
2016 | 2016 | |
2017 | - return $expression->dispatch($this) . $comparison; |
|
2017 | + return $expression->dispatch($this).$comparison; |
|
2018 | 2018 | } |
2019 | 2019 | |
2020 | 2020 | /** |
@@ -2022,7 +2022,7 @@ discard block |
||
2022 | 2022 | */ |
2023 | 2023 | public function walkInExpression($inExpr) |
2024 | 2024 | { |
2025 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2025 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2026 | 2026 | |
2027 | 2027 | $sql .= ($inExpr->subselect) |
2028 | 2028 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2048,10 +2048,10 @@ discard block |
||
2048 | 2048 | } |
2049 | 2049 | |
2050 | 2050 | if ($this->useSqlTableAliases) { |
2051 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
2051 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
2052 | 2052 | } |
2053 | 2053 | |
2054 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2054 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2055 | 2055 | |
2056 | 2056 | $sqlParameterList = []; |
2057 | 2057 | |
@@ -2081,7 +2081,7 @@ discard block |
||
2081 | 2081 | $sqlParameterList[] = $this->conn->quote($discriminatorValue); |
2082 | 2082 | } |
2083 | 2083 | |
2084 | - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; |
|
2084 | + $sql .= '('.implode(', ', $sqlParameterList).')'; |
|
2085 | 2085 | |
2086 | 2086 | return $sql; |
2087 | 2087 | } |
@@ -2127,8 +2127,8 @@ discard block |
||
2127 | 2127 | $sql .= ' NOT'; |
2128 | 2128 | } |
2129 | 2129 | |
2130 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2131 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2130 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2131 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2132 | 2132 | |
2133 | 2133 | return $sql; |
2134 | 2134 | } |
@@ -2143,7 +2143,7 @@ discard block |
||
2143 | 2143 | ? $this->walkResultVariable($stringExpr) |
2144 | 2144 | : $stringExpr->dispatch($this); |
2145 | 2145 | |
2146 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2146 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2147 | 2147 | |
2148 | 2148 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2149 | 2149 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2156,7 +2156,7 @@ discard block |
||
2156 | 2156 | } |
2157 | 2157 | |
2158 | 2158 | if ($likeExpr->escapeChar) { |
2159 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2159 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2160 | 2160 | } |
2161 | 2161 | |
2162 | 2162 | return $sql; |
@@ -2183,7 +2183,7 @@ discard block |
||
2183 | 2183 | ? $leftExpr->dispatch($this) |
2184 | 2184 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2185 | 2185 | |
2186 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2186 | + $sql .= ' '.$compExpr->operator.' '; |
|
2187 | 2187 | |
2188 | 2188 | $sql .= ($rightExpr instanceof AST\Node) |
2189 | 2189 | ? $rightExpr->dispatch($this) |
@@ -2215,7 +2215,7 @@ discard block |
||
2215 | 2215 | { |
2216 | 2216 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2217 | 2217 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2218 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2218 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2219 | 2219 | } |
2220 | 2220 | |
2221 | 2221 | /** |
@@ -2269,7 +2269,7 @@ discard block |
||
2269 | 2269 | |
2270 | 2270 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2271 | 2271 | |
2272 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2272 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2273 | 2273 | } |
2274 | 2274 | |
2275 | 2275 | /** |
@@ -2282,7 +2282,7 @@ discard block |
||
2282 | 2282 | public function walkArithmeticPrimary($primary) |
2283 | 2283 | { |
2284 | 2284 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2285 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2285 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2286 | 2286 | } |
2287 | 2287 | |
2288 | 2288 | if ($primary instanceof AST\Node) { |
@@ -33,7 +33,7 @@ |
||
33 | 33 | /** |
34 | 34 | * @var string |
35 | 35 | */ |
36 | - protected $preSeparator = ''; |
|
36 | + protected $preSeparator = ''; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @var string |
@@ -102,7 +102,7 @@ |
||
102 | 102 | [$pathExpression] |
103 | 103 | ); |
104 | 104 | $expression = new InExpression($arithmeticExpression); |
105 | - $expression->literals[] = new InputParameter(":" . self::PAGINATOR_ID_ALIAS); |
|
105 | + $expression->literals[] = new InputParameter(":".self::PAGINATOR_ID_ALIAS); |
|
106 | 106 | |
107 | 107 | } else { |
108 | 108 | $expression = new NullComparisonExpression($pathExpression); |
@@ -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(ClassMetadataInfo::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'])) { |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | |
1292 | 1292 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1293 | 1293 | $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
1294 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1294 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1295 | 1295 | } |
1296 | 1296 | |
1297 | 1297 | return implode("\n", $lines); |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | |
1320 | 1320 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1321 | 1321 | $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
1322 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1322 | + . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 | return implode("\n", $lines); |
@@ -1382,14 +1382,14 @@ discard block |
||
1382 | 1382 | } |
1383 | 1383 | |
1384 | 1384 | $replacements = [ |
1385 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1386 | - '<methodTypeHint>' => $methodTypeHint, |
|
1387 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1388 | - '<variableName>' => $variableName, |
|
1389 | - '<methodName>' => $methodName, |
|
1390 | - '<fieldName>' => $fieldName, |
|
1391 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1392 | - '<entity>' => $this->getClassName($metadata) |
|
1385 | + '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1386 | + '<methodTypeHint>' => $methodTypeHint, |
|
1387 | + '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1388 | + '<variableName>' => $variableName, |
|
1389 | + '<methodName>' => $methodName, |
|
1390 | + '<fieldName>' => $fieldName, |
|
1391 | + '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1392 | + '<entity>' => $this->getClassName($metadata) |
|
1393 | 1393 | ]; |
1394 | 1394 | |
1395 | 1395 | $method = str_replace( |
@@ -1525,11 +1525,21 @@ |
||
1525 | 1525 | if ($associationMapping['cascade']) { |
1526 | 1526 | $cascades = []; |
1527 | 1527 | |
1528 | - if ($associationMapping['isCascadePersist']) $cascades[] = '"persist"'; |
|
1529 | - if ($associationMapping['isCascadeRemove']) $cascades[] = '"remove"'; |
|
1530 | - if ($associationMapping['isCascadeDetach']) $cascades[] = '"detach"'; |
|
1531 | - if ($associationMapping['isCascadeMerge']) $cascades[] = '"merge"'; |
|
1532 | - if ($associationMapping['isCascadeRefresh']) $cascades[] = '"refresh"'; |
|
1528 | + if ($associationMapping['isCascadePersist']) { |
|
1529 | + $cascades[] = '"persist"'; |
|
1530 | + } |
|
1531 | + if ($associationMapping['isCascadeRemove']) { |
|
1532 | + $cascades[] = '"remove"'; |
|
1533 | + } |
|
1534 | + if ($associationMapping['isCascadeDetach']) { |
|
1535 | + $cascades[] = '"detach"'; |
|
1536 | + } |
|
1537 | + if ($associationMapping['isCascadeMerge']) { |
|
1538 | + $cascades[] = '"merge"'; |
|
1539 | + } |
|
1540 | + if ($associationMapping['isCascadeRefresh']) { |
|
1541 | + $cascades[] = '"refresh"'; |
|
1542 | + } |
|
1533 | 1543 | |
1534 | 1544 | if (count($cascades) === 5) { |
1535 | 1545 | $cascades = ['"all"']; |
@@ -1237,6 +1237,9 @@ |
||
1237 | 1237 | return implode("\n", $lines); |
1238 | 1238 | } |
1239 | 1239 | |
1240 | + /** |
|
1241 | + * @param string $defaultValue |
|
1242 | + */ |
|
1240 | 1243 | protected function generateEntityStubMethod( |
1241 | 1244 | ClassMetadataInfo $metadata, |
1242 | 1245 | string $type, |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory): void |
367 | 367 | { |
368 | - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension; |
|
368 | + $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension; |
|
369 | 369 | $dir = dirname($path); |
370 | 370 | |
371 | 371 | if ( ! is_dir($dir)) { |
@@ -381,8 +381,8 @@ discard block |
||
381 | 381 | } |
382 | 382 | |
383 | 383 | if ($this->backupExisting && file_exists($path)) { |
384 | - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; |
|
385 | - if (!copy($path, $backupPath)) { |
|
384 | + $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~"; |
|
385 | + if ( ! copy($path, $backupPath)) { |
|
386 | 386 | throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); |
387 | 387 | } |
388 | 388 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $body = str_replace('<spaces>', $this->spaces, $body); |
444 | 444 | $last = strrpos($currentCode, '}'); |
445 | 445 | |
446 | - return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n"; |
|
446 | + return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n"; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | public function setFieldVisibility($visibility): void |
508 | 508 | { |
509 | 509 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
510 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
510 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | $this->fieldVisibility = $visibility; |
@@ -602,18 +602,18 @@ discard block |
||
602 | 602 | * |
603 | 603 | * @return string |
604 | 604 | */ |
605 | - protected function generateEntityNamespace(ClassMetadataInfo $metadata): ?string |
|
605 | + protected function generateEntityNamespace(ClassMetadataInfo $metadata): ? string |
|
606 | 606 | { |
607 | - if (!$this->hasNamespace($metadata)) { |
|
607 | + if ( ! $this->hasNamespace($metadata)) { |
|
608 | 608 | return null; |
609 | 609 | } |
610 | 610 | |
611 | - return 'namespace ' . $this->getNamespace($metadata) .';'; |
|
611 | + return 'namespace '.$this->getNamespace($metadata).';'; |
|
612 | 612 | } |
613 | 613 | |
614 | - protected function generateEntityUse(): ?string |
|
614 | + protected function generateEntityUse(): ? string |
|
615 | 615 | { |
616 | - if (!$this->generateAnnotations) { |
|
616 | + if ( ! $this->generateAnnotations) { |
|
617 | 617 | return null; |
618 | 618 | } |
619 | 619 | |
@@ -627,8 +627,8 @@ discard block |
||
627 | 627 | */ |
628 | 628 | protected function generateEntityClassName(ClassMetadataInfo $metadata): string |
629 | 629 | { |
630 | - return 'class ' . $this->getClassName($metadata) . |
|
631 | - ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null); |
|
630 | + return 'class '.$this->getClassName($metadata). |
|
631 | + ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null); |
|
632 | 632 | } |
633 | 633 | |
634 | 634 | /** |
@@ -730,13 +730,13 @@ discard block |
||
730 | 730 | $fieldMappings = array_merge($requiredFields, $optionalFields); |
731 | 731 | |
732 | 732 | foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) { |
733 | - $paramType = '\\' . ltrim($embeddedClass['class'], '\\'); |
|
734 | - $paramVariable = '$' . $fieldName; |
|
733 | + $paramType = '\\'.ltrim($embeddedClass['class'], '\\'); |
|
734 | + $paramVariable = '$'.$fieldName; |
|
735 | 735 | |
736 | 736 | $paramTypes[] = $paramType; |
737 | 737 | $paramVariables[] = $paramVariable; |
738 | - $params[] = $paramType . ' ' . $paramVariable; |
|
739 | - $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';'; |
|
738 | + $params[] = $paramType.' '.$paramVariable; |
|
739 | + $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';'; |
|
740 | 740 | } |
741 | 741 | |
742 | 742 | foreach ($fieldMappings as $fieldMapping) { |
@@ -744,27 +744,27 @@ discard block |
||
744 | 744 | continue; |
745 | 745 | } |
746 | 746 | |
747 | - $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : ''); |
|
748 | - $param = '$' . $fieldMapping['fieldName']; |
|
747 | + $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : ''); |
|
748 | + $param = '$'.$fieldMapping['fieldName']; |
|
749 | 749 | $paramVariables[] = $param; |
750 | 750 | |
751 | 751 | if ($fieldMapping['type'] === 'datetime') { |
752 | - $param = $this->getType($fieldMapping['type']) . ' ' . $param; |
|
752 | + $param = $this->getType($fieldMapping['type']).' '.$param; |
|
753 | 753 | } |
754 | 754 | |
755 | - if (!empty($fieldMapping['nullable'])) { |
|
755 | + if ( ! empty($fieldMapping['nullable'])) { |
|
756 | 756 | $param .= ' = null'; |
757 | 757 | } |
758 | 758 | |
759 | 759 | $params[] = $param; |
760 | 760 | |
761 | - $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';'; |
|
761 | + $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';'; |
|
762 | 762 | } |
763 | 763 | |
764 | 764 | $maxParamTypeLength = max(array_map('strlen', $paramTypes)); |
765 | 765 | $paramTags = array_map( |
766 | - function ($type, $variable) use ($maxParamTypeLength) { |
|
767 | - return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable; |
|
766 | + function($type, $variable) use ($maxParamTypeLength) { |
|
767 | + return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable; |
|
768 | 768 | }, |
769 | 769 | $paramTypes, |
770 | 770 | $paramVariables |
@@ -772,8 +772,8 @@ discard block |
||
772 | 772 | |
773 | 773 | // Generate multi line constructor if the signature exceeds 120 characters. |
774 | 774 | if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) { |
775 | - $delimiter = "\n" . $this->spaces; |
|
776 | - $params = $delimiter . implode(',' . $delimiter, $params) . "\n"; |
|
775 | + $delimiter = "\n".$this->spaces; |
|
776 | + $params = $delimiter.implode(','.$delimiter, $params)."\n"; |
|
777 | 777 | } else { |
778 | 778 | $params = implode(', ', $params); |
779 | 779 | } |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | $replacements = [ |
782 | 782 | '<paramTags>' => implode("\n * ", $paramTags), |
783 | 783 | '<params>' => $params, |
784 | - '<fields>' => implode("\n" . $this->spaces, $fields), |
|
784 | + '<fields>' => implode("\n".$this->spaces, $fields), |
|
785 | 785 | ]; |
786 | 786 | |
787 | 787 | $constructor = str_replace( |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | |
827 | 827 | if ($inClass) { |
828 | 828 | $inClass = false; |
829 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
829 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
830 | 830 | $this->staticReflection[$lastSeenClass]['properties'] = []; |
831 | 831 | $this->staticReflection[$lastSeenClass]['methods'] = []; |
832 | 832 | } |
@@ -834,23 +834,23 @@ discard block |
||
834 | 834 | if (T_NAMESPACE === $token[0]) { |
835 | 835 | $lastSeenNamespace = ''; |
836 | 836 | $inNamespace = true; |
837 | - } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) { |
|
837 | + } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) { |
|
838 | 838 | $inClass = true; |
839 | 839 | } elseif (T_FUNCTION === $token[0]) { |
840 | - if (T_STRING === $tokens[$i+2][0]) { |
|
841 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
842 | - } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) { |
|
843 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
840 | + if (T_STRING === $tokens[$i + 2][0]) { |
|
841 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
842 | + } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) { |
|
843 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
844 | 844 | } |
845 | - } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) { |
|
846 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
845 | + } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) { |
|
846 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
847 | 847 | } |
848 | 848 | } |
849 | 849 | } |
850 | 850 | |
851 | 851 | protected function hasProperty(string $property, ClassMetadataInfo $metadata): bool |
852 | 852 | { |
853 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
853 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
854 | 854 | // don't generate property if its already on the base class. |
855 | 855 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
856 | 856 | if ($reflClass->hasProperty($property)) { |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | |
874 | 874 | protected function hasMethod(string $method, ClassMetadataInfo $metadata): bool |
875 | 875 | { |
876 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
876 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
877 | 877 | // don't generate method if its already on the base class. |
878 | 878 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
879 | 879 | |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | |
898 | 898 | protected function getTraits(ClassMetadataInfo $metadata): array |
899 | 899 | { |
900 | - if (! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
900 | + if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
901 | 901 | return []; |
902 | 902 | } |
903 | 903 | |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | return (bool) $this->classToExtend; |
925 | 925 | } |
926 | 926 | |
927 | - protected function getClassToExtend(): ?string |
|
927 | + protected function getClassToExtend(): ? string |
|
928 | 928 | { |
929 | 929 | return $this->classToExtend; |
930 | 930 | } |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | { |
934 | 934 | $refl = new \ReflectionClass($this->getClassToExtend()); |
935 | 935 | |
936 | - return '\\' . $refl->getName(); |
|
936 | + return '\\'.$refl->getName(); |
|
937 | 937 | } |
938 | 938 | |
939 | 939 | protected function getClassName(ClassMetadataInfo $metadata): string |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | { |
952 | 952 | $lines = []; |
953 | 953 | $lines[] = '/**'; |
954 | - $lines[] = ' * ' . $this->getClassName($metadata); |
|
954 | + $lines[] = ' * '.$this->getClassName($metadata); |
|
955 | 955 | |
956 | 956 | if ($this->generateAnnotations) { |
957 | 957 | $lines[] = ' *'; |
@@ -967,12 +967,12 @@ discard block |
||
967 | 967 | |
968 | 968 | foreach ($methods as $method) { |
969 | 969 | if ($code = $this->$method($metadata)) { |
970 | - $lines[] = ' * ' . $code; |
|
970 | + $lines[] = ' * '.$code; |
|
971 | 971 | } |
972 | 972 | } |
973 | 973 | |
974 | 974 | if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { |
975 | - $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks'; |
|
975 | + $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks'; |
|
976 | 976 | } |
977 | 977 | } |
978 | 978 | |
@@ -983,17 +983,17 @@ discard block |
||
983 | 983 | |
984 | 984 | protected function generateEntityAnnotation(ClassMetadataInfo $metadata): string |
985 | 985 | { |
986 | - $prefix = '@' . $this->annotationsPrefix; |
|
986 | + $prefix = '@'.$this->annotationsPrefix; |
|
987 | 987 | |
988 | 988 | if ($metadata->isEmbeddedClass) { |
989 | - return $prefix . 'Embeddable'; |
|
989 | + return $prefix.'Embeddable'; |
|
990 | 990 | } |
991 | 991 | |
992 | 992 | $customRepository = $metadata->customRepositoryClassName |
993 | - ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")' |
|
993 | + ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")' |
|
994 | 994 | : ''; |
995 | 995 | |
996 | - return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository; |
|
996 | + return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository; |
|
997 | 997 | } |
998 | 998 | |
999 | 999 | protected function generateTableAnnotation(ClassMetadataInfo $metadata): string |
@@ -1005,28 +1005,28 @@ discard block |
||
1005 | 1005 | $table = []; |
1006 | 1006 | |
1007 | 1007 | if (isset($metadata->table['schema'])) { |
1008 | - $table[] = 'schema="' . $metadata->table['schema'] . '"'; |
|
1008 | + $table[] = 'schema="'.$metadata->table['schema'].'"'; |
|
1009 | 1009 | } |
1010 | 1010 | |
1011 | 1011 | if (isset($metadata->table['name'])) { |
1012 | - $table[] = 'name="' . $metadata->table['name'] . '"'; |
|
1012 | + $table[] = 'name="'.$metadata->table['name'].'"'; |
|
1013 | 1013 | } |
1014 | 1014 | |
1015 | 1015 | if (isset($metadata->table['options']) && $metadata->table['options']) { |
1016 | - $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}'; |
|
1016 | + $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}'; |
|
1017 | 1017 | } |
1018 | 1018 | |
1019 | 1019 | if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) { |
1020 | 1020 | $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']); |
1021 | - $table[] = 'uniqueConstraints={' . $constraints . '}'; |
|
1021 | + $table[] = 'uniqueConstraints={'.$constraints.'}'; |
|
1022 | 1022 | } |
1023 | 1023 | |
1024 | 1024 | if (isset($metadata->table['indexes']) && $metadata->table['indexes']) { |
1025 | 1025 | $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']); |
1026 | - $table[] = 'indexes={' . $constraints . '}'; |
|
1026 | + $table[] = 'indexes={'.$constraints.'}'; |
|
1027 | 1027 | } |
1028 | 1028 | |
1029 | - return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; |
|
1029 | + return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')'; |
|
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | protected function generateTableConstraints(string $constraintName, array $constraints): string |
@@ -1035,38 +1035,38 @@ discard block |
||
1035 | 1035 | foreach ($constraints as $name => $constraint) { |
1036 | 1036 | $columns = []; |
1037 | 1037 | foreach ($constraint['columns'] as $column) { |
1038 | - $columns[] = '"' . $column . '"'; |
|
1038 | + $columns[] = '"'.$column.'"'; |
|
1039 | 1039 | } |
1040 | - $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; |
|
1040 | + $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})'; |
|
1041 | 1041 | } |
1042 | 1042 | |
1043 | 1043 | return implode(', ', $annotations); |
1044 | 1044 | } |
1045 | 1045 | |
1046 | - protected function generateInheritanceAnnotation(ClassMetadataInfo $metadata): ?string |
|
1046 | + protected function generateInheritanceAnnotation(ClassMetadataInfo $metadata): ? string |
|
1047 | 1047 | { |
1048 | 1048 | if ($metadata->inheritanceType === ClassMetadataInfo::INHERITANCE_TYPE_NONE) { |
1049 | 1049 | return null; |
1050 | 1050 | } |
1051 | 1051 | |
1052 | - return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1052 | + return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1053 | 1053 | } |
1054 | 1054 | |
1055 | - protected function generateDiscriminatorColumnAnnotation(ClassMetadataInfo $metadata): ?string |
|
1055 | + protected function generateDiscriminatorColumnAnnotation(ClassMetadataInfo $metadata): ? string |
|
1056 | 1056 | { |
1057 | 1057 | if ($metadata->inheritanceType === ClassMetadataInfo::INHERITANCE_TYPE_NONE) { |
1058 | 1058 | return null; |
1059 | 1059 | } |
1060 | 1060 | |
1061 | 1061 | $discrColumn = $metadata->discriminatorColumn; |
1062 | - $columnDefinition = 'name="' . $discrColumn['name'] |
|
1063 | - . '", type="' . $discrColumn['type'] |
|
1064 | - . '", length=' . $discrColumn['length']; |
|
1062 | + $columnDefinition = 'name="'.$discrColumn['name'] |
|
1063 | + . '", type="'.$discrColumn['type'] |
|
1064 | + . '", length='.$discrColumn['length']; |
|
1065 | 1065 | |
1066 | - return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; |
|
1066 | + return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')'; |
|
1067 | 1067 | } |
1068 | 1068 | |
1069 | - protected function generateDiscriminatorMapAnnotation(ClassMetadataInfo $metadata): ?string |
|
1069 | + protected function generateDiscriminatorMapAnnotation(ClassMetadataInfo $metadata): ? string |
|
1070 | 1070 | { |
1071 | 1071 | if ($metadata->inheritanceType === ClassMetadataInfo::INHERITANCE_TYPE_NONE) { |
1072 | 1072 | return null; |
@@ -1075,10 +1075,10 @@ discard block |
||
1075 | 1075 | $inheritanceClassMap = []; |
1076 | 1076 | |
1077 | 1077 | foreach ($metadata->discriminatorMap as $type => $class) { |
1078 | - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; |
|
1078 | + $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"'; |
|
1079 | 1079 | } |
1080 | 1080 | |
1081 | - return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; |
|
1081 | + return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})'; |
|
1082 | 1082 | } |
1083 | 1083 | |
1084 | 1084 | protected function generateEntityStubMethods(ClassMetadataInfo $metadata): string |
@@ -1092,8 +1092,8 @@ discard block |
||
1092 | 1092 | |
1093 | 1093 | $nullableField = $this->nullableFieldExpression($fieldMapping); |
1094 | 1094 | |
1095 | - if ((!$metadata->isEmbeddedClass || !$this->embeddablesImmutable) |
|
1096 | - && (!isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1095 | + if (( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable) |
|
1096 | + && ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1097 | 1097 | && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField) |
1098 | 1098 | ) { |
1099 | 1099 | $methods[] = $code; |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | } |
1160 | 1160 | |
1161 | 1161 | foreach ($joinColumns as $joinColumn) { |
1162 | - if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) { |
|
1162 | + if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) { |
|
1163 | 1163 | return false; |
1164 | 1164 | } |
1165 | 1165 | } |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | return true; |
1168 | 1168 | } |
1169 | 1169 | |
1170 | - protected function generateEntityLifecycleCallbackMethods(ClassMetadataInfo $metadata): ?string |
|
1170 | + protected function generateEntityLifecycleCallbackMethods(ClassMetadataInfo $metadata): ? string |
|
1171 | 1171 | { |
1172 | 1172 | if (empty($metadata->lifecycleCallbacks)) { |
1173 | 1173 | return null; |
@@ -1194,8 +1194,8 @@ discard block |
||
1194 | 1194 | } |
1195 | 1195 | |
1196 | 1196 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1197 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
|
1198 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1197 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName'] |
|
1198 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n"; |
|
1199 | 1199 | } |
1200 | 1200 | |
1201 | 1201 | return implode("\n", $lines); |
@@ -1214,8 +1214,8 @@ discard block |
||
1214 | 1214 | } |
1215 | 1215 | |
1216 | 1216 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1217 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
|
1218 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1217 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName'] |
|
1218 | + . (isset($fieldMapping['options']['default']) ? ' = '.var_export($fieldMapping['options']['default'], true) : null).";\n"; |
|
1219 | 1219 | } |
1220 | 1220 | |
1221 | 1221 | return implode("\n", $lines); |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | } |
1232 | 1232 | |
1233 | 1233 | $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass); |
1234 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n"; |
|
1234 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n"; |
|
1235 | 1235 | } |
1236 | 1236 | |
1237 | 1237 | return implode("\n", $lines); |
@@ -1241,10 +1241,10 @@ discard block |
||
1241 | 1241 | ClassMetadataInfo $metadata, |
1242 | 1242 | string $type, |
1243 | 1243 | string $fieldName, |
1244 | - ?string $typeHint = null, |
|
1245 | - ?string $defaultValue = null): string |
|
1244 | + ? string $typeHint = null, |
|
1245 | + ? string $defaultValue = null) : string |
|
1246 | 1246 | { |
1247 | - $methodName = $type . Inflector::classify($fieldName); |
|
1247 | + $methodName = $type.Inflector::classify($fieldName); |
|
1248 | 1248 | $variableName = Inflector::camelize($fieldName); |
1249 | 1249 | if (in_array($type, ["add", "remove"])) { |
1250 | 1250 | $methodName = Inflector::singularize($methodName); |
@@ -1264,18 +1264,18 @@ discard block |
||
1264 | 1264 | $variableType = $typeHint ? $this->getType($typeHint) : null; |
1265 | 1265 | |
1266 | 1266 | if ($typeHint && ! isset($types[$typeHint])) { |
1267 | - $variableType = '\\' . ltrim($variableType, '\\'); |
|
1268 | - $methodTypeHint = '\\' . $typeHint . ' '; |
|
1267 | + $variableType = '\\'.ltrim($variableType, '\\'); |
|
1268 | + $methodTypeHint = '\\'.$typeHint.' '; |
|
1269 | 1269 | } |
1270 | 1270 | |
1271 | 1271 | $replacements = [ |
1272 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1272 | + '<description>' => ucfirst($type).' '.$variableName.'.', |
|
1273 | 1273 | '<methodTypeHint>' => $methodTypeHint, |
1274 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1274 | + '<variableType>' => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''), |
|
1275 | 1275 | '<variableName>' => $variableName, |
1276 | 1276 | '<methodName>' => $methodName, |
1277 | 1277 | '<fieldName>' => $fieldName, |
1278 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1278 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '', |
|
1279 | 1279 | '<entity>' => $this->getClassName($metadata) |
1280 | 1280 | ]; |
1281 | 1281 | |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | return $this->prefixCodeWithSpaces($method); |
1289 | 1289 | } |
1290 | 1290 | |
1291 | - protected function generateLifecycleCallbackMethod(string $name, string $methodName, ClassMetadataInfo $metadata): ?string |
|
1291 | + protected function generateLifecycleCallbackMethod(string $name, string $methodName, ClassMetadataInfo $metadata): ? string |
|
1292 | 1292 | { |
1293 | 1293 | if ($this->hasMethod($methodName, $metadata)) { |
1294 | 1294 | return null; |
@@ -1297,7 +1297,7 @@ discard block |
||
1297 | 1297 | $this->staticReflection[$metadata->name]['methods'][] = $methodName; |
1298 | 1298 | |
1299 | 1299 | $replacements = [ |
1300 | - '<name>' => $this->annotationsPrefix . ucfirst($name), |
|
1300 | + '<name>' => $this->annotationsPrefix.ucfirst($name), |
|
1301 | 1301 | '<methodName>' => $methodName, |
1302 | 1302 | ]; |
1303 | 1303 | |
@@ -1315,51 +1315,51 @@ discard block |
||
1315 | 1315 | $joinColumnAnnot = []; |
1316 | 1316 | |
1317 | 1317 | if (isset($joinColumn['name'])) { |
1318 | - $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"'; |
|
1318 | + $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"'; |
|
1319 | 1319 | } |
1320 | 1320 | |
1321 | 1321 | if (isset($joinColumn['referencedColumnName'])) { |
1322 | - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"'; |
|
1322 | + $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"'; |
|
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 | if (isset($joinColumn['unique']) && $joinColumn['unique']) { |
1326 | - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); |
|
1326 | + $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false'); |
|
1327 | 1327 | } |
1328 | 1328 | |
1329 | 1329 | if (isset($joinColumn['nullable'])) { |
1330 | - $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false'); |
|
1330 | + $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false'); |
|
1331 | 1331 | } |
1332 | 1332 | |
1333 | 1333 | if (isset($joinColumn['onDelete'])) { |
1334 | - $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"'); |
|
1334 | + $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"'); |
|
1335 | 1335 | } |
1336 | 1336 | |
1337 | 1337 | if (isset($joinColumn['columnDefinition'])) { |
1338 | - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; |
|
1338 | + $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"'; |
|
1339 | 1339 | } |
1340 | 1340 | |
1341 | - return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; |
|
1341 | + return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')'; |
|
1342 | 1342 | } |
1343 | 1343 | |
1344 | 1344 | protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata): string |
1345 | 1345 | { |
1346 | 1346 | $lines = []; |
1347 | - $lines[] = $this->spaces . '/**'; |
|
1347 | + $lines[] = $this->spaces.'/**'; |
|
1348 | 1348 | |
1349 | 1349 | if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { |
1350 | - $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection'; |
|
1350 | + $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection'; |
|
1351 | 1351 | } else { |
1352 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\'); |
|
1352 | + $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\'); |
|
1353 | 1353 | } |
1354 | 1354 | |
1355 | 1355 | if ($this->generateAnnotations) { |
1356 | - $lines[] = $this->spaces . ' *'; |
|
1356 | + $lines[] = $this->spaces.' *'; |
|
1357 | 1357 | |
1358 | 1358 | if (isset($associationMapping['id']) && $associationMapping['id']) { |
1359 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1359 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1360 | 1360 | |
1361 | 1361 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1362 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1362 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1363 | 1363 | } |
1364 | 1364 | } |
1365 | 1365 | |
@@ -1381,15 +1381,15 @@ discard block |
||
1381 | 1381 | $typeOptions = []; |
1382 | 1382 | |
1383 | 1383 | if (isset($associationMapping['targetEntity'])) { |
1384 | - $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"'; |
|
1384 | + $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"'; |
|
1385 | 1385 | } |
1386 | 1386 | |
1387 | 1387 | if (isset($associationMapping['inversedBy'])) { |
1388 | - $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"'; |
|
1388 | + $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"'; |
|
1389 | 1389 | } |
1390 | 1390 | |
1391 | 1391 | if (isset($associationMapping['mappedBy'])) { |
1392 | - $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"'; |
|
1392 | + $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"'; |
|
1393 | 1393 | } |
1394 | 1394 | |
1395 | 1395 | if ($associationMapping['cascade']) { |
@@ -1405,11 +1405,11 @@ discard block |
||
1405 | 1405 | $cascades = ['"all"']; |
1406 | 1406 | } |
1407 | 1407 | |
1408 | - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; |
|
1408 | + $typeOptions[] = 'cascade={'.implode(',', $cascades).'}'; |
|
1409 | 1409 | } |
1410 | 1410 | |
1411 | 1411 | if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { |
1412 | - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1412 | + $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1413 | 1413 | } |
1414 | 1414 | |
1415 | 1415 | if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) { |
@@ -1418,71 +1418,71 @@ discard block |
||
1418 | 1418 | ClassMetadataInfo::FETCH_EAGER => 'EAGER', |
1419 | 1419 | ]; |
1420 | 1420 | |
1421 | - $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"'; |
|
1421 | + $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"'; |
|
1422 | 1422 | } |
1423 | 1423 | |
1424 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; |
|
1424 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')'; |
|
1425 | 1425 | |
1426 | 1426 | if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) { |
1427 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({'; |
|
1427 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({'; |
|
1428 | 1428 | |
1429 | 1429 | $joinColumnsLines = []; |
1430 | 1430 | |
1431 | 1431 | foreach ($associationMapping['joinColumns'] as $joinColumn) { |
1432 | 1432 | if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) { |
1433 | - $joinColumnsLines[] = $this->spaces . ' * ' . $joinColumnAnnot; |
|
1433 | + $joinColumnsLines[] = $this->spaces.' * '.$joinColumnAnnot; |
|
1434 | 1434 | } |
1435 | 1435 | } |
1436 | 1436 | |
1437 | 1437 | $lines[] = implode(",\n", $joinColumnsLines); |
1438 | - $lines[] = $this->spaces . ' * })'; |
|
1438 | + $lines[] = $this->spaces.' * })'; |
|
1439 | 1439 | } |
1440 | 1440 | |
1441 | 1441 | if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { |
1442 | 1442 | $joinTable = []; |
1443 | - $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"'; |
|
1443 | + $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"'; |
|
1444 | 1444 | |
1445 | 1445 | if (isset($associationMapping['joinTable']['schema'])) { |
1446 | - $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"'; |
|
1446 | + $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"'; |
|
1447 | 1447 | } |
1448 | 1448 | |
1449 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ','; |
|
1450 | - $lines[] = $this->spaces . ' * joinColumns={'; |
|
1449 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).','; |
|
1450 | + $lines[] = $this->spaces.' * joinColumns={'; |
|
1451 | 1451 | |
1452 | 1452 | $joinColumnsLines = []; |
1453 | 1453 | |
1454 | 1454 | foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { |
1455 | - $joinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1455 | + $joinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1456 | 1456 | } |
1457 | 1457 | |
1458 | - $lines[] = implode(",". PHP_EOL, $joinColumnsLines); |
|
1459 | - $lines[] = $this->spaces . ' * },'; |
|
1460 | - $lines[] = $this->spaces . ' * inverseJoinColumns={'; |
|
1458 | + $lines[] = implode(",".PHP_EOL, $joinColumnsLines); |
|
1459 | + $lines[] = $this->spaces.' * },'; |
|
1460 | + $lines[] = $this->spaces.' * inverseJoinColumns={'; |
|
1461 | 1461 | |
1462 | 1462 | $inverseJoinColumnsLines = []; |
1463 | 1463 | |
1464 | 1464 | foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) { |
1465 | - $inverseJoinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1465 | + $inverseJoinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1466 | 1466 | } |
1467 | 1467 | |
1468 | - $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines); |
|
1469 | - $lines[] = $this->spaces . ' * }'; |
|
1470 | - $lines[] = $this->spaces . ' * )'; |
|
1468 | + $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines); |
|
1469 | + $lines[] = $this->spaces.' * }'; |
|
1470 | + $lines[] = $this->spaces.' * )'; |
|
1471 | 1471 | } |
1472 | 1472 | |
1473 | 1473 | if (isset($associationMapping['orderBy'])) { |
1474 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({'; |
|
1474 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({'; |
|
1475 | 1475 | |
1476 | 1476 | foreach ($associationMapping['orderBy'] as $name => $direction) { |
1477 | - $lines[] = $this->spaces . ' * "' . $name . '"="' . $direction . '",'; |
|
1477 | + $lines[] = $this->spaces.' * "'.$name.'"="'.$direction.'",'; |
|
1478 | 1478 | } |
1479 | 1479 | |
1480 | 1480 | $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1); |
1481 | - $lines[] = $this->spaces . ' * })'; |
|
1481 | + $lines[] = $this->spaces.' * })'; |
|
1482 | 1482 | } |
1483 | 1483 | } |
1484 | 1484 | |
1485 | - $lines[] = $this->spaces . ' */'; |
|
1485 | + $lines[] = $this->spaces.' */'; |
|
1486 | 1486 | |
1487 | 1487 | return implode("\n", $lines); |
1488 | 1488 | } |
@@ -1490,37 +1490,37 @@ discard block |
||
1490 | 1490 | protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata): string |
1491 | 1491 | { |
1492 | 1492 | $lines = []; |
1493 | - $lines[] = $this->spaces . '/**'; |
|
1494 | - $lines[] = $this->spaces . ' * @var ' |
|
1493 | + $lines[] = $this->spaces.'/**'; |
|
1494 | + $lines[] = $this->spaces.' * @var ' |
|
1495 | 1495 | . $this->getType($fieldMapping['type']) |
1496 | 1496 | . ($this->nullableFieldExpression($fieldMapping) ? '|null' : ''); |
1497 | 1497 | |
1498 | 1498 | if ($this->generateAnnotations) { |
1499 | - $lines[] = $this->spaces . ' *'; |
|
1499 | + $lines[] = $this->spaces.' *'; |
|
1500 | 1500 | |
1501 | 1501 | $column = []; |
1502 | 1502 | if (isset($fieldMapping['columnName'])) { |
1503 | - $column[] = 'name="' . $fieldMapping['columnName'] . '"'; |
|
1503 | + $column[] = 'name="'.$fieldMapping['columnName'].'"'; |
|
1504 | 1504 | } |
1505 | 1505 | |
1506 | 1506 | if (isset($fieldMapping['type'])) { |
1507 | - $column[] = 'type="' . $fieldMapping['type'] . '"'; |
|
1507 | + $column[] = 'type="'.$fieldMapping['type'].'"'; |
|
1508 | 1508 | } |
1509 | 1509 | |
1510 | 1510 | if (isset($fieldMapping['length'])) { |
1511 | - $column[] = 'length=' . $fieldMapping['length']; |
|
1511 | + $column[] = 'length='.$fieldMapping['length']; |
|
1512 | 1512 | } |
1513 | 1513 | |
1514 | 1514 | if (isset($fieldMapping['precision'])) { |
1515 | - $column[] = 'precision=' . $fieldMapping['precision']; |
|
1515 | + $column[] = 'precision='.$fieldMapping['precision']; |
|
1516 | 1516 | } |
1517 | 1517 | |
1518 | 1518 | if (isset($fieldMapping['scale'])) { |
1519 | - $column[] = 'scale=' . $fieldMapping['scale']; |
|
1519 | + $column[] = 'scale='.$fieldMapping['scale']; |
|
1520 | 1520 | } |
1521 | 1521 | |
1522 | 1522 | if (isset($fieldMapping['nullable'])) { |
1523 | - $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); |
|
1523 | + $column[] = 'nullable='.var_export($fieldMapping['nullable'], true); |
|
1524 | 1524 | } |
1525 | 1525 | |
1526 | 1526 | $options = []; |
@@ -1534,47 +1534,47 @@ discard block |
||
1534 | 1534 | } |
1535 | 1535 | |
1536 | 1536 | if (isset($fieldMapping['columnDefinition'])) { |
1537 | - $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; |
|
1537 | + $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"'; |
|
1538 | 1538 | } |
1539 | 1539 | |
1540 | 1540 | if (isset($fieldMapping['unique'])) { |
1541 | - $column[] = 'unique=' . var_export($fieldMapping['unique'], true); |
|
1541 | + $column[] = 'unique='.var_export($fieldMapping['unique'], true); |
|
1542 | 1542 | } |
1543 | 1543 | |
1544 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; |
|
1544 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')'; |
|
1545 | 1545 | |
1546 | 1546 | if (isset($fieldMapping['id']) && $fieldMapping['id']) { |
1547 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1547 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1548 | 1548 | |
1549 | 1549 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1550 | - $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1550 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1551 | 1551 | } |
1552 | 1552 | |
1553 | 1553 | if ($metadata->sequenceGeneratorDefinition) { |
1554 | 1554 | $sequenceGenerator = []; |
1555 | 1555 | |
1556 | 1556 | if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) { |
1557 | - $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"'; |
|
1557 | + $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"'; |
|
1558 | 1558 | } |
1559 | 1559 | |
1560 | 1560 | if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) { |
1561 | - $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1561 | + $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1562 | 1562 | } |
1563 | 1563 | |
1564 | 1564 | if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) { |
1565 | - $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; |
|
1565 | + $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue']; |
|
1566 | 1566 | } |
1567 | 1567 | |
1568 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')'; |
|
1568 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')'; |
|
1569 | 1569 | } |
1570 | 1570 | } |
1571 | 1571 | |
1572 | 1572 | if (isset($fieldMapping['version']) && $fieldMapping['version']) { |
1573 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version'; |
|
1573 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version'; |
|
1574 | 1574 | } |
1575 | 1575 | } |
1576 | 1576 | |
1577 | - $lines[] = $this->spaces . ' */'; |
|
1577 | + $lines[] = $this->spaces.' */'; |
|
1578 | 1578 | |
1579 | 1579 | return implode("\n", $lines); |
1580 | 1580 | } |
@@ -1582,32 +1582,32 @@ discard block |
||
1582 | 1582 | protected function generateEmbeddedPropertyDocBlock(array $embeddedClass): string |
1583 | 1583 | { |
1584 | 1584 | $lines = []; |
1585 | - $lines[] = $this->spaces . '/**'; |
|
1586 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\'); |
|
1585 | + $lines[] = $this->spaces.'/**'; |
|
1586 | + $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\'); |
|
1587 | 1587 | |
1588 | 1588 | if ($this->generateAnnotations) { |
1589 | - $lines[] = $this->spaces . ' *'; |
|
1589 | + $lines[] = $this->spaces.' *'; |
|
1590 | 1590 | |
1591 | - $embedded = ['class="' . $embeddedClass['class'] . '"']; |
|
1591 | + $embedded = ['class="'.$embeddedClass['class'].'"']; |
|
1592 | 1592 | |
1593 | 1593 | if (isset($embeddedClass['columnPrefix'])) { |
1594 | 1594 | if (is_string($embeddedClass['columnPrefix'])) { |
1595 | - $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"'; |
|
1595 | + $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"'; |
|
1596 | 1596 | } else { |
1597 | - $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true); |
|
1597 | + $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true); |
|
1598 | 1598 | } |
1599 | 1599 | } |
1600 | 1600 | |
1601 | - $lines[] = $this->spaces . ' * @' . |
|
1602 | - $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')'; |
|
1601 | + $lines[] = $this->spaces.' * @'. |
|
1602 | + $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')'; |
|
1603 | 1603 | } |
1604 | 1604 | |
1605 | - $lines[] = $this->spaces . ' */'; |
|
1605 | + $lines[] = $this->spaces.' */'; |
|
1606 | 1606 | |
1607 | 1607 | return implode("\n", $lines); |
1608 | 1608 | } |
1609 | 1609 | |
1610 | - protected function generateEntityListenerAnnotation(ClassMetadataInfo $metadata): ?string |
|
1610 | + protected function generateEntityListenerAnnotation(ClassMetadataInfo $metadata): ? string |
|
1611 | 1611 | { |
1612 | 1612 | if (0 === \count($metadata->entityListeners)) { |
1613 | 1613 | return null; |
@@ -1616,13 +1616,13 @@ discard block |
||
1616 | 1616 | $processedClasses = []; |
1617 | 1617 | foreach ($metadata->entityListeners as $event => $eventListeners) { |
1618 | 1618 | foreach ($eventListeners as $eventListener) { |
1619 | - $processedClasses[] = '"' . $eventListener['class'] . '"'; |
|
1619 | + $processedClasses[] = '"'.$eventListener['class'].'"'; |
|
1620 | 1620 | } |
1621 | 1621 | } |
1622 | 1622 | |
1623 | 1623 | return \sprintf( |
1624 | 1624 | '%s%s({%s})', |
1625 | - '@' . $this->annotationsPrefix, |
|
1625 | + '@'.$this->annotationsPrefix, |
|
1626 | 1626 | 'EntityListeners', |
1627 | 1627 | \implode(',', \array_unique($processedClasses)) |
1628 | 1628 | ); |
@@ -1634,7 +1634,7 @@ discard block |
||
1634 | 1634 | |
1635 | 1635 | foreach ($lines as $key => $value) { |
1636 | 1636 | if ( ! empty($value)) { |
1637 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1637 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1638 | 1638 | } |
1639 | 1639 | } |
1640 | 1640 | |
@@ -1689,7 +1689,7 @@ discard block |
||
1689 | 1689 | return static::$generatorStrategyMap[$type]; |
1690 | 1690 | } |
1691 | 1691 | |
1692 | - private function nullableFieldExpression(array $fieldMapping): ?string |
|
1692 | + private function nullableFieldExpression(array $fieldMapping): ? string |
|
1693 | 1693 | { |
1694 | 1694 | if (isset($fieldMapping['nullable']) && true === $fieldMapping['nullable']) { |
1695 | 1695 | return 'null'; |
@@ -1711,9 +1711,9 @@ discard block |
||
1711 | 1711 | |
1712 | 1712 | foreach ($options as $name => $option) { |
1713 | 1713 | if (is_array($option)) { |
1714 | - $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}'; |
|
1714 | + $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}'; |
|
1715 | 1715 | } else { |
1716 | - $optionsStr[] = '"' . $name . '"="' . (string) $option . '"'; |
|
1716 | + $optionsStr[] = '"'.$name.'"="'.(string) $option.'"'; |
|
1717 | 1717 | } |
1718 | 1718 | } |
1719 | 1719 |
@@ -721,13 +721,13 @@ |
||
721 | 721 | return $joinColumn; |
722 | 722 | } |
723 | 723 | |
724 | - /** |
|
725 | - * Parses the given field as array. |
|
726 | - * |
|
727 | - * @param SimpleXMLElement $fieldMapping |
|
728 | - * |
|
729 | - * @return array |
|
730 | - */ |
|
724 | + /** |
|
725 | + * Parses the given field as array. |
|
726 | + * |
|
727 | + * @param SimpleXMLElement $fieldMapping |
|
728 | + * |
|
729 | + * @return array |
|
730 | + */ |
|
731 | 731 | private function columnToArray(SimpleXMLElement $fieldMapping) |
732 | 732 | { |
733 | 733 | $mapping = [ |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | if (isset($xmlRoot['inheritance-type'])) { |
166 | 166 | $inheritanceType = (string) $xmlRoot['inheritance-type']; |
167 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType)); |
|
167 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceType)); |
|
168 | 168 | |
169 | 169 | if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) { |
170 | 170 | // Evaluate <discriminator-column...> |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | if (isset($oneToOneElement['fetch'])) { |
369 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToOneElement['fetch']); |
|
369 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToOneElement['fetch']); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | if (isset($oneToOneElement['mapped-by'])) { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ]; |
416 | 416 | |
417 | 417 | if (isset($oneToManyElement['fetch'])) { |
418 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToManyElement['fetch']); |
|
418 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToManyElement['fetch']); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | if (isset($oneToManyElement->cascade)) { |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | } |
463 | 463 | |
464 | 464 | if (isset($manyToOneElement['fetch'])) { |
465 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToOneElement['fetch']); |
|
465 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToOneElement['fetch']); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | if (isset($manyToOneElement['inversed-by'])) { |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | ]; |
505 | 505 | |
506 | 506 | if (isset($manyToManyElement['fetch'])) { |
507 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToManyElement['fetch']); |
|
507 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToManyElement['fetch']); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | if (isset($manyToManyElement['orphan-removal'])) { |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | |
625 | 625 | // Check for `fetch` |
626 | 626 | if (isset($overrideElement['fetch'])) { |
627 | - $override['fetch'] = constant(Metadata::class . '::FETCH_' . (string) $overrideElement['fetch']); |
|
627 | + $override['fetch'] = constant(Metadata::class.'::FETCH_'.(string) $overrideElement['fetch']); |
|
628 | 628 | } |
629 | 629 | |
630 | 630 | $metadata->setAssociationOverride($fieldName, $override); |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | // Evaluate <lifecycle-callbacks...> |
635 | 635 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
636 | 636 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
637 | - $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::' . (string) $lifecycleCallback['type'])); |
|
637 | + $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::'.(string) $lifecycleCallback['type'])); |
|
638 | 638 | } |
639 | 639 | } |
640 | 640 | |
@@ -795,12 +795,12 @@ discard block |
||
795 | 795 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
796 | 796 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
797 | 797 | |
798 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
798 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
799 | 799 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
800 | 800 | } |
801 | 801 | |
802 | 802 | if ($usage) { |
803 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
803 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | return [ |