@@ -18,16 +18,16 @@ |
||
18 | 18 | public function providerParameterTypeInferer() |
19 | 19 | { |
20 | 20 | $data = [ |
21 | - [1, Type::INTEGER], |
|
22 | - ['bar', Type::STRING], |
|
23 | - ['1', Type::STRING], |
|
24 | - [new DateTime(), Type::DATETIME], |
|
21 | + [1, Type::INTEGER], |
|
22 | + ['bar', Type::STRING], |
|
23 | + ['1', Type::STRING], |
|
24 | + [new DateTime(), Type::DATETIME], |
|
25 | 25 | [new DateInterval('P1D'), Type::DATEINTERVAL], |
26 | - [[2], Connection::PARAM_INT_ARRAY], |
|
27 | - [['foo'], Connection::PARAM_STR_ARRAY], |
|
28 | - [['1','2'], Connection::PARAM_STR_ARRAY], |
|
29 | - [[], Connection::PARAM_STR_ARRAY], |
|
30 | - [true, Type::BOOLEAN], |
|
26 | + [[2], Connection::PARAM_INT_ARRAY], |
|
27 | + [['foo'], Connection::PARAM_STR_ARRAY], |
|
28 | + [['1', '2'], Connection::PARAM_STR_ARRAY], |
|
29 | + [[], Connection::PARAM_STR_ARRAY], |
|
30 | + [true, Type::BOOLEAN], |
|
31 | 31 | ]; |
32 | 32 | |
33 | 33 | if (PHP_VERSION_ID >= 50500) { |
@@ -36,37 +36,37 @@ |
||
36 | 36 | $dql = 'SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u'; |
37 | 37 | |
38 | 38 | $users = $this->em->createQuery($dql) |
39 | - ->setHydrationCacheProfile(new QueryCacheProfile(0, null, $cache)) |
|
40 | - ->getResult(); |
|
39 | + ->setHydrationCacheProfile(new QueryCacheProfile(0, null, $cache)) |
|
40 | + ->getResult(); |
|
41 | 41 | |
42 | 42 | $c = $this->getCurrentQueryCount(); |
43 | 43 | $users = $this->em->createQuery($dql) |
44 | - ->setHydrationCacheProfile(new QueryCacheProfile(0, null, $cache)) |
|
45 | - ->getResult(); |
|
44 | + ->setHydrationCacheProfile(new QueryCacheProfile(0, null, $cache)) |
|
45 | + ->getResult(); |
|
46 | 46 | |
47 | 47 | self::assertEquals($c, $this->getCurrentQueryCount(), 'Should not execute query. Its cached!'); |
48 | 48 | |
49 | 49 | $users = $this->em->createQuery($dql) |
50 | - ->setHydrationCacheProfile(new QueryCacheProfile(0, null, $cache)) |
|
51 | - ->getArrayResult(); |
|
50 | + ->setHydrationCacheProfile(new QueryCacheProfile(0, null, $cache)) |
|
51 | + ->getArrayResult(); |
|
52 | 52 | |
53 | 53 | self::assertEquals($c + 1, $this->getCurrentQueryCount(), 'Hydration is part of cache key.'); |
54 | 54 | |
55 | 55 | $users = $this->em->createQuery($dql) |
56 | - ->setHydrationCacheProfile(new QueryCacheProfile(0, null, $cache)) |
|
57 | - ->getArrayResult(); |
|
56 | + ->setHydrationCacheProfile(new QueryCacheProfile(0, null, $cache)) |
|
57 | + ->getArrayResult(); |
|
58 | 58 | |
59 | 59 | self::assertEquals($c + 1, $this->getCurrentQueryCount(), 'Hydration now cached'); |
60 | 60 | |
61 | 61 | $users = $this->em->createQuery($dql) |
62 | - ->setHydrationCacheProfile(new QueryCacheProfile(0, 'cachekey', $cache)) |
|
63 | - ->getArrayResult(); |
|
62 | + ->setHydrationCacheProfile(new QueryCacheProfile(0, 'cachekey', $cache)) |
|
63 | + ->getArrayResult(); |
|
64 | 64 | |
65 | 65 | self::assertTrue($cache->contains('cachekey'), 'Explicit cache key'); |
66 | 66 | |
67 | 67 | $users = $this->em->createQuery($dql) |
68 | - ->setHydrationCacheProfile(new QueryCacheProfile(0, 'cachekey', $cache)) |
|
69 | - ->getArrayResult(); |
|
68 | + ->setHydrationCacheProfile(new QueryCacheProfile(0, 'cachekey', $cache)) |
|
69 | + ->getArrayResult(); |
|
70 | 70 | |
71 | 71 | self::assertEquals($c + 2, $this->getCurrentQueryCount(), 'Hydration now cached'); |
72 | 72 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | /** Special case EntityManager::transactional() */ |
56 | 56 | if ($method->getName() === 'transactional') { |
57 | - $staticVoidFunction = static function () { |
|
57 | + $staticVoidFunction = static function() { |
|
58 | 58 | }; |
59 | 59 | |
60 | 60 | return [$method->getName(), [$staticVoidFunction]]; |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
271 | 271 | { |
272 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
272 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
273 | 273 | |
274 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
275 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
274 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
275 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | return $this->tableAliasMap[$tableName]; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | */ |
291 | 291 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
292 | 292 | { |
293 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
293 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
294 | 294 | |
295 | 295 | $this->tableAliasMap[$tableName] = $alias; |
296 | 296 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function getSQLColumnAlias() |
306 | 306 | { |
307 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
307 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | /** |
@@ -331,14 +331,14 @@ discard block |
||
331 | 331 | |
332 | 332 | // If this is a joined association we must use left joins to preserve the correct result. |
333 | 333 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
334 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
334 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
335 | 335 | |
336 | 336 | $sqlParts = []; |
337 | 337 | |
338 | 338 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
339 | 339 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
340 | 340 | |
341 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
341 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | $filterSql = $this->generateFilterConditionSQL($parentClass, $tableAlias); |
@@ -362,14 +362,14 @@ discard block |
||
362 | 362 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
363 | 363 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
364 | 364 | |
365 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
365 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
366 | 366 | |
367 | 367 | $sqlParts = []; |
368 | 368 | |
369 | 369 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
370 | 370 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
371 | 371 | |
372 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
372 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | $sql .= implode(' AND ', $sqlParts); |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $qComp = $this->queryComponents[$dqlAlias]; |
391 | 391 | $association = $qComp['relation']; |
392 | 392 | |
393 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
393 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
394 | 394 | continue; |
395 | 395 | } |
396 | 396 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $property = $qComp['metadata']->getProperty($fieldName); |
399 | 399 | $tableName = $property->getTableName(); |
400 | 400 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
401 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
401 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
402 | 402 | |
403 | 403 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
404 | 404 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | } |
407 | 407 | |
408 | 408 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
409 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
409 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
410 | 410 | } |
411 | 411 | } |
412 | 412 | |
@@ -446,19 +446,19 @@ discard block |
||
446 | 446 | $discrColumnType = $discrColumn->getType(); |
447 | 447 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
448 | 448 | $sqlTableAlias = $this->useSqlTableAliases |
449 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
449 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
450 | 450 | : ''; |
451 | 451 | |
452 | 452 | $sqlParts[] = sprintf( |
453 | 453 | '%s IN (%s)', |
454 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
454 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
455 | 455 | implode(', ', $values) |
456 | 456 | ); |
457 | 457 | } |
458 | 458 | |
459 | 459 | $sql = implode(' AND ', $sqlParts); |
460 | 460 | |
461 | - return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql; |
|
461 | + return isset($sqlParts[1]) ? '('.$sql.')' : $sql; |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | /** |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | */ |
472 | 472 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
473 | 473 | { |
474 | - if (! $this->em->hasFilters()) { |
|
474 | + if ( ! $this->em->hasFilters()) { |
|
475 | 475 | return ''; |
476 | 476 | } |
477 | 477 | |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
505 | 505 | |
506 | 506 | if ($filterExpr !== '') { |
507 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
507 | + $filterClauses[] = '('.$filterExpr.')'; |
|
508 | 508 | } |
509 | 509 | } |
510 | 510 | |
@@ -535,11 +535,11 @@ discard block |
||
535 | 535 | $sql .= $this->walkOrderByClause($AST->orderByClause); |
536 | 536 | } |
537 | 537 | |
538 | - if (! $AST->orderByClause) { |
|
538 | + if ( ! $AST->orderByClause) { |
|
539 | 539 | $orderBySql = $this->generateOrderedCollectionOrderByItems(); |
540 | 540 | |
541 | 541 | if ($orderBySql) { |
542 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
542 | + $sql .= ' ORDER BY '.$orderBySql; |
|
543 | 543 | } |
544 | 544 | } |
545 | 545 | |
@@ -552,11 +552,11 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
555 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
555 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
559 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
559 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | } |
565 | 565 | |
566 | 566 | foreach ($this->selectedClasses as $selectedClass) { |
567 | - if (! $selectedClass['class']->isVersioned()) { |
|
567 | + if ( ! $selectedClass['class']->isVersioned()) { |
|
568 | 568 | throw OptimisticLockException::lockFailed($selectedClass['class']->getClassName()); |
569 | 569 | } |
570 | 570 | } |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
614 | 614 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
615 | 615 | |
616 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
616 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | return implode(', ', $sqlParts); |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | { |
632 | 632 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
633 | 633 | |
634 | - if (! $fieldName) { |
|
634 | + if ( ! $fieldName) { |
|
635 | 635 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
636 | 636 | } |
637 | 637 | |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $property = $class->getProperty($fieldName); |
661 | 661 | |
662 | 662 | if ($this->useSqlTableAliases) { |
663 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
663 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
664 | 664 | } |
665 | 665 | |
666 | 666 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
675 | 675 | $association = $class->getProperty($fieldName); |
676 | 676 | |
677 | - if (! $association->isOwningSide()) { |
|
677 | + if ( ! $association->isOwningSide()) { |
|
678 | 678 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
679 | 679 | } |
680 | 680 | |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | $joinColumn = reset($joinColumns); |
689 | 689 | |
690 | 690 | if ($this->useSqlTableAliases) { |
691 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
691 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
692 | 692 | } |
693 | 693 | |
694 | 694 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | */ |
707 | 707 | public function walkSelectClause($selectClause) |
708 | 708 | { |
709 | - $sql = 'SELECT ' . ($selectClause->isDistinct ? 'DISTINCT ' : ''); |
|
709 | + $sql = 'SELECT '.($selectClause->isDistinct ? 'DISTINCT ' : ''); |
|
710 | 710 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
711 | 711 | |
712 | 712 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && $selectClause->isDistinct) { |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | |
750 | 750 | $sqlSelectExpressions[] = sprintf( |
751 | 751 | '%s AS %s', |
752 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
752 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
753 | 753 | $sqlColumnAlias |
754 | 754 | ); |
755 | 755 | |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | |
760 | 760 | // Add foreign key columns of class and also parent classes |
761 | 761 | foreach ($class->getPropertiesIterator() as $association) { |
762 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
762 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
763 | 763 | || ( ! $addMetaColumns && ! $association->isPrimaryKey())) { |
764 | 764 | continue; |
765 | 765 | } |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | } |
787 | 787 | |
788 | 788 | // Add foreign key columns to SQL, if necessary |
789 | - if (! $addMetaColumns) { |
|
789 | + if ( ! $addMetaColumns) { |
|
790 | 790 | continue; |
791 | 791 | } |
792 | 792 | |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | continue; |
801 | 801 | } |
802 | 802 | |
803 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
803 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
804 | 804 | continue; |
805 | 805 | } |
806 | 806 | |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | } |
827 | 827 | } |
828 | 828 | |
829 | - return $sql . implode(', ', $sqlSelectExpressions); |
|
829 | + return $sql.implode(', ', $sqlSelectExpressions); |
|
830 | 830 | } |
831 | 831 | |
832 | 832 | /** |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
842 | 842 | } |
843 | 843 | |
844 | - return ' FROM ' . implode(', ', $sqlParts); |
|
844 | + return ' FROM '.implode(', ', $sqlParts); |
|
845 | 845 | } |
846 | 846 | |
847 | 847 | /** |
@@ -916,8 +916,8 @@ discard block |
||
916 | 916 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
917 | 917 | $lockMode = $this->query->getHint(Query::HINT_LOCK_MODE); |
918 | 918 | $sql = $lockMode !== false |
919 | - ? $this->platform->appendLockHint($tableName . ' ' . $tableAlias, $lockMode) |
|
920 | - : $tableName . ' ' . $tableAlias; |
|
919 | + ? $this->platform->appendLockHint($tableName.' '.$tableAlias, $lockMode) |
|
920 | + : $tableName.' '.$tableAlias; |
|
921 | 921 | |
922 | 922 | if ($class->inheritanceType !== InheritanceType::JOINED) { |
923 | 923 | return $sql; |
@@ -925,11 +925,11 @@ discard block |
||
925 | 925 | |
926 | 926 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
927 | 927 | |
928 | - if (! $buildNestedJoins) { |
|
929 | - return $sql . $classTableInheritanceJoins; |
|
928 | + if ( ! $buildNestedJoins) { |
|
929 | + return $sql.$classTableInheritanceJoins; |
|
930 | 930 | } |
931 | 931 | |
932 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
932 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
933 | 933 | } |
934 | 934 | |
935 | 935 | /** |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | : $association; |
966 | 966 | |
967 | 967 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && |
968 | - (! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
968 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
969 | 969 | if ($association instanceof ToManyAssociationMetadata) { |
970 | 970 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
971 | 971 | } |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | } |
1020 | 1020 | |
1021 | 1021 | $targetTableJoin = [ |
1022 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1022 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1023 | 1023 | 'condition' => implode(' AND ', $conditions), |
1024 | 1024 | ]; |
1025 | 1025 | } elseif ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | ); |
1047 | 1047 | } |
1048 | 1048 | |
1049 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1049 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1050 | 1050 | |
1051 | 1051 | // Join target table |
1052 | 1052 | $sql .= $joinType === AST\Join::JOIN_TYPE_LEFT || $joinType === AST\Join::JOIN_TYPE_LEFTOUTER ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | } |
1085 | 1085 | |
1086 | 1086 | $targetTableJoin = [ |
1087 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1087 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1088 | 1088 | 'condition' => implode(' AND ', $conditions), |
1089 | 1089 | ]; |
1090 | 1090 | } else { |
@@ -1092,23 +1092,23 @@ discard block |
||
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | // Handle WITH clause |
1095 | - $withCondition = $condExpr === null ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1095 | + $withCondition = $condExpr === null ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1096 | 1096 | |
1097 | 1097 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
1098 | 1098 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1099 | 1099 | |
1100 | 1100 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1101 | 1101 | if ($withCondition) { |
1102 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1102 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1103 | 1103 | } else { |
1104 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1104 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1105 | 1105 | } |
1106 | 1106 | } else { |
1107 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1107 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1108 | 1108 | } |
1109 | 1109 | |
1110 | 1110 | if ($withCondition) { |
1111 | - $sql .= ' AND ' . $withCondition; |
|
1111 | + $sql .= ' AND '.$withCondition; |
|
1112 | 1112 | } |
1113 | 1113 | |
1114 | 1114 | // Apply the indexes |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1143 | 1143 | } |
1144 | 1144 | |
1145 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1145 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1146 | 1146 | } |
1147 | 1147 | |
1148 | 1148 | /** |
@@ -1159,10 +1159,10 @@ discard block |
||
1159 | 1159 | $this->orderedColumnsMap[$sql] = $type; |
1160 | 1160 | |
1161 | 1161 | if ($expr instanceof AST\Subselect) { |
1162 | - return '(' . $sql . ') ' . $type; |
|
1162 | + return '('.$sql.') '.$type; |
|
1163 | 1163 | } |
1164 | 1164 | |
1165 | - return $sql . ' ' . $type; |
|
1165 | + return $sql.' '.$type; |
|
1166 | 1166 | } |
1167 | 1167 | |
1168 | 1168 | /** |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | */ |
1171 | 1171 | public function walkHavingClause($havingClause) |
1172 | 1172 | { |
1173 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1173 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1174 | 1174 | } |
1175 | 1175 | |
1176 | 1176 | /** |
@@ -1193,7 +1193,7 @@ discard block |
||
1193 | 1193 | $conditions = []; |
1194 | 1194 | |
1195 | 1195 | if ($join->conditionalExpression) { |
1196 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1196 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1197 | 1197 | } |
1198 | 1198 | |
1199 | 1199 | $isUnconditionalJoin = empty($conditions); |
@@ -1218,7 +1218,7 @@ discard block |
||
1218 | 1218 | } |
1219 | 1219 | |
1220 | 1220 | if ($conditions) { |
1221 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1221 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1222 | 1222 | } |
1223 | 1223 | |
1224 | 1224 | break; |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1249 | 1249 | } |
1250 | 1250 | |
1251 | - return $sql . implode(', ', $scalarExpressions) . ')'; |
|
1251 | + return $sql.implode(', ', $scalarExpressions).')'; |
|
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | /** |
@@ -1268,7 +1268,7 @@ discard block |
||
1268 | 1268 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1269 | 1269 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1270 | 1270 | |
1271 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1271 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1272 | 1272 | } |
1273 | 1273 | |
1274 | 1274 | /** |
@@ -1281,11 +1281,11 @@ discard block |
||
1281 | 1281 | $sql = 'CASE'; |
1282 | 1282 | |
1283 | 1283 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1284 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1285 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1284 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1285 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1286 | 1286 | } |
1287 | 1287 | |
1288 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1288 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1289 | 1289 | |
1290 | 1290 | return $sql; |
1291 | 1291 | } |
@@ -1299,14 +1299,14 @@ discard block |
||
1299 | 1299 | */ |
1300 | 1300 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1301 | 1301 | { |
1302 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1302 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1303 | 1303 | |
1304 | 1304 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1305 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1306 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1305 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1306 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1307 | 1307 | } |
1308 | 1308 | |
1309 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1309 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1310 | 1310 | |
1311 | 1311 | return $sql; |
1312 | 1312 | } |
@@ -1347,7 +1347,7 @@ discard block |
||
1347 | 1347 | |
1348 | 1348 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1349 | 1349 | |
1350 | - if (! $hidden) { |
|
1350 | + if ( ! $hidden) { |
|
1351 | 1351 | $this->rsm->addScalarResult($columnAlias, $resultAlias, $property->getType()); |
1352 | 1352 | $this->scalarFields[$dqlAlias][$fieldName] = $columnAlias; |
1353 | 1353 | } |
@@ -1368,11 +1368,11 @@ discard block |
||
1368 | 1368 | $columnAlias = $this->getSQLColumnAlias(); |
1369 | 1369 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1370 | 1370 | |
1371 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1371 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1372 | 1372 | |
1373 | 1373 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1374 | 1374 | |
1375 | - if (! $hidden) { |
|
1375 | + if ( ! $hidden) { |
|
1376 | 1376 | // Conceptually we could resolve field type here by traverse through AST to retrieve field type, |
1377 | 1377 | // but this is not a feasible solution; assume 'string'. |
1378 | 1378 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
@@ -1383,11 +1383,11 @@ discard block |
||
1383 | 1383 | $columnAlias = $this->getSQLColumnAlias(); |
1384 | 1384 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1385 | 1385 | |
1386 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1386 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1387 | 1387 | |
1388 | 1388 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1389 | 1389 | |
1390 | - if (! $hidden) { |
|
1390 | + if ( ! $hidden) { |
|
1391 | 1391 | // We cannot resolve field type here; assume 'string'. |
1392 | 1392 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
1393 | 1393 | } |
@@ -1411,7 +1411,7 @@ discard block |
||
1411 | 1411 | $class = $queryComp['metadata']; |
1412 | 1412 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: null; |
1413 | 1413 | |
1414 | - if (! isset($this->selectedClasses[$dqlAlias])) { |
|
1414 | + if ( ! isset($this->selectedClasses[$dqlAlias])) { |
|
1415 | 1415 | $this->selectedClasses[$dqlAlias] = [ |
1416 | 1416 | 'class' => $class, |
1417 | 1417 | 'dqlAlias' => $dqlAlias, |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | |
1424 | 1424 | // Select all fields from the queried class |
1425 | 1425 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
1426 | - if (! ($property instanceof FieldMetadata)) { |
|
1426 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1427 | 1427 | continue; |
1428 | 1428 | } |
1429 | 1429 | |
@@ -1458,7 +1458,7 @@ discard block |
||
1458 | 1458 | $subClass = $this->em->getClassMetadata($subClassName); |
1459 | 1459 | |
1460 | 1460 | foreach ($subClass->getPropertiesIterator() as $fieldName => $property) { |
1461 | - if (! ($property instanceof FieldMetadata)) { |
|
1461 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1462 | 1462 | continue; |
1463 | 1463 | } |
1464 | 1464 | |
@@ -1497,7 +1497,7 @@ discard block |
||
1497 | 1497 | */ |
1498 | 1498 | public function walkQuantifiedExpression($qExpr) |
1499 | 1499 | { |
1500 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1500 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1501 | 1501 | } |
1502 | 1502 | |
1503 | 1503 | /** |
@@ -1537,7 +1537,7 @@ discard block |
||
1537 | 1537 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1538 | 1538 | } |
1539 | 1539 | |
1540 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1540 | + return ' FROM '.implode(', ', $sqlParts); |
|
1541 | 1541 | } |
1542 | 1542 | |
1543 | 1543 | /** |
@@ -1545,7 +1545,7 @@ discard block |
||
1545 | 1545 | */ |
1546 | 1546 | public function walkSimpleSelectClause($simpleSelectClause) |
1547 | 1547 | { |
1548 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1548 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1549 | 1549 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1550 | 1550 | } |
1551 | 1551 | |
@@ -1579,7 +1579,7 @@ discard block |
||
1579 | 1579 | break; |
1580 | 1580 | |
1581 | 1581 | case $e instanceof AST\Subselect: |
1582 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1582 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1583 | 1583 | break; |
1584 | 1584 | |
1585 | 1585 | case $e instanceof AST\PathExpression: |
@@ -1588,7 +1588,7 @@ discard block |
||
1588 | 1588 | $class = $qComp['metadata']; |
1589 | 1589 | $fieldType = $class->getProperty($e->field)->getType(); |
1590 | 1590 | |
1591 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1591 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1592 | 1592 | break; |
1593 | 1593 | |
1594 | 1594 | case $e instanceof AST\Literal: |
@@ -1602,11 +1602,11 @@ discard block |
||
1602 | 1602 | break; |
1603 | 1603 | } |
1604 | 1604 | |
1605 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1605 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1606 | 1606 | break; |
1607 | 1607 | |
1608 | 1608 | default: |
1609 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1609 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1610 | 1610 | break; |
1611 | 1611 | } |
1612 | 1612 | |
@@ -1639,10 +1639,10 @@ discard block |
||
1639 | 1639 | case $expr instanceof AST\Subselect: |
1640 | 1640 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1641 | 1641 | |
1642 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1642 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1643 | 1643 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1644 | 1644 | |
1645 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1645 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1646 | 1646 | break; |
1647 | 1647 | |
1648 | 1648 | case $expr instanceof AST\Functions\FunctionNode: |
@@ -1659,7 +1659,7 @@ discard block |
||
1659 | 1659 | $columnAlias = $this->getSQLColumnAlias(); |
1660 | 1660 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1661 | 1661 | |
1662 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1662 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1663 | 1663 | break; |
1664 | 1664 | |
1665 | 1665 | case $expr instanceof AST\ParenthesisExpression: |
@@ -1679,8 +1679,8 @@ discard block |
||
1679 | 1679 | */ |
1680 | 1680 | public function walkAggregateExpression($aggExpression) |
1681 | 1681 | { |
1682 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1683 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1682 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1683 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1684 | 1684 | } |
1685 | 1685 | |
1686 | 1686 | /** |
@@ -1694,7 +1694,7 @@ discard block |
||
1694 | 1694 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1695 | 1695 | } |
1696 | 1696 | |
1697 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1697 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1698 | 1698 | } |
1699 | 1699 | |
1700 | 1700 | /** |
@@ -1703,7 +1703,7 @@ discard block |
||
1703 | 1703 | public function walkGroupByItem($groupByItem) |
1704 | 1704 | { |
1705 | 1705 | // StateFieldPathExpression |
1706 | - if (! is_string($groupByItem)) { |
|
1706 | + if ( ! is_string($groupByItem)) { |
|
1707 | 1707 | return $this->walkPathExpression($groupByItem); |
1708 | 1708 | } |
1709 | 1709 | |
@@ -1757,7 +1757,7 @@ discard block |
||
1757 | 1757 | { |
1758 | 1758 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1759 | 1759 | $tableName = $class->getTableName(); |
1760 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1760 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
1761 | 1761 | |
1762 | 1762 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1763 | 1763 | |
@@ -1773,12 +1773,12 @@ discard block |
||
1773 | 1773 | { |
1774 | 1774 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1775 | 1775 | $tableName = $class->getTableName(); |
1776 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1776 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
1777 | 1777 | |
1778 | 1778 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1779 | 1779 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1780 | 1780 | |
1781 | - return $sql . ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1781 | + return $sql.' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1782 | 1782 | } |
1783 | 1783 | |
1784 | 1784 | /** |
@@ -1789,7 +1789,7 @@ discard block |
||
1789 | 1789 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1790 | 1790 | $this->useSqlTableAliases = false; |
1791 | 1791 | |
1792 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1792 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1793 | 1793 | $newValue = $updateItem->newValue; |
1794 | 1794 | |
1795 | 1795 | switch (true) { |
@@ -1833,7 +1833,7 @@ discard block |
||
1833 | 1833 | |
1834 | 1834 | if ($filterClauses) { |
1835 | 1835 | if ($condSql) { |
1836 | - $condSql = '(' . $condSql . ') AND '; |
|
1836 | + $condSql = '('.$condSql.') AND '; |
|
1837 | 1837 | } |
1838 | 1838 | |
1839 | 1839 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1841,11 +1841,11 @@ discard block |
||
1841 | 1841 | } |
1842 | 1842 | |
1843 | 1843 | if ($condSql) { |
1844 | - return ' WHERE ' . (! $discrSql ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1844 | + return ' WHERE '.( ! $discrSql ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1845 | 1845 | } |
1846 | 1846 | |
1847 | 1847 | if ($discrSql) { |
1848 | - return ' WHERE ' . $discrSql; |
|
1848 | + return ' WHERE '.$discrSql; |
|
1849 | 1849 | } |
1850 | 1850 | |
1851 | 1851 | return ''; |
@@ -1858,7 +1858,7 @@ discard block |
||
1858 | 1858 | { |
1859 | 1859 | // Phase 2 AST optimization: Skip processing of ConditionalExpression |
1860 | 1860 | // if only one ConditionalTerm is defined |
1861 | - if (! ($condExpr instanceof AST\ConditionalExpression)) { |
|
1861 | + if ( ! ($condExpr instanceof AST\ConditionalExpression)) { |
|
1862 | 1862 | return $this->walkConditionalTerm($condExpr); |
1863 | 1863 | } |
1864 | 1864 | |
@@ -1872,7 +1872,7 @@ discard block |
||
1872 | 1872 | { |
1873 | 1873 | // Phase 2 AST optimization: Skip processing of ConditionalTerm |
1874 | 1874 | // if only one ConditionalFactor is defined |
1875 | - if (! ($condTerm instanceof AST\ConditionalTerm)) { |
|
1875 | + if ( ! ($condTerm instanceof AST\ConditionalTerm)) { |
|
1876 | 1876 | return $this->walkConditionalFactor($condTerm); |
1877 | 1877 | } |
1878 | 1878 | |
@@ -1888,7 +1888,7 @@ discard block |
||
1888 | 1888 | // if only one ConditionalPrimary is defined |
1889 | 1889 | return ! ($factor instanceof AST\ConditionalFactor) |
1890 | 1890 | ? $this->walkConditionalPrimary($factor) |
1891 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1891 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1892 | 1892 | } |
1893 | 1893 | |
1894 | 1894 | /** |
@@ -1903,7 +1903,7 @@ discard block |
||
1903 | 1903 | if ($primary->isConditionalExpression()) { |
1904 | 1904 | $condExpr = $primary->conditionalExpression; |
1905 | 1905 | |
1906 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1906 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1907 | 1907 | } |
1908 | 1908 | |
1909 | 1909 | return ''; |
@@ -1916,7 +1916,7 @@ discard block |
||
1916 | 1916 | { |
1917 | 1917 | $sql = $existsExpr->not ? 'NOT ' : ''; |
1918 | 1918 | |
1919 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1919 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1920 | 1920 | |
1921 | 1921 | return $sql; |
1922 | 1922 | } |
@@ -1964,7 +1964,7 @@ discard block |
||
1964 | 1964 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1965 | 1965 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1966 | 1966 | |
1967 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
1967 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
1968 | 1968 | |
1969 | 1969 | $sqlParts = []; |
1970 | 1970 | |
@@ -1985,7 +1985,7 @@ discard block |
||
1985 | 1985 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1986 | 1986 | } |
1987 | 1987 | |
1988 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
1988 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
1989 | 1989 | } |
1990 | 1990 | |
1991 | 1991 | $sql .= implode(' AND ', $sqlParts); |
@@ -1999,7 +1999,7 @@ discard block |
||
1999 | 1999 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
2000 | 2000 | |
2001 | 2001 | // join to target table |
2002 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
2002 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
2003 | 2003 | |
2004 | 2004 | // join conditions |
2005 | 2005 | $joinSqlParts = []; |
@@ -2048,13 +2048,13 @@ discard block |
||
2048 | 2048 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2049 | 2049 | } |
2050 | 2050 | |
2051 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2051 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2052 | 2052 | } |
2053 | 2053 | |
2054 | 2054 | $sql .= implode(' AND ', $sqlParts); |
2055 | 2055 | } |
2056 | 2056 | |
2057 | - return $sql . ')'; |
|
2057 | + return $sql.')'; |
|
2058 | 2058 | } |
2059 | 2059 | |
2060 | 2060 | /** |
@@ -2065,7 +2065,7 @@ discard block |
||
2065 | 2065 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2066 | 2066 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2067 | 2067 | |
2068 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2068 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2069 | 2069 | } |
2070 | 2070 | |
2071 | 2071 | /** |
@@ -2074,19 +2074,19 @@ discard block |
||
2074 | 2074 | public function walkNullComparisonExpression($nullCompExpr) |
2075 | 2075 | { |
2076 | 2076 | $expression = $nullCompExpr->expression; |
2077 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2077 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2078 | 2078 | |
2079 | 2079 | // Handle ResultVariable |
2080 | 2080 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2081 | - return $this->walkResultVariable($expression) . $comparison; |
|
2081 | + return $this->walkResultVariable($expression).$comparison; |
|
2082 | 2082 | } |
2083 | 2083 | |
2084 | 2084 | // Handle InputParameter mapping inclusion to ParserResult |
2085 | 2085 | if ($expression instanceof AST\InputParameter) { |
2086 | - return $this->walkInputParameter($expression) . $comparison; |
|
2086 | + return $this->walkInputParameter($expression).$comparison; |
|
2087 | 2087 | } |
2088 | 2088 | |
2089 | - return $expression->dispatch($this) . $comparison; |
|
2089 | + return $expression->dispatch($this).$comparison; |
|
2090 | 2090 | } |
2091 | 2091 | |
2092 | 2092 | /** |
@@ -2094,7 +2094,7 @@ discard block |
||
2094 | 2094 | */ |
2095 | 2095 | public function walkInExpression($inExpr) |
2096 | 2096 | { |
2097 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2097 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2098 | 2098 | |
2099 | 2099 | $sql .= $inExpr->subselect |
2100 | 2100 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2119,12 +2119,12 @@ discard block |
||
2119 | 2119 | $discrColumnType = $discrColumn->getType(); |
2120 | 2120 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
2121 | 2121 | $sqlTableAlias = $this->useSqlTableAliases |
2122 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
2122 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
2123 | 2123 | : ''; |
2124 | 2124 | |
2125 | 2125 | return sprintf( |
2126 | 2126 | '%s %sIN %s', |
2127 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
2127 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
2128 | 2128 | ($instanceOfExpr->not ? 'NOT ' : ''), |
2129 | 2129 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
2130 | 2130 | ); |
@@ -2168,8 +2168,8 @@ discard block |
||
2168 | 2168 | $sql .= ' NOT'; |
2169 | 2169 | } |
2170 | 2170 | |
2171 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2172 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2171 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2172 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2173 | 2173 | |
2174 | 2174 | return $sql; |
2175 | 2175 | } |
@@ -2184,7 +2184,7 @@ discard block |
||
2184 | 2184 | ? $this->walkResultVariable($stringExpr) |
2185 | 2185 | : $stringExpr->dispatch($this); |
2186 | 2186 | |
2187 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2187 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2188 | 2188 | |
2189 | 2189 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2190 | 2190 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2197,7 +2197,7 @@ discard block |
||
2197 | 2197 | } |
2198 | 2198 | |
2199 | 2199 | if ($likeExpr->escapeChar) { |
2200 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2200 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2201 | 2201 | } |
2202 | 2202 | |
2203 | 2203 | return $sql; |
@@ -2224,7 +2224,7 @@ discard block |
||
2224 | 2224 | ? $leftExpr->dispatch($this) |
2225 | 2225 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2226 | 2226 | |
2227 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2227 | + $sql .= ' '.$compExpr->operator.' '; |
|
2228 | 2228 | |
2229 | 2229 | $sql .= $rightExpr instanceof AST\Node |
2230 | 2230 | ? $rightExpr->dispatch($this) |
@@ -2260,7 +2260,7 @@ discard block |
||
2260 | 2260 | { |
2261 | 2261 | return $arithmeticExpr->isSimpleArithmeticExpression() |
2262 | 2262 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2263 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2263 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2264 | 2264 | } |
2265 | 2265 | |
2266 | 2266 | /** |
@@ -2268,7 +2268,7 @@ discard block |
||
2268 | 2268 | */ |
2269 | 2269 | public function walkSimpleArithmeticExpression($simpleArithmeticExpr) |
2270 | 2270 | { |
2271 | - if (! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2271 | + if ( ! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2272 | 2272 | return $this->walkArithmeticTerm($simpleArithmeticExpr); |
2273 | 2273 | } |
2274 | 2274 | |
@@ -2288,7 +2288,7 @@ discard block |
||
2288 | 2288 | |
2289 | 2289 | // Phase 2 AST optimization: Skip processing of ArithmeticTerm |
2290 | 2290 | // if only one ArithmeticFactor is defined |
2291 | - if (! ($term instanceof AST\ArithmeticTerm)) { |
|
2291 | + if ( ! ($term instanceof AST\ArithmeticTerm)) { |
|
2292 | 2292 | return $this->walkArithmeticFactor($term); |
2293 | 2293 | } |
2294 | 2294 | |
@@ -2308,13 +2308,13 @@ discard block |
||
2308 | 2308 | |
2309 | 2309 | // Phase 2 AST optimization: Skip processing of ArithmeticFactor |
2310 | 2310 | // if only one ArithmeticPrimary is defined |
2311 | - if (! ($factor instanceof AST\ArithmeticFactor)) { |
|
2311 | + if ( ! ($factor instanceof AST\ArithmeticFactor)) { |
|
2312 | 2312 | return $this->walkArithmeticPrimary($factor); |
2313 | 2313 | } |
2314 | 2314 | |
2315 | 2315 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2316 | 2316 | |
2317 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2317 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2318 | 2318 | } |
2319 | 2319 | |
2320 | 2320 | /** |
@@ -2327,7 +2327,7 @@ discard block |
||
2327 | 2327 | public function walkArithmeticPrimary($primary) |
2328 | 2328 | { |
2329 | 2329 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2330 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2330 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2331 | 2331 | } |
2332 | 2332 | |
2333 | 2333 | if ($primary instanceof AST\Node) { |
@@ -2385,7 +2385,7 @@ discard block |
||
2385 | 2385 | $entityClassName = $entityClass->getClassName(); |
2386 | 2386 | |
2387 | 2387 | if ($entityClassName !== $rootClass->getClassName()) { |
2388 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2388 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2389 | 2389 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
2390 | 2390 | } |
2391 | 2391 | } |
@@ -2397,6 +2397,6 @@ discard block |
||
2397 | 2397 | $sqlParameterList[] = $this->conn->quote($discriminator); |
2398 | 2398 | } |
2399 | 2399 | |
2400 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
2400 | + return '('.implode(', ', $sqlParameterList).')'; |
|
2401 | 2401 | } |
2402 | 2402 | } |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | protected function getTargetEntity(string $targetEntity) : string |
93 | 93 | { |
94 | 94 | // Validate if target entity is defined |
95 | - if (! $targetEntity) { |
|
95 | + if ( ! $targetEntity) { |
|
96 | 96 | throw Mapping\MappingException::missingTargetEntity($this->fieldName); |
97 | 97 | } |
98 | 98 | |
99 | 99 | // Validate that target entity exists |
100 | - if (! (class_exists($targetEntity) || interface_exists($targetEntity))) { |
|
100 | + if ( ! (class_exists($targetEntity) || interface_exists($targetEntity))) { |
|
101 | 101 | throw Mapping\MappingException::invalidTargetEntityClass( |
102 | 102 | $targetEntity, |
103 | 103 | $this->componentMetadata->getClassName(), |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | { |
153 | 153 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
154 | 154 | |
155 | - if (! defined($fetchModeConstant)) { |
|
155 | + if ( ! defined($fetchModeConstant)) { |
|
156 | 156 | throw Mapping\MappingException::invalidFetchMode($this->componentMetadata->getClassName(), $fetchMode); |
157 | 157 | } |
158 | 158 | |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | string $targetEntity |
167 | 167 | ) : Mapping\LazyDataType { |
168 | 168 | return Mapping\LazyDataType::create( |
169 | - static function () use ($metadataBuildingContext, $associationMetadata, $joinColumnMetadata, $targetEntity) : Type { |
|
169 | + static function() use ($metadataBuildingContext, $associationMetadata, $joinColumnMetadata, $targetEntity) : Type { |
|
170 | 170 | $classMetadataFactory = $metadataBuildingContext->getClassMetadataFactory(); |
171 | 171 | $targetClassMetadata = $classMetadataFactory->getMetadataFor($targetEntity); |
172 | 172 | $targetColumnMetadata = $targetClassMetadata->getColumn($joinColumnMetadata->getReferencedColumnName()); |
173 | 173 | |
174 | - if (! $targetColumnMetadata) { |
|
174 | + if ( ! $targetColumnMetadata) { |
|
175 | 175 | throw new RuntimeException(sprintf( |
176 | 176 | 'Could not resolve type of column "%s" of class "%s"', |
177 | 177 | $joinColumnMetadata->getReferencedColumnName(), |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | $pkColumns = []; |
183 | 183 | |
184 | 184 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
185 | - if (! ($property instanceof FieldMetadata)) { |
|
185 | + if ( ! ($property instanceof FieldMetadata)) { |
|
186 | 186 | continue; |
187 | 187 | } |
188 | 188 | |
189 | - if (! $class->isInheritedProperty($fieldName)) { |
|
189 | + if ( ! $class->isInheritedProperty($fieldName)) { |
|
190 | 190 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
191 | 191 | |
192 | 192 | $this->gatherColumn($class, $property, $table); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | - if (! empty($inheritedKeyColumns)) { |
|
224 | + if ( ! empty($inheritedKeyColumns)) { |
|
225 | 225 | // Add a FK constraint on the ID column |
226 | 226 | $rootClass = $this->em->getClassMetadata($class->getRootClassName()); |
227 | 227 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | - if (! $table->hasIndex('primary')) { |
|
269 | + if ( ! $table->hasIndex('primary')) { |
|
270 | 270 | $table->setPrimaryKey($pkColumns); |
271 | 271 | } |
272 | 272 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $processedClasses[$class->getClassName()] = true; |
327 | 327 | |
328 | 328 | foreach ($class->getPropertiesIterator() as $property) { |
329 | - if (! $property instanceof FieldMetadata |
|
329 | + if ( ! $property instanceof FieldMetadata |
|
330 | 330 | || ! $property->hasValueGenerator() |
331 | 331 | || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE |
332 | 332 | || $class->getClassName() !== $class->getRootClassName()) { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $generator = $property->getValueGenerator()->getGenerator(); |
337 | 337 | $quotedName = $generator->getSequenceName(); |
338 | 338 | |
339 | - if (! $schema->hasSequence($quotedName)) { |
|
339 | + if ( ! $schema->hasSequence($quotedName)) { |
|
340 | 340 | $schema->createSequence($quotedName, $generator->getAllocationSize()); |
341 | 341 | } |
342 | 342 | } |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | } |
350 | 350 | } |
351 | 351 | |
352 | - if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
352 | + if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
353 | 353 | $schema->visit(new RemoveNamespacedAssets()); |
354 | 354 | } |
355 | 355 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | break; |
389 | 389 | } |
390 | 390 | |
391 | - if (! empty($discrColumn->getColumnDefinition())) { |
|
391 | + if ( ! empty($discrColumn->getColumnDefinition())) { |
|
392 | 392 | $options['columnDefinition'] = $discrColumn->getColumnDefinition(); |
393 | 393 | } |
394 | 394 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks) |
519 | 519 | { |
520 | 520 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
521 | - if (! ($property instanceof AssociationMetadata)) { |
|
521 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
522 | 522 | continue; |
523 | 523 | } |
524 | 524 | |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | continue; |
527 | 527 | } |
528 | 528 | |
529 | - if (! $property->isOwningSide()) { |
|
529 | + if ( ! $property->isOwningSide()) { |
|
530 | 530 | continue; |
531 | 531 | } |
532 | 532 | |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | $idColumns = $class->getIdentifierColumns($this->em); |
617 | 617 | $idColumnNameList = array_keys($idColumns); |
618 | 618 | |
619 | - if (! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
619 | + if ( ! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
620 | 620 | return null; |
621 | 621 | } |
622 | 622 | |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | foreach ($class->getIdentifierFieldNames() as $fieldName) { |
625 | 625 | $property = $class->getProperty($fieldName); |
626 | 626 | |
627 | - if (! ($property instanceof AssociationMetadata)) { |
|
627 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
628 | 628 | continue; |
629 | 629 | } |
630 | 630 | |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | $joinColumn->getReferencedColumnName() |
681 | 681 | ); |
682 | 682 | |
683 | - if (! $definingClass) { |
|
683 | + if ( ! $definingClass) { |
|
684 | 684 | throw MissingColumnException::fromColumnSourceAndTarget( |
685 | 685 | $joinColumn->getReferencedColumnName(), |
686 | 686 | $mapping->getSourceEntity(), |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | $localColumns[] = $quotedColumnName; |
696 | 696 | $foreignColumns[] = $quotedReferencedColumnName; |
697 | 697 | |
698 | - if (! $theJoinTable->hasColumn($quotedColumnName)) { |
|
698 | + if ( ! $theJoinTable->hasColumn($quotedColumnName)) { |
|
699 | 699 | // Only add the column to the table if it does not exist already. |
700 | 700 | // It might exist already if the foreign key is mapped into a regular |
701 | 701 | // property as well. |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | 'notnull' => ! $joinColumn->isNullable(), |
705 | 705 | ] + $this->gatherColumnOptions($property->getOptions()); |
706 | 706 | |
707 | - if (! empty($joinColumn->getColumnDefinition())) { |
|
707 | + if ( ! empty($joinColumn->getColumnDefinition())) { |
|
708 | 708 | $columnOptions['columnDefinition'] = $joinColumn->getColumnDefinition(); |
709 | 709 | } elseif ($property->getColumnDefinition()) { |
710 | 710 | $columnOptions['columnDefinition'] = $property->getColumnDefinition(); |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $uniqueConstraints[] = ['columns' => [$quotedColumnName]]; |
731 | 731 | } |
732 | 732 | |
733 | - if (! empty($joinColumn->getOnDelete())) { |
|
733 | + if ( ! empty($joinColumn->getOnDelete())) { |
|
734 | 734 | $fkOptions['onDelete'] = $joinColumn->getOnDelete(); |
735 | 735 | } |
736 | 736 | } |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName); |
742 | 742 | } |
743 | 743 | |
744 | - $compositeName = $theJoinTable->getName() . '.' . implode('', $localColumns); |
|
744 | + $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns); |
|
745 | 745 | |
746 | 746 | if (isset($addedFks[$compositeName]) |
747 | 747 | && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName'] |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | } |
759 | 759 | |
760 | 760 | $blacklistedFks[$compositeName] = true; |
761 | - } elseif (! isset($blacklistedFks[$compositeName])) { |
|
761 | + } elseif ( ! isset($blacklistedFks[$compositeName])) { |
|
762 | 762 | $addedFks[$compositeName] = [ |
763 | 763 | 'foreignTableName' => $foreignTableName, |
764 | 764 | 'foreignColumns' => $foreignColumns, |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | $fullSchema = $sm->createSchema(); |
858 | 858 | |
859 | 859 | foreach ($fullSchema->getTables() as $table) { |
860 | - if (! $schema->hasTable($table->getName())) { |
|
860 | + if ( ! $schema->hasTable($table->getName())) { |
|
861 | 861 | foreach ($table->getForeignKeys() as $foreignKey) { |
862 | 862 | /** @var $foreignKey ForeignKeyConstraint */ |
863 | 863 | if ($schema->hasTable($foreignKey->getForeignTableName())) { |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | if ($table->hasPrimaryKey()) { |
883 | 883 | $columns = $table->getPrimaryKey()->getColumns(); |
884 | 884 | if (count($columns) === 1) { |
885 | - $checkSequence = $table->getName() . '_' . $columns[0] . '_seq'; |
|
885 | + $checkSequence = $table->getName().'_'.$columns[0].'_seq'; |
|
886 | 886 | if ($fullSchema->hasSequence($checkSequence)) { |
887 | 887 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
888 | 888 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $association = $collection->getMapping(); |
39 | 39 | |
40 | - if (! $association->isOwningSide()) { |
|
40 | + if ( ! $association->isOwningSide()) { |
|
41 | 41 | return; // ignore inverse side |
42 | 42 | } |
43 | 43 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $association = $collection->getMapping(); |
64 | 64 | |
65 | - if (! $association->isOwningSide()) { |
|
65 | + if ( ! $association->isOwningSide()) { |
|
66 | 66 | return; // ignore inverse side |
67 | 67 | } |
68 | 68 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | $association = $collection->getMapping(); |
95 | 95 | |
96 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
96 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
97 | 97 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
98 | 98 | } |
99 | 99 | |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | }*/ |
166 | 166 | |
167 | 167 | $sql = 'SELECT COUNT(*)' |
168 | - . ' FROM ' . $joinTableName . ' t' |
|
168 | + . ' FROM '.$joinTableName.' t' |
|
169 | 169 | . $joinTargetEntitySQL |
170 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
170 | + . ' WHERE '.implode(' AND ', $conditions); |
|
171 | 171 | |
172 | 172 | return $this->conn->fetchColumn($sql, $params, $types); |
173 | 173 | } |
@@ -190,13 +190,13 @@ discard block |
||
190 | 190 | { |
191 | 191 | $association = $collection->getMapping(); |
192 | 192 | |
193 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
193 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
194 | 194 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
195 | 195 | } |
196 | 196 | |
197 | 197 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
198 | 198 | |
199 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
199 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
200 | 200 | |
201 | 201 | return (bool) $this->conn->fetchColumn($sql, $params, $types); |
202 | 202 | } |
@@ -206,13 +206,13 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function contains(PersistentCollection $collection, $element) |
208 | 208 | { |
209 | - if (! $this->isValidEntityState($element)) { |
|
209 | + if ( ! $this->isValidEntityState($element)) { |
|
210 | 210 | return false; |
211 | 211 | } |
212 | 212 | |
213 | 213 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions($collection, $element, true); |
214 | 214 | |
215 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
215 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
216 | 216 | |
217 | 217 | return (bool) $this->conn->fetchColumn($sql, $params, $types); |
218 | 218 | } |
@@ -222,13 +222,13 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function removeElement(PersistentCollection $collection, $element) |
224 | 224 | { |
225 | - if (! $this->isValidEntityState($element)) { |
|
225 | + if ( ! $this->isValidEntityState($element)) { |
|
226 | 226 | return false; |
227 | 227 | } |
228 | 228 | |
229 | 229 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions($collection, $element, false); |
230 | 230 | |
231 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
231 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
232 | 232 | |
233 | 233 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
234 | 234 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $onConditions = $this->getOnConditionSQL($association); |
247 | 247 | $whereClauses = $params = $types = []; |
248 | 248 | |
249 | - if (! $association->isOwningSide()) { |
|
249 | + if ( ! $association->isOwningSide()) { |
|
250 | 250 | $association = $targetClass->getProperty($association->getMappedBy()); |
251 | 251 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
252 | 252 | } else { |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | |
283 | 283 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
284 | 284 | |
285 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
286 | - . ' FROM ' . $tableName . ' te' |
|
287 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
285 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
286 | + . ' FROM '.$tableName.' te' |
|
287 | + . ' JOIN '.$joinTableName.' t ON' |
|
288 | 288 | . implode(' AND ', $onConditions) |
289 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
289 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
290 | 290 | |
291 | 291 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
292 | 292 | $sql .= $this->getLimitSql($criteria); |
@@ -321,8 +321,8 @@ discard block |
||
321 | 321 | |
322 | 322 | // A join is needed if there is filtering on the target entity |
323 | 323 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
324 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
325 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
324 | + $joinSql = ' JOIN '.$tableName.' te' |
|
325 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
326 | 326 | |
327 | 327 | return [$joinSql, $filterSql]; |
328 | 328 | } |
@@ -343,18 +343,18 @@ discard block |
||
343 | 343 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
344 | 344 | |
345 | 345 | if ($filterExpr) { |
346 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
346 | + $filterClauses[] = '('.$filterExpr.')'; |
|
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
350 | - if (! $filterClauses) { |
|
350 | + if ( ! $filterClauses) { |
|
351 | 351 | return ''; |
352 | 352 | } |
353 | 353 | |
354 | 354 | $filterSql = implode(' AND ', $filterClauses); |
355 | 355 | |
356 | 356 | return isset($filterClauses[1]) |
357 | - ? '(' . $filterSql . ')' |
|
357 | + ? '('.$filterSql.')' |
|
358 | 358 | : $filterSql; |
359 | 359 | } |
360 | 360 | |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
382 | 382 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
383 | 383 | |
384 | - $conditions[] = ' t.' . $quotedColumnName . ' = te.' . $quotedReferencedColumnName; |
|
384 | + $conditions[] = ' t.'.$quotedColumnName.' = te.'.$quotedReferencedColumnName; |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | return $conditions; |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
404 | 404 | } |
405 | 405 | |
406 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
406 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | /** |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
600 | 600 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
601 | 601 | |
602 | - if (! $owningAssociation->isOwningSide()) { |
|
602 | + if ( ! $owningAssociation->isOwningSide()) { |
|
603 | 603 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
604 | 604 | $joinTable = $owningAssociation->getJoinTable(); |
605 | 605 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | } |
612 | 612 | |
613 | 613 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
614 | - $quotedJoinTable = $joinTableName . ' t'; |
|
614 | + $quotedJoinTable = $joinTableName.' t'; |
|
615 | 615 | $whereClauses = []; |
616 | 616 | $params = []; |
617 | 617 | $types = []; |
@@ -625,11 +625,11 @@ discard block |
||
625 | 625 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
626 | 626 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
627 | 627 | |
628 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = tr.' . $quotedReferencedColumnName; |
|
628 | + $joinConditions[] = ' t.'.$quotedColumnName.' = tr.'.$quotedReferencedColumnName; |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
632 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
632 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
633 | 633 | $indexByProperty = $targetClass->getProperty($indexBy); |
634 | 634 | |
635 | 635 | switch (true) { |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | $types[] = $joinColumn->getType(); |
657 | 657 | } |
658 | 658 | |
659 | - if (! $joinNeeded) { |
|
659 | + if ( ! $joinNeeded) { |
|
660 | 660 | foreach ($joinColumns as $joinColumn) { |
661 | 661 | /** @var JoinColumnMetadata $joinColumn */ |
662 | 662 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($association); |
672 | 672 | |
673 | 673 | if ($filterSql) { |
674 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
674 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
675 | 675 | $whereClauses[] = $filterSql; |
676 | 676 | } |
677 | 677 | } |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | $association = $collection->getMapping(); |
695 | 695 | $owningAssociation = $association; |
696 | 696 | |
697 | - if (! $association->isOwningSide()) { |
|
697 | + if ( ! $association->isOwningSide()) { |
|
698 | 698 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
699 | 699 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
700 | 700 | $sourceIdentifier = $this->uow->getEntityIdentifier($element); |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
721 | 721 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
722 | 722 | |
723 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
723 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
724 | 724 | $params[] = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]]; |
725 | 725 | $types[] = $joinColumn->getType(); |
726 | 726 | } |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
731 | 731 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
732 | 732 | |
733 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
733 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
734 | 734 | $params[] = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]]; |
735 | 735 | $types[] = $joinColumn->getType(); |
736 | 736 | } |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($association); |
742 | 742 | |
743 | 743 | if ($filterSql) { |
744 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
744 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
745 | 745 | $whereClauses[] = $filterSql; |
746 | 746 | } |
747 | 747 | } |
@@ -786,10 +786,10 @@ discard block |
||
786 | 786 | $property = $targetClass->getProperty($name); |
787 | 787 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
788 | 788 | |
789 | - $orderBy[] = $columnName . ' ' . $direction; |
|
789 | + $orderBy[] = $columnName.' '.$direction; |
|
790 | 790 | } |
791 | 791 | |
792 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
792 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
793 | 793 | } |
794 | 794 | |
795 | 795 | return ''; |