@@ -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); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ? $persister->getOwningTable($fieldName) |
416 | 416 | : $qComp['metadata']->getTableName(); |
417 | 417 | |
418 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
418 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
419 | 419 | |
420 | 420 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
421 | 421 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | } |
424 | 424 | |
425 | 425 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
426 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
426 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
427 | 427 | } |
428 | 428 | } |
429 | 429 | |
@@ -458,15 +458,15 @@ discard block |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | $sqlTableAlias = ($this->useSqlTableAliases) |
461 | - ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.' |
|
461 | + ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.' |
|
462 | 462 | : ''; |
463 | 463 | |
464 | - $sqlParts[] = $sqlTableAlias . $class->discriminatorColumn['name'] . ' IN (' . implode(', ', $values) . ')'; |
|
464 | + $sqlParts[] = $sqlTableAlias.$class->discriminatorColumn['name'].' IN ('.implode(', ', $values).')'; |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | $sql = implode(' AND ', $sqlParts); |
468 | 468 | |
469 | - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
469 | + return (count($sqlParts) > 1) ? '('.$sql.')' : $sql; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
@@ -479,11 +479,11 @@ discard block |
||
479 | 479 | */ |
480 | 480 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
481 | 481 | { |
482 | - if (!$this->em->hasFilters()) { |
|
482 | + if ( ! $this->em->hasFilters()) { |
|
483 | 483 | return ''; |
484 | 484 | } |
485 | 485 | |
486 | - switch($targetEntity->inheritanceType) { |
|
486 | + switch ($targetEntity->inheritanceType) { |
|
487 | 487 | case ClassMetadata::INHERITANCE_TYPE_NONE: |
488 | 488 | break; |
489 | 489 | case ClassMetadata::INHERITANCE_TYPE_JOINED: |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | $filterClauses = []; |
507 | 507 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
508 | 508 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
509 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
509 | + $filterClauses[] = '('.$filterExpr.')'; |
|
510 | 510 | } |
511 | 511 | } |
512 | 512 | |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | |
540 | 540 | if ( ! $AST->orderByClause && ($orderBySql = $this->_generateOrderedCollectionOrderByItems())) { |
541 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
541 | + $sql .= ' ORDER BY '.$orderBySql; |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | if ($limit !== null || $offset !== null) { |
@@ -550,11 +550,11 @@ discard block |
||
550 | 550 | } |
551 | 551 | |
552 | 552 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
553 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
553 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
554 | 554 | } |
555 | 555 | |
556 | 556 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
557 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
557 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | $sqlParts = []; |
610 | 610 | |
611 | 611 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
612 | - $sqlParts[] = $tableAlias . '.' . $columnName; |
|
612 | + $sqlParts[] = $tableAlias.'.'.$columnName; |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | return implode(', ', $sqlParts); |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
652 | 652 | |
653 | 653 | if ($this->useSqlTableAliases) { |
654 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
654 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | $sql .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | } |
681 | 681 | |
682 | 682 | if ($this->useSqlTableAliases) { |
683 | - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; |
|
683 | + $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.'; |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | $sql .= reset($assoc['targetToSourceKeyColumns']); |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | */ |
699 | 699 | public function walkSelectClause($selectClause) |
700 | 700 | { |
701 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
701 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
702 | 702 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
703 | 703 | |
704 | 704 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $discrColumn = $rootClass->discriminatorColumn; |
736 | 736 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
737 | 737 | |
738 | - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
738 | + $sqlSelectExpressions[] = $tblAlias.'.'.$discrColumn['name'].' AS '.$columnAlias; |
|
739 | 739 | |
740 | 740 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
741 | 741 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName'], false, $discrColumn['type']); |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | foreach ($class->associationMappings as $assoc) { |
751 | 751 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
752 | 752 | continue; |
753 | - } else if ( !$addMetaColumns && !isset($assoc['id'])) { |
|
753 | + } else if ( ! $addMetaColumns && ! isset($assoc['id'])) { |
|
754 | 754 | continue; |
755 | 755 | } |
756 | 756 | |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
766 | 766 | |
767 | 767 | $quotedColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
768 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
768 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
769 | 769 | |
770 | 770 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $isIdentifier, $columnType); |
771 | 771 | } |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
795 | 795 | |
796 | 796 | $quotedColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $subClass, $this->platform); |
797 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
797 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
798 | 798 | |
799 | 799 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $subClass->isIdentifier($columnName), $columnType); |
800 | 800 | } |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
821 | 821 | } |
822 | 822 | |
823 | - return ' FROM ' . implode(', ', $sqlParts); |
|
823 | + return ' FROM '.implode(', ', $sqlParts); |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | /** |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | } |
885 | 885 | |
886 | 886 | $sql = $this->platform->appendLockHint( |
887 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
887 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
888 | 888 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
889 | 889 | $this->query->getHint(Query::HINT_LOCK_MODE) |
890 | 890 | ); |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | // Ensure we got the owning side, since it has all mapping info |
927 | 927 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
928 | 928 | |
929 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
929 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
930 | 930 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
931 | 931 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
932 | 932 | } |
@@ -946,12 +946,12 @@ discard block |
||
946 | 946 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
947 | 947 | |
948 | 948 | if ($relation['isOwningSide']) { |
949 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
949 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
950 | 950 | |
951 | 951 | continue; |
952 | 952 | } |
953 | 953 | |
954 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
954 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | // Apply remaining inheritance restrictions |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | } |
970 | 970 | |
971 | 971 | $targetTableJoin = [ |
972 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
972 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
973 | 973 | 'condition' => implode(' AND ', $conditions), |
974 | 974 | ]; |
975 | 975 | break; |
@@ -989,10 +989,10 @@ discard block |
||
989 | 989 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
990 | 990 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
991 | 991 | |
992 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
992 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
993 | 993 | } |
994 | 994 | |
995 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
995 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
996 | 996 | |
997 | 997 | // Join target table |
998 | 998 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1006,7 +1006,7 @@ discard block |
||
1006 | 1006 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1007 | 1007 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1008 | 1008 | |
1009 | - $conditions[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1009 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | // Apply remaining inheritance restrictions |
@@ -1024,7 +1024,7 @@ discard block |
||
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | $targetTableJoin = [ |
1027 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1027 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1028 | 1028 | 'condition' => implode(' AND ', $conditions), |
1029 | 1029 | ]; |
1030 | 1030 | break; |
@@ -1034,22 +1034,22 @@ discard block |
||
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | // Handle WITH clause |
1037 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1037 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1038 | 1038 | |
1039 | 1039 | if ($targetClass->isInheritanceTypeJoined()) { |
1040 | 1040 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1041 | 1041 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1042 | 1042 | if ($withCondition) { |
1043 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1043 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1044 | 1044 | } else { |
1045 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1045 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1046 | 1046 | } |
1047 | 1047 | } else { |
1048 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1048 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1049 | 1049 | } |
1050 | 1050 | |
1051 | 1051 | if ($withCondition) { |
1052 | - $sql .= ' AND ' . $withCondition; |
|
1052 | + $sql .= ' AND '.$withCondition; |
|
1053 | 1053 | } |
1054 | 1054 | |
1055 | 1055 | // Apply the indexes |
@@ -1082,7 +1082,7 @@ discard block |
||
1082 | 1082 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1083 | 1083 | } |
1084 | 1084 | |
1085 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1085 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1086 | 1086 | } |
1087 | 1087 | |
1088 | 1088 | /** |
@@ -1099,10 +1099,10 @@ discard block |
||
1099 | 1099 | $this->orderedColumnsMap[$sql] = $type; |
1100 | 1100 | |
1101 | 1101 | if ($expr instanceof AST\Subselect) { |
1102 | - return '(' . $sql . ') ' . $type; |
|
1102 | + return '('.$sql.') '.$type; |
|
1103 | 1103 | } |
1104 | 1104 | |
1105 | - return $sql . ' ' . $type; |
|
1105 | + return $sql.' '.$type; |
|
1106 | 1106 | } |
1107 | 1107 | |
1108 | 1108 | /** |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | */ |
1111 | 1111 | public function walkHavingClause($havingClause) |
1112 | 1112 | { |
1113 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1113 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1114 | 1114 | } |
1115 | 1115 | |
1116 | 1116 | /** |
@@ -1133,7 +1133,7 @@ discard block |
||
1133 | 1133 | $conditions = []; |
1134 | 1134 | |
1135 | 1135 | if ($join->conditionalExpression) { |
1136 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1136 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1137 | 1137 | } |
1138 | 1138 | |
1139 | 1139 | $condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER) |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | } |
1158 | 1158 | |
1159 | 1159 | if ($conditions) { |
1160 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1160 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1161 | 1161 | } |
1162 | 1162 | |
1163 | 1163 | break; |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1188 | 1188 | } |
1189 | 1189 | |
1190 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1190 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1191 | 1191 | |
1192 | 1192 | return $sql; |
1193 | 1193 | } |
@@ -1209,7 +1209,7 @@ discard block |
||
1209 | 1209 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1210 | 1210 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1211 | 1211 | |
1212 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1212 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | /** |
@@ -1224,11 +1224,11 @@ discard block |
||
1224 | 1224 | $sql = 'CASE'; |
1225 | 1225 | |
1226 | 1226 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1227 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1228 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1227 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1228 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1229 | 1229 | } |
1230 | 1230 | |
1231 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1231 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1232 | 1232 | |
1233 | 1233 | return $sql; |
1234 | 1234 | } |
@@ -1242,14 +1242,14 @@ discard block |
||
1242 | 1242 | */ |
1243 | 1243 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1244 | 1244 | { |
1245 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1245 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1246 | 1246 | |
1247 | 1247 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1248 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1249 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1248 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1249 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1250 | 1250 | } |
1251 | 1251 | |
1252 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1252 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1253 | 1253 | |
1254 | 1254 | return $sql; |
1255 | 1255 | } |
@@ -1283,14 +1283,14 @@ discard block |
||
1283 | 1283 | $fieldMapping = $class->fieldMappings[$fieldName]; |
1284 | 1284 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1285 | 1285 | $columnAlias = $this->getSQLColumnAlias($fieldMapping['columnName']); |
1286 | - $col = $sqlTableAlias . '.' . $columnName; |
|
1286 | + $col = $sqlTableAlias.'.'.$columnName; |
|
1287 | 1287 | |
1288 | 1288 | if (isset($fieldMapping['requireSQLConversion'])) { |
1289 | 1289 | $type = Type::getType($fieldMapping['type']); |
1290 | 1290 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
1291 | 1291 | } |
1292 | 1292 | |
1293 | - $sql .= $col . ' AS ' . $columnAlias; |
|
1293 | + $sql .= $col.' AS '.$columnAlias; |
|
1294 | 1294 | |
1295 | 1295 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1296 | 1296 | |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1316 | 1316 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1317 | 1317 | |
1318 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1318 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1319 | 1319 | |
1320 | 1320 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1321 | 1321 | |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1330 | 1330 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1331 | 1331 | |
1332 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1332 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1333 | 1333 | |
1334 | 1334 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1335 | 1335 | |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | break; |
1341 | 1341 | |
1342 | 1342 | case ($expr instanceof AST\NewObjectExpression): |
1343 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1343 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1344 | 1344 | break; |
1345 | 1345 | |
1346 | 1346 | default: |
@@ -1381,14 +1381,14 @@ discard block |
||
1381 | 1381 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1382 | 1382 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1383 | 1383 | |
1384 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1384 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1385 | 1385 | |
1386 | 1386 | if (isset($mapping['requireSQLConversion'])) { |
1387 | 1387 | $type = Type::getType($mapping['type']); |
1388 | 1388 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1389 | 1389 | } |
1390 | 1390 | |
1391 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
1391 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1392 | 1392 | |
1393 | 1393 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1394 | 1394 | |
@@ -1405,21 +1405,21 @@ discard block |
||
1405 | 1405 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
1406 | 1406 | |
1407 | 1407 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
1408 | - if (isset($mapping['inherited']) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
1408 | + if (isset($mapping['inherited']) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
1409 | 1409 | continue; |
1410 | 1410 | } |
1411 | 1411 | |
1412 | 1412 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1413 | 1413 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
1414 | 1414 | |
1415 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1415 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1416 | 1416 | |
1417 | 1417 | if (isset($mapping['requireSQLConversion'])) { |
1418 | 1418 | $type = Type::getType($mapping['type']); |
1419 | 1419 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1420 | 1420 | } |
1421 | 1421 | |
1422 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
1422 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1423 | 1423 | |
1424 | 1424 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1425 | 1425 | |
@@ -1439,7 +1439,7 @@ discard block |
||
1439 | 1439 | */ |
1440 | 1440 | public function walkQuantifiedExpression($qExpr) |
1441 | 1441 | { |
1442 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1442 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1443 | 1443 | } |
1444 | 1444 | |
1445 | 1445 | /** |
@@ -1479,7 +1479,7 @@ discard block |
||
1479 | 1479 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1480 | 1480 | } |
1481 | 1481 | |
1482 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1482 | + return ' FROM '.implode(', ', $sqlParts); |
|
1483 | 1483 | } |
1484 | 1484 | |
1485 | 1485 | /** |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | */ |
1488 | 1488 | public function walkSimpleSelectClause($simpleSelectClause) |
1489 | 1489 | { |
1490 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1490 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1491 | 1491 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1492 | 1492 | } |
1493 | 1493 | |
@@ -1506,10 +1506,10 @@ discard block |
||
1506 | 1506 | * @param null|string $newObjectResultAlias |
1507 | 1507 | * @return string The SQL. |
1508 | 1508 | */ |
1509 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1509 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1510 | 1510 | { |
1511 | 1511 | $sqlSelectExpressions = []; |
1512 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
1512 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
1513 | 1513 | |
1514 | 1514 | foreach ($newObjectExpression->args as $argIndex => $e) { |
1515 | 1515 | $resultAlias = $this->scalarResultCounter++; |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | break; |
1523 | 1523 | |
1524 | 1524 | case ($e instanceof AST\Subselect): |
1525 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1525 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1526 | 1526 | break; |
1527 | 1527 | |
1528 | 1528 | case ($e instanceof AST\PathExpression): |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | $class = $qComp['metadata']; |
1532 | 1532 | $fieldType = $class->fieldMappings[$e->field]['type']; |
1533 | 1533 | |
1534 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1534 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1535 | 1535 | break; |
1536 | 1536 | |
1537 | 1537 | case ($e instanceof AST\Literal): |
@@ -1545,11 +1545,11 @@ discard block |
||
1545 | 1545 | break; |
1546 | 1546 | } |
1547 | 1547 | |
1548 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1548 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1549 | 1549 | break; |
1550 | 1550 | |
1551 | 1551 | default: |
1552 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1552 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1553 | 1553 | break; |
1554 | 1554 | } |
1555 | 1555 | |
@@ -1582,10 +1582,10 @@ discard block |
||
1582 | 1582 | case ($expr instanceof AST\Subselect): |
1583 | 1583 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1584 | 1584 | |
1585 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1585 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1586 | 1586 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1587 | 1587 | |
1588 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1588 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1589 | 1589 | break; |
1590 | 1590 | |
1591 | 1591 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1602,7 +1602,7 @@ discard block |
||
1602 | 1602 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1603 | 1603 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1604 | 1604 | |
1605 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1605 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1606 | 1606 | break; |
1607 | 1607 | |
1608 | 1608 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1622,8 +1622,8 @@ discard block |
||
1622 | 1622 | */ |
1623 | 1623 | public function walkAggregateExpression($aggExpression) |
1624 | 1624 | { |
1625 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1626 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1625 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1626 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1627 | 1627 | } |
1628 | 1628 | |
1629 | 1629 | /** |
@@ -1637,7 +1637,7 @@ discard block |
||
1637 | 1637 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1638 | 1638 | } |
1639 | 1639 | |
1640 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1640 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1641 | 1641 | } |
1642 | 1642 | |
1643 | 1643 | /** |
@@ -1694,7 +1694,7 @@ discard block |
||
1694 | 1694 | { |
1695 | 1695 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1696 | 1696 | $tableName = $class->getTableName(); |
1697 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1697 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1698 | 1698 | |
1699 | 1699 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1700 | 1700 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1709,12 +1709,12 @@ discard block |
||
1709 | 1709 | { |
1710 | 1710 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1711 | 1711 | $tableName = $class->getTableName(); |
1712 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1712 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1713 | 1713 | |
1714 | 1714 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1715 | 1715 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1716 | 1716 | |
1717 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1717 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1718 | 1718 | |
1719 | 1719 | return $sql; |
1720 | 1720 | } |
@@ -1727,7 +1727,7 @@ discard block |
||
1727 | 1727 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1728 | 1728 | $this->useSqlTableAliases = false; |
1729 | 1729 | |
1730 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1730 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1731 | 1731 | $newValue = $updateItem->newValue; |
1732 | 1732 | |
1733 | 1733 | switch (true) { |
@@ -1770,7 +1770,7 @@ discard block |
||
1770 | 1770 | |
1771 | 1771 | if (count($filterClauses)) { |
1772 | 1772 | if ($condSql) { |
1773 | - $condSql = '(' . $condSql . ') AND '; |
|
1773 | + $condSql = '('.$condSql.') AND '; |
|
1774 | 1774 | } |
1775 | 1775 | |
1776 | 1776 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1778,11 +1778,11 @@ discard block |
||
1778 | 1778 | } |
1779 | 1779 | |
1780 | 1780 | if ($condSql) { |
1781 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1781 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1782 | 1782 | } |
1783 | 1783 | |
1784 | 1784 | if ($discrSql) { |
1785 | - return ' WHERE ' . $discrSql; |
|
1785 | + return ' WHERE '.$discrSql; |
|
1786 | 1786 | } |
1787 | 1787 | |
1788 | 1788 | return ''; |
@@ -1825,7 +1825,7 @@ discard block |
||
1825 | 1825 | // if only one ConditionalPrimary is defined |
1826 | 1826 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1827 | 1827 | ? $this->walkConditionalPrimary($factor) |
1828 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1828 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1829 | 1829 | } |
1830 | 1830 | |
1831 | 1831 | /** |
@@ -1840,7 +1840,7 @@ discard block |
||
1840 | 1840 | if ($primary->isConditionalExpression()) { |
1841 | 1841 | $condExpr = $primary->conditionalExpression; |
1842 | 1842 | |
1843 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1843 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1844 | 1844 | } |
1845 | 1845 | } |
1846 | 1846 | |
@@ -1851,7 +1851,7 @@ discard block |
||
1851 | 1851 | { |
1852 | 1852 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1853 | 1853 | |
1854 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1854 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1855 | 1855 | |
1856 | 1856 | return $sql; |
1857 | 1857 | } |
@@ -1895,7 +1895,7 @@ discard block |
||
1895 | 1895 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1896 | 1896 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1897 | 1897 | |
1898 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
1898 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
1899 | 1899 | |
1900 | 1900 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
1901 | 1901 | $sqlParts = []; |
@@ -1903,7 +1903,7 @@ discard block |
||
1903 | 1903 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
1904 | 1904 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
1905 | 1905 | |
1906 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
1906 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
1907 | 1907 | } |
1908 | 1908 | |
1909 | 1909 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1911,7 +1911,7 @@ discard block |
||
1911 | 1911 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1912 | 1912 | } |
1913 | 1913 | |
1914 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
1914 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
1915 | 1915 | } |
1916 | 1916 | |
1917 | 1917 | $sql .= implode(' AND ', $sqlParts); |
@@ -1927,8 +1927,8 @@ discard block |
||
1927 | 1927 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1928 | 1928 | |
1929 | 1929 | // join to target table |
1930 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
1931 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
1930 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
1931 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
1932 | 1932 | |
1933 | 1933 | // join conditions |
1934 | 1934 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1937,7 +1937,7 @@ discard block |
||
1937 | 1937 | foreach ($joinColumns as $joinColumn) { |
1938 | 1938 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
1939 | 1939 | |
1940 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
1940 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
1941 | 1941 | } |
1942 | 1942 | |
1943 | 1943 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -1949,7 +1949,7 @@ discard block |
||
1949 | 1949 | foreach ($joinColumns as $joinColumn) { |
1950 | 1950 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
1951 | 1951 | |
1952 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
1952 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
1953 | 1953 | } |
1954 | 1954 | |
1955 | 1955 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1957,13 +1957,13 @@ discard block |
||
1957 | 1957 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1958 | 1958 | } |
1959 | 1959 | |
1960 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
1960 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
1961 | 1961 | } |
1962 | 1962 | |
1963 | 1963 | $sql .= implode(' AND ', $sqlParts); |
1964 | 1964 | } |
1965 | 1965 | |
1966 | - return $sql . ')'; |
|
1966 | + return $sql.')'; |
|
1967 | 1967 | } |
1968 | 1968 | |
1969 | 1969 | /** |
@@ -1974,7 +1974,7 @@ discard block |
||
1974 | 1974 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
1975 | 1975 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
1976 | 1976 | |
1977 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
1977 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
1978 | 1978 | } |
1979 | 1979 | |
1980 | 1980 | /** |
@@ -1983,19 +1983,19 @@ discard block |
||
1983 | 1983 | public function walkNullComparisonExpression($nullCompExpr) |
1984 | 1984 | { |
1985 | 1985 | $expression = $nullCompExpr->expression; |
1986 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
1986 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
1987 | 1987 | |
1988 | 1988 | // Handle ResultVariable |
1989 | 1989 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
1990 | - return $this->walkResultVariable($expression) . $comparison; |
|
1990 | + return $this->walkResultVariable($expression).$comparison; |
|
1991 | 1991 | } |
1992 | 1992 | |
1993 | 1993 | // Handle InputParameter mapping inclusion to ParserResult |
1994 | 1994 | if ($expression instanceof AST\InputParameter) { |
1995 | - return $this->walkInputParameter($expression) . $comparison; |
|
1995 | + return $this->walkInputParameter($expression).$comparison; |
|
1996 | 1996 | } |
1997 | 1997 | |
1998 | - return $expression->dispatch($this) . $comparison; |
|
1998 | + return $expression->dispatch($this).$comparison; |
|
1999 | 1999 | } |
2000 | 2000 | |
2001 | 2001 | /** |
@@ -2003,7 +2003,7 @@ discard block |
||
2003 | 2003 | */ |
2004 | 2004 | public function walkInExpression($inExpr) |
2005 | 2005 | { |
2006 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2006 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2007 | 2007 | |
2008 | 2008 | $sql .= ($inExpr->subselect) |
2009 | 2009 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2029,10 +2029,10 @@ discard block |
||
2029 | 2029 | } |
2030 | 2030 | |
2031 | 2031 | if ($this->useSqlTableAliases) { |
2032 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
2032 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
2033 | 2033 | } |
2034 | 2034 | |
2035 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2035 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2036 | 2036 | |
2037 | 2037 | $sqlParameterList = []; |
2038 | 2038 | |
@@ -2062,7 +2062,7 @@ discard block |
||
2062 | 2062 | $sqlParameterList[] = $this->conn->quote($discriminatorValue); |
2063 | 2063 | } |
2064 | 2064 | |
2065 | - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; |
|
2065 | + $sql .= '('.implode(', ', $sqlParameterList).')'; |
|
2066 | 2066 | |
2067 | 2067 | return $sql; |
2068 | 2068 | } |
@@ -2108,8 +2108,8 @@ discard block |
||
2108 | 2108 | $sql .= ' NOT'; |
2109 | 2109 | } |
2110 | 2110 | |
2111 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2112 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2111 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2112 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2113 | 2113 | |
2114 | 2114 | return $sql; |
2115 | 2115 | } |
@@ -2124,7 +2124,7 @@ discard block |
||
2124 | 2124 | ? $this->walkResultVariable($stringExpr) |
2125 | 2125 | : $stringExpr->dispatch($this); |
2126 | 2126 | |
2127 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2127 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2128 | 2128 | |
2129 | 2129 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2130 | 2130 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2137,7 +2137,7 @@ discard block |
||
2137 | 2137 | } |
2138 | 2138 | |
2139 | 2139 | if ($likeExpr->escapeChar) { |
2140 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2140 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2141 | 2141 | } |
2142 | 2142 | |
2143 | 2143 | return $sql; |
@@ -2164,7 +2164,7 @@ discard block |
||
2164 | 2164 | ? $leftExpr->dispatch($this) |
2165 | 2165 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2166 | 2166 | |
2167 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2167 | + $sql .= ' '.$compExpr->operator.' '; |
|
2168 | 2168 | |
2169 | 2169 | $sql .= ($rightExpr instanceof AST\Node) |
2170 | 2170 | ? $rightExpr->dispatch($this) |
@@ -2196,7 +2196,7 @@ discard block |
||
2196 | 2196 | { |
2197 | 2197 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2198 | 2198 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2199 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2199 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2200 | 2200 | } |
2201 | 2201 | |
2202 | 2202 | /** |
@@ -2250,7 +2250,7 @@ discard block |
||
2250 | 2250 | |
2251 | 2251 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2252 | 2252 | |
2253 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2253 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2254 | 2254 | } |
2255 | 2255 | |
2256 | 2256 | /** |
@@ -2263,7 +2263,7 @@ discard block |
||
2263 | 2263 | public function walkArithmeticPrimary($primary) |
2264 | 2264 | { |
2265 | 2265 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2266 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2266 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2267 | 2267 | } |
2268 | 2268 | |
2269 | 2269 | if ($primary instanceof AST\Node) { |
@@ -33,7 +33,7 @@ |
||
33 | 33 | /** |
34 | 34 | * @var string |
35 | 35 | */ |
36 | - protected $preSeparator = ''; |
|
36 | + protected $preSeparator = ''; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @var string |
@@ -102,7 +102,7 @@ |
||
102 | 102 | [$pathExpression] |
103 | 103 | ); |
104 | 104 | $expression = new InExpression($arithmeticExpression); |
105 | - $expression->literals[] = new InputParameter(":" . self::PAGINATOR_ID_ALIAS); |
|
105 | + $expression->literals[] = new InputParameter(":".self::PAGINATOR_ID_ALIAS); |
|
106 | 106 | |
107 | 107 | } else { |
108 | 108 | $expression = new NullComparisonExpression($pathExpression); |