@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Doctrine\Tests\ORM\Performance; |
| 4 | 4 | |
| 5 | -use Doctrine\ORM\Query; |
|
| 6 | 5 | use Doctrine\Tests\Models\CMS\CmsUser; |
| 7 | 6 | use Doctrine\Tests\Models\CMS\CmsGroup; |
| 8 | 7 | use Doctrine\Tests\Models\CMS\CmsArticle; |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $start = microtime(true); |
| 43 | 43 | $articles = $this->_em->getRepository(CmsArticle::class)->findAll(); |
| 44 | - echo "100 CmsArticle findAll(): " . number_format(microtime(true) - $start, 6) . "\n"; |
|
| 44 | + echo "100 CmsArticle findAll(): ".number_format(microtime(true) - $start, 6)."\n"; |
|
| 45 | 45 | |
| 46 | 46 | $this->_em->clear(); |
| 47 | 47 | |
| 48 | 48 | $start = microtime(true); |
| 49 | 49 | $articles = $this->_em->getRepository(CmsArticle::class)->findAll(); |
| 50 | - echo "100 CmsArticle findAll(): " . number_format(microtime(true) - $start, 6) . "\n"; |
|
| 50 | + echo "100 CmsArticle findAll(): ".number_format(microtime(true) - $start, 6)."\n"; |
|
| 51 | 51 | |
| 52 | 52 | $this->_em->clear(); |
| 53 | 53 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | for ($i = 0; $i < 100; $i++) { |
| 56 | 56 | $articles = $this->_em->getRepository(CmsArticle::class)->find($ids[$i]->id); |
| 57 | 57 | } |
| 58 | - echo "100 CmsArticle find(): " . number_format(microtime(true) - $start, 6) . "\n"; |
|
| 58 | + echo "100 CmsArticle find(): ".number_format(microtime(true) - $start, 6)."\n"; |
|
| 59 | 59 | |
| 60 | 60 | $this->_em->clear(); |
| 61 | 61 | |
@@ -63,14 +63,14 @@ discard block |
||
| 63 | 63 | for ($i = 0; $i < 100; $i++) { |
| 64 | 64 | $articles = $this->_em->getRepository(CmsArticle::class)->find($ids[$i]->id); |
| 65 | 65 | } |
| 66 | - echo "100 CmsArticle find(): " . number_format(microtime(true) - $start, 6) . "\n"; |
|
| 66 | + echo "100 CmsArticle find(): ".number_format(microtime(true) - $start, 6)."\n"; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | public function testFindCmsGroup() |
| 70 | 70 | { |
| 71 | 71 | for ($i = 0; $i < 100; $i++) { |
| 72 | 72 | $group = new CmsGroup(); |
| 73 | - $group->name = "foo" . $i; |
|
| 73 | + $group->name = "foo".$i; |
|
| 74 | 74 | $this->_em->persist($group); |
| 75 | 75 | } |
| 76 | 76 | $this->_em->flush(); |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $start = microtime(true); |
| 80 | 80 | $articles = $this->_em->getRepository(CmsGroup::class)->findAll(); |
| 81 | - echo "100 CmsGroup: " . number_format(microtime(true) - $start, 6) . "\n"; |
|
| 81 | + echo "100 CmsGroup: ".number_format(microtime(true) - $start, 6)."\n"; |
|
| 82 | 82 | |
| 83 | 83 | $this->_em->clear(); |
| 84 | 84 | |
| 85 | 85 | $start = microtime(true); |
| 86 | 86 | $articles = $this->_em->getRepository(CmsGroup::class)->findAll(); |
| 87 | - echo "100 CmsGroup: " . number_format(microtime(true) - $start, 6) . "\n"; |
|
| 87 | + echo "100 CmsGroup: ".number_format(microtime(true) - $start, 6)."\n"; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | public function testFindCmsUser() |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | $start = microtime(true); |
| 104 | 104 | $articles = $this->_em->getRepository(CmsUser::class)->findAll(); |
| 105 | - echo "100 CmsUser: " . number_format(microtime(true) - $start, 6) . "\n"; |
|
| 105 | + echo "100 CmsUser: ".number_format(microtime(true) - $start, 6)."\n"; |
|
| 106 | 106 | |
| 107 | 107 | $this->_em->clear(); |
| 108 | 108 | |
| 109 | 109 | $start = microtime(true); |
| 110 | 110 | $articles = $this->_em->getRepository(CmsUser::class)->findAll(); |
| 111 | - echo "100 CmsUser: " . number_format(microtime(true) - $start, 6) . "\n"; |
|
| 111 | + echo "100 CmsUser: ".number_format(microtime(true) - $start, 6)."\n"; |
|
| 112 | 112 | } |
| 113 | 113 | } |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Doctrine\DBAL\Types\Type as DBALType; |
| 8 | 8 | use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; |
| 9 | 9 | use Doctrine\Tests\Models\CustomType\CustomTypeChild; |
| 10 | -use Doctrine\Tests\Models\CustomType\CustomTypeFriend; |
|
| 11 | 10 | use Doctrine\Tests\Models\CustomType\CustomTypeParent; |
| 12 | 11 | use Doctrine\Tests\Models\Generic\NonAlphaColumnsEntity; |
| 13 | 12 | use Doctrine\Tests\OrmTestCase; |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | $method = new \ReflectionMethod($this->_persister, 'getSelectConditionSQL'); |
| 85 | 85 | $method->setAccessible(true); |
| 86 | 86 | |
| 87 | - $sql = $method->invoke($this->_persister, ['customInteger' => 1, 'child' => 1]); |
|
| 87 | + $sql = $method->invoke($this->_persister, ['customInteger' => 1, 'child' => 1]); |
|
| 88 | 88 | |
| 89 | 89 | $this->assertEquals('t0.customInteger = ABS(?) AND t0.child_id = ?', $sql); |
| 90 | 90 | } |
@@ -38,6 +38,10 @@ |
||
| 38 | 38 | return $query->getSql(); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $dqlToBeTested |
|
| 43 | + * @param string $sqlToBeConfirmed |
|
| 44 | + */ |
|
| 41 | 45 | public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed, $treeWalkers = [], $outputWalker = null) |
| 42 | 46 | { |
| 43 | 47 | try { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | try { |
| 44 | 44 | $this->assertEquals($sqlToBeConfirmed, $this->generateSql($dqlToBeTested, $treeWalkers, $outputWalker)); |
| 45 | 45 | } catch (\Exception $e) { |
| 46 | - $this->fail($e->getMessage() . ' at "' . $e->getFile() . '" on line ' . $e->getLine()); |
|
| 46 | + $this->fail($e->getMessage().' at "'.$e->getFile().'" on line '.$e->getLine()); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
@@ -201,9 +201,9 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $rangeVariableDecl = $identificationVariableDecl->rangeVariableDeclaration; |
| 203 | 203 | $joinAssocPathExpression = new Query\AST\JoinAssociationPathExpression($rangeVariableDecl->aliasIdentificationVariable, 'address'); |
| 204 | - $joinAssocDeclaration = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable . 'a', null); |
|
| 204 | + $joinAssocDeclaration = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable.'a', null); |
|
| 205 | 205 | $join = new Query\AST\Join(Query\AST\Join::JOIN_TYPE_LEFT, $joinAssocDeclaration); |
| 206 | - $selectExpression = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable . 'a', null, false); |
|
| 206 | + $selectExpression = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable.'a', null, false); |
|
| 207 | 207 | |
| 208 | 208 | $identificationVariableDecl->joins[] = $join; |
| 209 | 209 | $selectStatement->selectClause->selectExpressions[] = $selectExpression; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $userMetadata = $entityManager->getClassMetadata(CmsUser::class); |
| 213 | 213 | $addressMetadata = $entityManager->getClassMetadata(CmsAddress::class); |
| 214 | 214 | |
| 215 | - $this->setQueryComponent($rangeVariableDecl->aliasIdentificationVariable . 'a', |
|
| 215 | + $this->setQueryComponent($rangeVariableDecl->aliasIdentificationVariable.'a', |
|
| 216 | 216 | [ |
| 217 | 217 | 'metadata' => $addressMetadata, |
| 218 | 218 | 'parent' => $rangeVariableDecl->aliasIdentificationVariable, |
@@ -43,6 +43,10 @@ |
||
| 43 | 43 | $this->_em = $this->_getTestEntityManager(); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | + /** |
|
| 47 | + * @param string $dqlToBeTested |
|
| 48 | + * @param string $sqlToBeConfirmed |
|
| 49 | + */ |
|
| 46 | 50 | public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed) |
| 47 | 51 | { |
| 48 | 52 | try { |
@@ -35,6 +35,9 @@ |
||
| 35 | 35 | $this->_em = $this->_getTestEntityManager(); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | + /** |
|
| 39 | + * @param string $expectedDql |
|
| 40 | + */ |
|
| 38 | 41 | protected function assertValidQueryBuilder(QueryBuilder $qb, $expectedDql) |
| 39 | 42 | { |
| 40 | 43 | $dql = $qb->getDQL(); |
@@ -272,12 +272,12 @@ discard block |
||
| 272 | 272 | { |
| 273 | 273 | $qb = $this->_em->createQueryBuilder(); |
| 274 | 274 | $qb->select('u') |
| 275 | - ->from(CmsUser::class, 'u') |
|
| 276 | - ->where('u.id = :uid') |
|
| 277 | - ->orWhere('u.id = :uid2') |
|
| 278 | - ->andWhere('u.id = :uid3') |
|
| 279 | - ->orWhere('u.name = :name1', 'u.name = :name2') |
|
| 280 | - ->andWhere('u.name <> :noname'); |
|
| 275 | + ->from(CmsUser::class, 'u') |
|
| 276 | + ->where('u.id = :uid') |
|
| 277 | + ->orWhere('u.id = :uid2') |
|
| 278 | + ->andWhere('u.id = :uid3') |
|
| 279 | + ->orWhere('u.name = :name1', 'u.name = :name2') |
|
| 280 | + ->andWhere('u.name <> :noname'); |
|
| 281 | 281 | |
| 282 | 282 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (((u.id = :uid OR u.id = :uid2) AND u.id = :uid3) OR u.name = :name1 OR u.name = :name2) AND u.name <> :noname'); |
| 283 | 283 | } |
@@ -286,9 +286,9 @@ discard block |
||
| 286 | 286 | { |
| 287 | 287 | $qb = $this->_em->createQueryBuilder(); |
| 288 | 288 | $qb->select('u') |
| 289 | - ->from(CmsUser::class, 'u') |
|
| 290 | - ->where('u.id = :uid') |
|
| 291 | - ->andWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
| 289 | + ->from(CmsUser::class, 'u') |
|
| 290 | + ->where('u.id = :uid') |
|
| 291 | + ->andWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
| 292 | 292 | |
| 293 | 293 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id IN(1, 2, 3)'); |
| 294 | 294 | } |
@@ -297,9 +297,9 @@ discard block |
||
| 297 | 297 | { |
| 298 | 298 | $qb = $this->_em->createQueryBuilder(); |
| 299 | 299 | $qb->select('u') |
| 300 | - ->from(CmsUser::class, 'u') |
|
| 301 | - ->where('u.id = :uid') |
|
| 302 | - ->orWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
| 300 | + ->from(CmsUser::class, 'u') |
|
| 301 | + ->where('u.id = :uid') |
|
| 302 | + ->orWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
| 303 | 303 | |
| 304 | 304 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id IN(1, 2, 3)'); |
| 305 | 305 | } |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | { |
| 309 | 309 | $qb = $this->_em->createQueryBuilder(); |
| 310 | 310 | $qb->select('u') |
| 311 | - ->from(CmsUser::class, 'u') |
|
| 312 | - ->where('u.id = :uid') |
|
| 313 | - ->andWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
| 311 | + ->from(CmsUser::class, 'u') |
|
| 312 | + ->where('u.id = :uid') |
|
| 313 | + ->andWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
| 314 | 314 | |
| 315 | 315 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id NOT IN(1, 2, 3)'); |
| 316 | 316 | } |
@@ -319,9 +319,9 @@ discard block |
||
| 319 | 319 | { |
| 320 | 320 | $qb = $this->_em->createQueryBuilder(); |
| 321 | 321 | $qb->select('u') |
| 322 | - ->from(CmsUser::class, 'u') |
|
| 323 | - ->where('u.id = :uid') |
|
| 324 | - ->orWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
| 322 | + ->from(CmsUser::class, 'u') |
|
| 323 | + ->where('u.id = :uid') |
|
| 324 | + ->orWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
| 325 | 325 | |
| 326 | 326 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id NOT IN(1, 2, 3)'); |
| 327 | 327 | } |
@@ -617,8 +617,8 @@ discard block |
||
| 617 | 617 | { |
| 618 | 618 | $qb = $this->_em->createQueryBuilder(); |
| 619 | 619 | $qb->select('u') |
| 620 | - ->from(CmsUser::class, 'u') |
|
| 621 | - ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2')); |
|
| 620 | + ->from(CmsUser::class, 'u') |
|
| 621 | + ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2')); |
|
| 622 | 622 | |
| 623 | 623 | $parameters = new ArrayCollection(); |
| 624 | 624 | $parameters->add(new Parameter('username', 'jwage')); |
@@ -634,8 +634,8 @@ discard block |
||
| 634 | 634 | { |
| 635 | 635 | $qb = $this->_em->createQueryBuilder(); |
| 636 | 636 | $qb->select('u') |
| 637 | - ->from(CmsUser::class, 'u') |
|
| 638 | - ->where('u.id = :id'); |
|
| 637 | + ->from(CmsUser::class, 'u') |
|
| 638 | + ->where('u.id = :id'); |
|
| 639 | 639 | |
| 640 | 640 | $parameters = new ArrayCollection(); |
| 641 | 641 | $parameters->add(new Parameter('id', 1)); |
@@ -684,8 +684,8 @@ discard block |
||
| 684 | 684 | { |
| 685 | 685 | $qb = $this->_em->createQueryBuilder(); |
| 686 | 686 | $qb->select('u') |
| 687 | - ->from(CmsUser::class, 'u') |
|
| 688 | - ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2')); |
|
| 687 | + ->from(CmsUser::class, 'u') |
|
| 688 | + ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2')); |
|
| 689 | 689 | |
| 690 | 690 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id = :uid2'); |
| 691 | 691 | } |
@@ -698,8 +698,8 @@ discard block |
||
| 698 | 698 | $orExpr->add($qb->expr()->in('u.id', [1])); |
| 699 | 699 | |
| 700 | 700 | $qb->select('u') |
| 701 | - ->from(CmsUser::class, 'u') |
|
| 702 | - ->where($orExpr); |
|
| 701 | + ->from(CmsUser::class, 'u') |
|
| 702 | + ->where($orExpr); |
|
| 703 | 703 | |
| 704 | 704 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR u.id IN(1)'); |
| 705 | 705 | } |
@@ -708,8 +708,8 @@ discard block |
||
| 708 | 708 | { |
| 709 | 709 | $qb = $this->_em->createQueryBuilder(); |
| 710 | 710 | $qb->select('u') |
| 711 | - ->from(CmsUser::class, 'u') |
|
| 712 | - ->where($qb->expr()->in('u.name', ['one', 'two', 'three'])); |
|
| 711 | + ->from(CmsUser::class, 'u') |
|
| 712 | + ->where($qb->expr()->in('u.name', ['one', 'two', 'three'])); |
|
| 713 | 713 | |
| 714 | 714 | $this->assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')"); |
| 715 | 715 | |
@@ -723,8 +723,8 @@ discard block |
||
| 723 | 723 | $qb = $this->_em->createQueryBuilder(); |
| 724 | 724 | $expr = $this->_em->getExpressionBuilder(); |
| 725 | 725 | $qb->select('u') |
| 726 | - ->from(CmsUser::class, 'u') |
|
| 727 | - ->where($expr->in('u.name', [$expr->literal('one'), $expr->literal('two'), $expr->literal('three')])); |
|
| 726 | + ->from(CmsUser::class, 'u') |
|
| 727 | + ->where($expr->in('u.name', [$expr->literal('one'), $expr->literal('two'), $expr->literal('three')])); |
|
| 728 | 728 | |
| 729 | 729 | $this->assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')"); |
| 730 | 730 | |
@@ -742,8 +742,8 @@ discard block |
||
| 742 | 742 | |
| 743 | 743 | $qb = $this->_em->createQueryBuilder(); |
| 744 | 744 | $qb->select('u') |
| 745 | - ->from(CmsUser::class, 'u') |
|
| 746 | - ->where($orExpr); |
|
| 745 | + ->from(CmsUser::class, 'u') |
|
| 746 | + ->where($orExpr); |
|
| 747 | 747 | |
| 748 | 748 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR NOT(u.id IN(1))'); |
| 749 | 749 | } |
@@ -754,8 +754,8 @@ discard block |
||
| 754 | 754 | $expr = $this->_em->getExpressionBuilder(); |
| 755 | 755 | |
| 756 | 756 | $qb->select('u') |
| 757 | - ->from(CmsUser::class, 'u') |
|
| 758 | - ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a'))); |
|
| 757 | + ->from(CmsUser::class, 'u') |
|
| 758 | + ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a'))); |
|
| 759 | 759 | |
| 760 | 760 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ALL(select a.id from Doctrine\Tests\Models\CMS\CmsArticle a)'); |
| 761 | 761 | |
@@ -1121,9 +1121,9 @@ discard block |
||
| 1121 | 1121 | public function testRebuildsFromParts() |
| 1122 | 1122 | { |
| 1123 | 1123 | $qb = $this->_em->createQueryBuilder() |
| 1124 | - ->select('u') |
|
| 1125 | - ->from(CmsUser::class, 'u') |
|
| 1126 | - ->join('u.article', 'a'); |
|
| 1124 | + ->select('u') |
|
| 1125 | + ->from(CmsUser::class, 'u') |
|
| 1126 | + ->join('u.article', 'a'); |
|
| 1127 | 1127 | |
| 1128 | 1128 | $dqlParts = $qb->getDQLParts(); |
| 1129 | 1129 | $dql = $qb->getDQL(); |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $qb = $this->_em->createQueryBuilder(); |
| 548 | 548 | $qb->select('u') |
| 549 | 549 | ->from(CmsUser::class, 'u') |
| 550 | - ->join('u.article','a'); |
|
| 550 | + ->join('u.article', 'a'); |
|
| 551 | 551 | |
| 552 | 552 | $criteria = new Criteria(); |
| 553 | 553 | $criteria->orderBy(['a.field' => Criteria::DESC]); |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | ->from(CmsUser::class, 'u') |
| 825 | 825 | ->where('u.username = ?1')->orderBy('u.username'); |
| 826 | 826 | |
| 827 | - $this->assertEquals('u.username = ?1', (string)$qb->getDQLPart('where')); |
|
| 827 | + $this->assertEquals('u.username = ?1', (string) $qb->getDQLPart('where')); |
|
| 828 | 828 | $this->assertEquals(1, count($qb->getDQLPart('orderBy'))); |
| 829 | 829 | |
| 830 | 830 | $qb->resetDQLPart('where')->resetDQLPart('orderBy'); |
@@ -888,7 +888,7 @@ discard block |
||
| 888 | 888 | { |
| 889 | 889 | $qb = $this->_em->createQueryBuilder(); |
| 890 | 890 | $qb->select('alias1')->from(CmsUser::class, 'alias1'); |
| 891 | - $qb->join('alias1.articles','alias2'); |
|
| 891 | + $qb->join('alias1.articles', 'alias2'); |
|
| 892 | 892 | |
| 893 | 893 | $criteria = new Criteria(); |
| 894 | 894 | $criteria->where($criteria->expr()->eq('field', 'value1')); |
@@ -908,7 +908,7 @@ discard block |
||
| 908 | 908 | { |
| 909 | 909 | $qb = $this->_em->createQueryBuilder(); |
| 910 | 910 | $qb->select('alias1')->from(CmsUser::class, 'alias1'); |
| 911 | - $qb->join('alias1.articles','alias2'); |
|
| 911 | + $qb->join('alias1.articles', 'alias2'); |
|
| 912 | 912 | |
| 913 | 913 | $criteria = new Criteria(); |
| 914 | 914 | $criteria->where($criteria->expr()->eq('alias1.field', 'value1')); |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | { |
| 929 | 929 | $qb = $this->_em->createQueryBuilder(); |
| 930 | 930 | $qb->select('alias1')->from(CmsUser::class, 'alias1'); |
| 931 | - $qb->join('alias1.articles','alias2'); |
|
| 931 | + $qb->join('alias1.articles', 'alias2'); |
|
| 932 | 932 | |
| 933 | 933 | $criteria = new Criteria(); |
| 934 | 934 | $criteria->where($criteria->expr()->eq('alias1.field', 'value1')); |
@@ -1044,7 +1044,7 @@ discard block |
||
| 1044 | 1044 | { |
| 1045 | 1045 | $qb = $this->_em->createQueryBuilder() |
| 1046 | 1046 | ->add('select', 'u') |
| 1047 | - ->add('from', CmsUser::class . ' u'); |
|
| 1047 | + ->add('from', CmsUser::class.' u'); |
|
| 1048 | 1048 | |
| 1049 | 1049 | $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $qb->getDQL()); |
| 1050 | 1050 | } |
@@ -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)) { |
@@ -344,7 +344,7 @@ |
||
| 344 | 344 | { |
| 345 | 345 | $this->assertEquals('user', $class->associationMappings['address']['inversedBy']); |
| 346 | 346 | } |
| 347 | - /** |
|
| 347 | + /** |
|
| 348 | 348 | * @depends testExportDirectoryAndFilesAreCreated |
| 349 | 349 | */ |
| 350 | 350 | public function testCascadeAllCollapsed() |
@@ -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); |
@@ -420,11 +420,11 @@ discard block |
||
| 420 | 420 | ); |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | - $tableName = ($qComp['metadata']->isInheritanceTypeJoined()) |
|
| 423 | + $tableName = ($qComp['metadata']->isInheritanceTypeJoined()) |
|
| 424 | 424 | ? $persister->getOwningTable($fieldName) |
| 425 | 425 | : $qComp['metadata']->getTableName(); |
| 426 | 426 | |
| 427 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
| 427 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
| 428 | 428 | |
| 429 | 429 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
| 430 | 430 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
| 435 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
| 435 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | 438 | |
@@ -467,15 +467,15 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | $sqlTableAlias = ($this->useSqlTableAliases) |
| 470 | - ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.' |
|
| 470 | + ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.' |
|
| 471 | 471 | : ''; |
| 472 | 472 | |
| 473 | - $sqlParts[] = $sqlTableAlias . $class->discriminatorColumn['name'] . ' IN (' . implode(', ', $values) . ')'; |
|
| 473 | + $sqlParts[] = $sqlTableAlias.$class->discriminatorColumn['name'].' IN ('.implode(', ', $values).')'; |
|
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | $sql = implode(' AND ', $sqlParts); |
| 477 | 477 | |
| 478 | - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
| 478 | + return (count($sqlParts) > 1) ? '('.$sql.')' : $sql; |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | /** |
@@ -488,11 +488,11 @@ discard block |
||
| 488 | 488 | */ |
| 489 | 489 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
| 490 | 490 | { |
| 491 | - if (!$this->em->hasFilters()) { |
|
| 491 | + if ( ! $this->em->hasFilters()) { |
|
| 492 | 492 | return ''; |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | - switch($targetEntity->inheritanceType) { |
|
| 495 | + switch ($targetEntity->inheritanceType) { |
|
| 496 | 496 | case ClassMetadata::INHERITANCE_TYPE_NONE: |
| 497 | 497 | break; |
| 498 | 498 | case ClassMetadata::INHERITANCE_TYPE_JOINED: |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | $filterClauses = []; |
| 516 | 516 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 517 | 517 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 518 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 518 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 519 | 519 | } |
| 520 | 520 | } |
| 521 | 521 | |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | if ( ! $AST->orderByClause && ($orderBySql = $this->_generateOrderedCollectionOrderByItems())) { |
| 550 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
| 550 | + $sql .= ' ORDER BY '.$orderBySql; |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | if ($limit !== null || $offset !== null) { |
@@ -559,11 +559,11 @@ discard block |
||
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
| 562 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
| 562 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
| 566 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
| 566 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | $sqlParts = []; |
| 619 | 619 | |
| 620 | 620 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
| 621 | - $sqlParts[] = $tableAlias . '.' . $columnName; |
|
| 621 | + $sqlParts[] = $tableAlias.'.'.$columnName; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | return implode(', ', $sqlParts); |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
| 662 | 662 | |
| 663 | 663 | if ($this->useSqlTableAliases) { |
| 664 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
| 664 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | $sql .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | if ($this->useSqlTableAliases) { |
| 693 | - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; |
|
| 693 | + $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.'; |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | $sql .= reset($assoc['targetToSourceKeyColumns']); |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | */ |
| 709 | 709 | public function walkSelectClause($selectClause) |
| 710 | 710 | { |
| 711 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 711 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 712 | 712 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
| 713 | 713 | |
| 714 | 714 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | $discrColumn = $rootClass->discriminatorColumn; |
| 746 | 746 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
| 747 | 747 | |
| 748 | - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
| 748 | + $sqlSelectExpressions[] = $tblAlias.'.'.$discrColumn['name'].' AS '.$columnAlias; |
|
| 749 | 749 | |
| 750 | 750 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
| 751 | 751 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName'], false, $discrColumn['type']); |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | foreach ($class->associationMappings as $assoc) { |
| 761 | 761 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
| 762 | 762 | continue; |
| 763 | - } else if ( !$addMetaColumns && !isset($assoc['id'])) { |
|
| 763 | + } else if ( ! $addMetaColumns && ! isset($assoc['id'])) { |
|
| 764 | 764 | continue; |
| 765 | 765 | } |
| 766 | 766 | |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
| 776 | 776 | |
| 777 | 777 | $quotedColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
| 778 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
| 778 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
| 779 | 779 | |
| 780 | 780 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $isIdentifier, $columnType); |
| 781 | 781 | } |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
| 805 | 805 | |
| 806 | 806 | $quotedColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $subClass, $this->platform); |
| 807 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
| 807 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
| 808 | 808 | |
| 809 | 809 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $subClass->isIdentifier($columnName), $columnType); |
| 810 | 810 | } |
@@ -830,7 +830,7 @@ discard block |
||
| 830 | 830 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
| 831 | 831 | } |
| 832 | 832 | |
| 833 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 833 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 834 | 834 | } |
| 835 | 835 | |
| 836 | 836 | /** |
@@ -894,7 +894,7 @@ discard block |
||
| 894 | 894 | } |
| 895 | 895 | |
| 896 | 896 | $sql = $this->platform->appendLockHint( |
| 897 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
| 897 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
| 898 | 898 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
| 899 | 899 | $this->query->getHint(Query::HINT_LOCK_MODE) |
| 900 | 900 | ); |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | // Ensure we got the owning side, since it has all mapping info |
| 937 | 937 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
| 938 | 938 | |
| 939 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 939 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 940 | 940 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
| 941 | 941 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
| 942 | 942 | } |
@@ -956,12 +956,12 @@ discard block |
||
| 956 | 956 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 957 | 957 | |
| 958 | 958 | if ($relation['isOwningSide']) { |
| 959 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
| 959 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
| 960 | 960 | |
| 961 | 961 | continue; |
| 962 | 962 | } |
| 963 | 963 | |
| 964 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
| 964 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
| 965 | 965 | } |
| 966 | 966 | |
| 967 | 967 | // Apply remaining inheritance restrictions |
@@ -979,7 +979,7 @@ discard block |
||
| 979 | 979 | } |
| 980 | 980 | |
| 981 | 981 | $targetTableJoin = [ |
| 982 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 982 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 983 | 983 | 'condition' => implode(' AND ', $conditions), |
| 984 | 984 | ]; |
| 985 | 985 | break; |
@@ -999,10 +999,10 @@ discard block |
||
| 999 | 999 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 1000 | 1000 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 1001 | 1001 | |
| 1002 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
| 1002 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
| 1005 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
| 1006 | 1006 | |
| 1007 | 1007 | // Join target table |
| 1008 | 1008 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 1017 | 1017 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 1018 | 1018 | |
| 1019 | - $conditions[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
| 1019 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | 1022 | // Apply remaining inheritance restrictions |
@@ -1034,7 +1034,7 @@ discard block |
||
| 1034 | 1034 | } |
| 1035 | 1035 | |
| 1036 | 1036 | $targetTableJoin = [ |
| 1037 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1037 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1038 | 1038 | 'condition' => implode(' AND ', $conditions), |
| 1039 | 1039 | ]; |
| 1040 | 1040 | break; |
@@ -1044,22 +1044,22 @@ discard block |
||
| 1044 | 1044 | } |
| 1045 | 1045 | |
| 1046 | 1046 | // Handle WITH clause |
| 1047 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
| 1047 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
| 1048 | 1048 | |
| 1049 | 1049 | if ($targetClass->isInheritanceTypeJoined()) { |
| 1050 | 1050 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
| 1051 | 1051 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
| 1052 | 1052 | if ($withCondition) { |
| 1053 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
| 1053 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
| 1054 | 1054 | } else { |
| 1055 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
| 1055 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
| 1056 | 1056 | } |
| 1057 | 1057 | } else { |
| 1058 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
| 1058 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
| 1059 | 1059 | } |
| 1060 | 1060 | |
| 1061 | 1061 | if ($withCondition) { |
| 1062 | - $sql .= ' AND ' . $withCondition; |
|
| 1062 | + $sql .= ' AND '.$withCondition; |
|
| 1063 | 1063 | } |
| 1064 | 1064 | |
| 1065 | 1065 | // Apply the indexes |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
| 1095 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | 1098 | /** |
@@ -1109,10 +1109,10 @@ discard block |
||
| 1109 | 1109 | $this->orderedColumnsMap[$sql] = $type; |
| 1110 | 1110 | |
| 1111 | 1111 | if ($expr instanceof AST\Subselect) { |
| 1112 | - return '(' . $sql . ') ' . $type; |
|
| 1112 | + return '('.$sql.') '.$type; |
|
| 1113 | 1113 | } |
| 1114 | 1114 | |
| 1115 | - return $sql . ' ' . $type; |
|
| 1115 | + return $sql.' '.$type; |
|
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | /** |
@@ -1120,7 +1120,7 @@ discard block |
||
| 1120 | 1120 | */ |
| 1121 | 1121 | public function walkHavingClause($havingClause) |
| 1122 | 1122 | { |
| 1123 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1123 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | 1126 | /** |
@@ -1143,7 +1143,7 @@ discard block |
||
| 1143 | 1143 | $conditions = []; |
| 1144 | 1144 | |
| 1145 | 1145 | if ($join->conditionalExpression) { |
| 1146 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
| 1146 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | 1149 | $condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER) |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | 1169 | if ($conditions) { |
| 1170 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
| 1170 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | 1173 | break; |
@@ -1197,7 +1197,7 @@ discard block |
||
| 1197 | 1197 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
| 1198 | 1198 | } |
| 1199 | 1199 | |
| 1200 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
| 1200 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
| 1201 | 1201 | |
| 1202 | 1202 | return $sql; |
| 1203 | 1203 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | ? $this->conn->quote($nullIfExpression->secondExpression) |
| 1220 | 1220 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
| 1221 | 1221 | |
| 1222 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
| 1222 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
| 1223 | 1223 | } |
| 1224 | 1224 | |
| 1225 | 1225 | /** |
@@ -1234,11 +1234,11 @@ discard block |
||
| 1234 | 1234 | $sql = 'CASE'; |
| 1235 | 1235 | |
| 1236 | 1236 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
| 1237 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1238 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1237 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1238 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1239 | 1239 | } |
| 1240 | 1240 | |
| 1241 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
| 1241 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
| 1242 | 1242 | |
| 1243 | 1243 | return $sql; |
| 1244 | 1244 | } |
@@ -1252,14 +1252,14 @@ discard block |
||
| 1252 | 1252 | */ |
| 1253 | 1253 | public function walkSimpleCaseExpression($simpleCaseExpression) |
| 1254 | 1254 | { |
| 1255 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1255 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1256 | 1256 | |
| 1257 | 1257 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
| 1258 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1259 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1258 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1259 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1260 | 1260 | } |
| 1261 | 1261 | |
| 1262 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
| 1262 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
| 1263 | 1263 | |
| 1264 | 1264 | return $sql; |
| 1265 | 1265 | } |
@@ -1293,14 +1293,14 @@ discard block |
||
| 1293 | 1293 | $fieldMapping = $class->fieldMappings[$fieldName]; |
| 1294 | 1294 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
| 1295 | 1295 | $columnAlias = $this->getSQLColumnAlias($fieldMapping['columnName']); |
| 1296 | - $col = $sqlTableAlias . '.' . $columnName; |
|
| 1296 | + $col = $sqlTableAlias.'.'.$columnName; |
|
| 1297 | 1297 | |
| 1298 | 1298 | if (isset($fieldMapping['requireSQLConversion'])) { |
| 1299 | 1299 | $type = Type::getType($fieldMapping['type']); |
| 1300 | 1300 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | - $sql .= $col . ' AS ' . $columnAlias; |
|
| 1303 | + $sql .= $col.' AS '.$columnAlias; |
|
| 1304 | 1304 | |
| 1305 | 1305 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1306 | 1306 | |
@@ -1325,7 +1325,7 @@ discard block |
||
| 1325 | 1325 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
| 1326 | 1326 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1327 | 1327 | |
| 1328 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1328 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1329 | 1329 | |
| 1330 | 1330 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1331 | 1331 | |
@@ -1339,7 +1339,7 @@ discard block |
||
| 1339 | 1339 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
| 1340 | 1340 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1341 | 1341 | |
| 1342 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1342 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1343 | 1343 | |
| 1344 | 1344 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1345 | 1345 | |
@@ -1350,7 +1350,7 @@ discard block |
||
| 1350 | 1350 | break; |
| 1351 | 1351 | |
| 1352 | 1352 | case ($expr instanceof AST\NewObjectExpression): |
| 1353 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
| 1353 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
| 1354 | 1354 | break; |
| 1355 | 1355 | |
| 1356 | 1356 | default: |
@@ -1391,14 +1391,14 @@ discard block |
||
| 1391 | 1391 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
| 1392 | 1392 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
| 1393 | 1393 | |
| 1394 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
| 1394 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
| 1395 | 1395 | |
| 1396 | 1396 | if (isset($mapping['requireSQLConversion'])) { |
| 1397 | 1397 | $type = Type::getType($mapping['type']); |
| 1398 | 1398 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
| 1399 | 1399 | } |
| 1400 | 1400 | |
| 1401 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
| 1401 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
| 1402 | 1402 | |
| 1403 | 1403 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
| 1404 | 1404 | |
@@ -1415,21 +1415,21 @@ discard block |
||
| 1415 | 1415 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
| 1416 | 1416 | |
| 1417 | 1417 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
| 1418 | - if (isset($mapping['inherited']) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
| 1418 | + if (isset($mapping['inherited']) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
| 1419 | 1419 | continue; |
| 1420 | 1420 | } |
| 1421 | 1421 | |
| 1422 | 1422 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
| 1423 | 1423 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
| 1424 | 1424 | |
| 1425 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
| 1425 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
| 1426 | 1426 | |
| 1427 | 1427 | if (isset($mapping['requireSQLConversion'])) { |
| 1428 | 1428 | $type = Type::getType($mapping['type']); |
| 1429 | 1429 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
| 1430 | 1430 | } |
| 1431 | 1431 | |
| 1432 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
| 1432 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
| 1433 | 1433 | |
| 1434 | 1434 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
| 1435 | 1435 | |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | */ |
| 1450 | 1450 | public function walkQuantifiedExpression($qExpr) |
| 1451 | 1451 | { |
| 1452 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
| 1452 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | 1455 | /** |
@@ -1489,7 +1489,7 @@ discard block |
||
| 1489 | 1489 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
| 1490 | 1490 | } |
| 1491 | 1491 | |
| 1492 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 1492 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 1493 | 1493 | } |
| 1494 | 1494 | |
| 1495 | 1495 | /** |
@@ -1497,7 +1497,7 @@ discard block |
||
| 1497 | 1497 | */ |
| 1498 | 1498 | public function walkSimpleSelectClause($simpleSelectClause) |
| 1499 | 1499 | { |
| 1500 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1500 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1501 | 1501 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
| 1502 | 1502 | } |
| 1503 | 1503 | |
@@ -1516,10 +1516,10 @@ discard block |
||
| 1516 | 1516 | * @param null|string $newObjectResultAlias |
| 1517 | 1517 | * @return string The SQL. |
| 1518 | 1518 | */ |
| 1519 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
| 1519 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
| 1520 | 1520 | { |
| 1521 | 1521 | $sqlSelectExpressions = []; |
| 1522 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
| 1522 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
| 1523 | 1523 | |
| 1524 | 1524 | foreach ($newObjectExpression->args as $argIndex => $e) { |
| 1525 | 1525 | $resultAlias = $this->scalarResultCounter++; |
@@ -1532,7 +1532,7 @@ discard block |
||
| 1532 | 1532 | break; |
| 1533 | 1533 | |
| 1534 | 1534 | case ($e instanceof AST\Subselect): |
| 1535 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
| 1535 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
| 1536 | 1536 | break; |
| 1537 | 1537 | |
| 1538 | 1538 | case ($e instanceof AST\PathExpression): |
@@ -1541,7 +1541,7 @@ discard block |
||
| 1541 | 1541 | $class = $qComp['metadata']; |
| 1542 | 1542 | $fieldType = $class->fieldMappings[$e->field]['type']; |
| 1543 | 1543 | |
| 1544 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1544 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
| 1545 | 1545 | break; |
| 1546 | 1546 | |
| 1547 | 1547 | case ($e instanceof AST\Literal): |
@@ -1555,11 +1555,11 @@ discard block |
||
| 1555 | 1555 | break; |
| 1556 | 1556 | } |
| 1557 | 1557 | |
| 1558 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1558 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
| 1559 | 1559 | break; |
| 1560 | 1560 | |
| 1561 | 1561 | default: |
| 1562 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1562 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
| 1563 | 1563 | break; |
| 1564 | 1564 | } |
| 1565 | 1565 | |
@@ -1592,10 +1592,10 @@ discard block |
||
| 1592 | 1592 | case ($expr instanceof AST\Subselect): |
| 1593 | 1593 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1594 | 1594 | |
| 1595 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
| 1595 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
| 1596 | 1596 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1597 | 1597 | |
| 1598 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1598 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1599 | 1599 | break; |
| 1600 | 1600 | |
| 1601 | 1601 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1612,7 +1612,7 @@ discard block |
||
| 1612 | 1612 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
| 1613 | 1613 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1614 | 1614 | |
| 1615 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1615 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1616 | 1616 | break; |
| 1617 | 1617 | |
| 1618 | 1618 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1632,8 +1632,8 @@ discard block |
||
| 1632 | 1632 | */ |
| 1633 | 1633 | public function walkAggregateExpression($aggExpression) |
| 1634 | 1634 | { |
| 1635 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1636 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
| 1635 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1636 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
| 1637 | 1637 | } |
| 1638 | 1638 | |
| 1639 | 1639 | /** |
@@ -1647,7 +1647,7 @@ discard block |
||
| 1647 | 1647 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
| 1648 | 1648 | } |
| 1649 | 1649 | |
| 1650 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
| 1650 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | /** |
@@ -1704,7 +1704,7 @@ discard block |
||
| 1704 | 1704 | { |
| 1705 | 1705 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
| 1706 | 1706 | $tableName = $class->getTableName(); |
| 1707 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
| 1707 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
| 1708 | 1708 | |
| 1709 | 1709 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
| 1710 | 1710 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1719,12 +1719,12 @@ discard block |
||
| 1719 | 1719 | { |
| 1720 | 1720 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
| 1721 | 1721 | $tableName = $class->getTableName(); |
| 1722 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
| 1722 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
| 1723 | 1723 | |
| 1724 | 1724 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
| 1725 | 1725 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
| 1726 | 1726 | |
| 1727 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1727 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1728 | 1728 | |
| 1729 | 1729 | return $sql; |
| 1730 | 1730 | } |
@@ -1737,7 +1737,7 @@ discard block |
||
| 1737 | 1737 | $useTableAliasesBefore = $this->useSqlTableAliases; |
| 1738 | 1738 | $this->useSqlTableAliases = false; |
| 1739 | 1739 | |
| 1740 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
| 1740 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
| 1741 | 1741 | $newValue = $updateItem->newValue; |
| 1742 | 1742 | |
| 1743 | 1743 | switch (true) { |
@@ -1780,7 +1780,7 @@ discard block |
||
| 1780 | 1780 | |
| 1781 | 1781 | if (count($filterClauses)) { |
| 1782 | 1782 | if ($condSql) { |
| 1783 | - $condSql = '(' . $condSql . ') AND '; |
|
| 1783 | + $condSql = '('.$condSql.') AND '; |
|
| 1784 | 1784 | } |
| 1785 | 1785 | |
| 1786 | 1786 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1788,11 +1788,11 @@ discard block |
||
| 1788 | 1788 | } |
| 1789 | 1789 | |
| 1790 | 1790 | if ($condSql) { |
| 1791 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
| 1791 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
| 1792 | 1792 | } |
| 1793 | 1793 | |
| 1794 | 1794 | if ($discrSql) { |
| 1795 | - return ' WHERE ' . $discrSql; |
|
| 1795 | + return ' WHERE '.$discrSql; |
|
| 1796 | 1796 | } |
| 1797 | 1797 | |
| 1798 | 1798 | return ''; |
@@ -1835,7 +1835,7 @@ discard block |
||
| 1835 | 1835 | // if only one ConditionalPrimary is defined |
| 1836 | 1836 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
| 1837 | 1837 | ? $this->walkConditionalPrimary($factor) |
| 1838 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1838 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1839 | 1839 | } |
| 1840 | 1840 | |
| 1841 | 1841 | /** |
@@ -1850,7 +1850,7 @@ discard block |
||
| 1850 | 1850 | if ($primary->isConditionalExpression()) { |
| 1851 | 1851 | $condExpr = $primary->conditionalExpression; |
| 1852 | 1852 | |
| 1853 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
| 1853 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
| 1854 | 1854 | } |
| 1855 | 1855 | } |
| 1856 | 1856 | |
@@ -1861,7 +1861,7 @@ discard block |
||
| 1861 | 1861 | { |
| 1862 | 1862 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
| 1863 | 1863 | |
| 1864 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
| 1864 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
| 1865 | 1865 | |
| 1866 | 1866 | return $sql; |
| 1867 | 1867 | } |
@@ -1905,7 +1905,7 @@ discard block |
||
| 1905 | 1905 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
| 1906 | 1906 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1907 | 1907 | |
| 1908 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
| 1908 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
| 1909 | 1909 | |
| 1910 | 1910 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
| 1911 | 1911 | $sqlParts = []; |
@@ -1913,7 +1913,7 @@ discard block |
||
| 1913 | 1913 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
| 1914 | 1914 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
| 1915 | 1915 | |
| 1916 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
| 1916 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
| 1917 | 1917 | } |
| 1918 | 1918 | |
| 1919 | 1919 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1921,7 +1921,7 @@ discard block |
||
| 1921 | 1921 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
| 1924 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
| 1925 | 1925 | } |
| 1926 | 1926 | |
| 1927 | 1927 | $sql .= implode(' AND ', $sqlParts); |
@@ -1937,8 +1937,8 @@ discard block |
||
| 1937 | 1937 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1938 | 1938 | |
| 1939 | 1939 | // join to target table |
| 1940 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
| 1941 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
| 1940 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
| 1941 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
| 1942 | 1942 | |
| 1943 | 1943 | // join conditions |
| 1944 | 1944 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1947,7 +1947,7 @@ discard block |
||
| 1947 | 1947 | foreach ($joinColumns as $joinColumn) { |
| 1948 | 1948 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
| 1949 | 1949 | |
| 1950 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
| 1950 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
| 1951 | 1951 | } |
| 1952 | 1952 | |
| 1953 | 1953 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -1959,7 +1959,7 @@ discard block |
||
| 1959 | 1959 | foreach ($joinColumns as $joinColumn) { |
| 1960 | 1960 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
| 1961 | 1961 | |
| 1962 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
| 1962 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
| 1963 | 1963 | } |
| 1964 | 1964 | |
| 1965 | 1965 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1967,13 +1967,13 @@ discard block |
||
| 1967 | 1967 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 1968 | 1968 | } |
| 1969 | 1969 | |
| 1970 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
| 1970 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
| 1971 | 1971 | } |
| 1972 | 1972 | |
| 1973 | 1973 | $sql .= implode(' AND ', $sqlParts); |
| 1974 | 1974 | } |
| 1975 | 1975 | |
| 1976 | - return $sql . ')'; |
|
| 1976 | + return $sql.')'; |
|
| 1977 | 1977 | } |
| 1978 | 1978 | |
| 1979 | 1979 | /** |
@@ -1984,7 +1984,7 @@ discard block |
||
| 1984 | 1984 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
| 1985 | 1985 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
| 1986 | 1986 | |
| 1987 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 1987 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 1988 | 1988 | } |
| 1989 | 1989 | |
| 1990 | 1990 | /** |
@@ -1993,19 +1993,19 @@ discard block |
||
| 1993 | 1993 | public function walkNullComparisonExpression($nullCompExpr) |
| 1994 | 1994 | { |
| 1995 | 1995 | $expression = $nullCompExpr->expression; |
| 1996 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
| 1996 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
| 1997 | 1997 | |
| 1998 | 1998 | // Handle ResultVariable |
| 1999 | 1999 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
| 2000 | - return $this->walkResultVariable($expression) . $comparison; |
|
| 2000 | + return $this->walkResultVariable($expression).$comparison; |
|
| 2001 | 2001 | } |
| 2002 | 2002 | |
| 2003 | 2003 | // Handle InputParameter mapping inclusion to ParserResult |
| 2004 | 2004 | if ($expression instanceof AST\InputParameter) { |
| 2005 | - return $this->walkInputParameter($expression) . $comparison; |
|
| 2005 | + return $this->walkInputParameter($expression).$comparison; |
|
| 2006 | 2006 | } |
| 2007 | 2007 | |
| 2008 | - return $expression->dispatch($this) . $comparison; |
|
| 2008 | + return $expression->dispatch($this).$comparison; |
|
| 2009 | 2009 | } |
| 2010 | 2010 | |
| 2011 | 2011 | /** |
@@ -2013,7 +2013,7 @@ discard block |
||
| 2013 | 2013 | */ |
| 2014 | 2014 | public function walkInExpression($inExpr) |
| 2015 | 2015 | { |
| 2016 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
| 2016 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
| 2017 | 2017 | |
| 2018 | 2018 | $sql .= ($inExpr->subselect) |
| 2019 | 2019 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2039,10 +2039,10 @@ discard block |
||
| 2039 | 2039 | } |
| 2040 | 2040 | |
| 2041 | 2041 | if ($this->useSqlTableAliases) { |
| 2042 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
| 2042 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
| 2043 | 2043 | } |
| 2044 | 2044 | |
| 2045 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
| 2045 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
| 2046 | 2046 | |
| 2047 | 2047 | $sqlParameterList = []; |
| 2048 | 2048 | |
@@ -2072,7 +2072,7 @@ discard block |
||
| 2072 | 2072 | $sqlParameterList[] = $this->conn->quote($discriminatorValue); |
| 2073 | 2073 | } |
| 2074 | 2074 | |
| 2075 | - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; |
|
| 2075 | + $sql .= '('.implode(', ', $sqlParameterList).')'; |
|
| 2076 | 2076 | |
| 2077 | 2077 | return $sql; |
| 2078 | 2078 | } |
@@ -2118,8 +2118,8 @@ discard block |
||
| 2118 | 2118 | $sql .= ' NOT'; |
| 2119 | 2119 | } |
| 2120 | 2120 | |
| 2121 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2122 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2121 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2122 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2123 | 2123 | |
| 2124 | 2124 | return $sql; |
| 2125 | 2125 | } |
@@ -2134,7 +2134,7 @@ discard block |
||
| 2134 | 2134 | ? $this->walkResultVariable($stringExpr) |
| 2135 | 2135 | : $stringExpr->dispatch($this); |
| 2136 | 2136 | |
| 2137 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
| 2137 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
| 2138 | 2138 | |
| 2139 | 2139 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
| 2140 | 2140 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2147,7 +2147,7 @@ discard block |
||
| 2147 | 2147 | } |
| 2148 | 2148 | |
| 2149 | 2149 | if ($likeExpr->escapeChar) { |
| 2150 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
| 2150 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
| 2151 | 2151 | } |
| 2152 | 2152 | |
| 2153 | 2153 | return $sql; |
@@ -2174,7 +2174,7 @@ discard block |
||
| 2174 | 2174 | ? $leftExpr->dispatch($this) |
| 2175 | 2175 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
| 2176 | 2176 | |
| 2177 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
| 2177 | + $sql .= ' '.$compExpr->operator.' '; |
|
| 2178 | 2178 | |
| 2179 | 2179 | $sql .= ($rightExpr instanceof AST\Node) |
| 2180 | 2180 | ? $rightExpr->dispatch($this) |
@@ -2206,7 +2206,7 @@ discard block |
||
| 2206 | 2206 | { |
| 2207 | 2207 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
| 2208 | 2208 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
| 2209 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
| 2209 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
| 2210 | 2210 | } |
| 2211 | 2211 | |
| 2212 | 2212 | /** |
@@ -2260,7 +2260,7 @@ discard block |
||
| 2260 | 2260 | |
| 2261 | 2261 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
| 2262 | 2262 | |
| 2263 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2263 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2264 | 2264 | } |
| 2265 | 2265 | |
| 2266 | 2266 | /** |
@@ -2273,7 +2273,7 @@ discard block |
||
| 2273 | 2273 | public function walkArithmeticPrimary($primary) |
| 2274 | 2274 | { |
| 2275 | 2275 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
| 2276 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
| 2276 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
| 2277 | 2277 | } |
| 2278 | 2278 | |
| 2279 | 2279 | if ($primary instanceof AST\Node) { |