Passed
Pull Request — master (#7782)
by Gabriel
06:00
created
tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
             $query->free();
67 67
         } catch (Exception $e) {
68
-            $this->fail($e->getMessage() . "\n" . $e->getTraceAsString());
68
+            $this->fail($e->getMessage()."\n".$e->getTraceAsString());
69 69
         }
70 70
 
71 71
         self::assertEquals($sqlToBeConfirmed, $sqlGenerated);
@@ -1625,7 +1625,7 @@  discard block
 block discarded – undo
1625 1625
     public function testAliasDoesNotExceedPlatformDefinedLength() : void
1626 1626
     {
1627 1627
         $this->assertSqlGeneration(
1628
-            'SELECT m FROM ' . __NAMESPACE__ . '\\DDC1384Model m',
1628
+            'SELECT m FROM '.__NAMESPACE__.'\\DDC1384Model m',
1629 1629
             'SELECT t0."aVeryLongIdentifierThatShouldBeShortenedByTheSQLWalker_fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" AS c0 FROM "DDC1384Model" t0'
1630 1630
         );
1631 1631
     }
@@ -1658,12 +1658,12 @@  discard block
 block discarded – undo
1658 1658
     public function testSelectWithArithmeticExpressionBeforeField() : void
1659 1659
     {
1660 1660
         $this->assertSqlGeneration(
1661
-            'SELECT - e.value AS value, e.id FROM ' . __NAMESPACE__ . '\DDC1474Entity e',
1661
+            'SELECT - e.value AS value, e.id FROM '.__NAMESPACE__.'\DDC1474Entity e',
1662 1662
             'SELECT -t0."value" AS c0, t0."id" AS c1 FROM "DDC1474Entity" t0'
1663 1663
         );
1664 1664
 
1665 1665
         $this->assertSqlGeneration(
1666
-            'SELECT e.id, + e.value AS value FROM ' . __NAMESPACE__ . '\DDC1474Entity e',
1666
+            'SELECT e.id, + e.value AS value FROM '.__NAMESPACE__.'\DDC1474Entity e',
1667 1667
             'SELECT t0."id" AS c0, +t0."value" AS c1 FROM "DDC1474Entity" t0'
1668 1668
         );
1669 1669
     }
@@ -2340,8 +2340,8 @@  discard block
 block discarded – undo
2340 2340
     public function testHavingRegressionUsingVariableWithMathOperatorsExpression($operator) : void
2341 2341
     {
2342 2342
         $this->assertSqlGeneration(
2343
-            'SELECT COUNT(u.name) AS countName FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING 1 ' . $operator . ' countName > 0',
2344
-            'SELECT COUNT(t0."name") AS c0 FROM "cms_users" t0 HAVING 1 ' . $operator . ' c0 > 0'
2343
+            'SELECT COUNT(u.name) AS countName FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING 1 '.$operator.' countName > 0',
2344
+            'SELECT COUNT(t0."name") AS c0 FROM "cms_users" t0 HAVING 1 '.$operator.' c0 > 0'
2345 2345
         );
2346 2346
     }
2347 2347
 
@@ -2360,7 +2360,7 @@  discard block
 block discarded – undo
2360 2360
 
2361 2361
     public function getSql(SqlWalker $sqlWalker)
2362 2362
     {
2363
-        return 'ABS(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')';
2363
+        return 'ABS('.$sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression).')';
2364 2364
     }
2365 2365
 
2366 2366
     public function parse(Parser $parser)
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         try {
46 46
             $sqlGenerated = $this->generateSql($dqlToBeTested, $treeWalkers, $outputWalker);
47 47
         } catch (Exception $e) {
48
-            $this->fail($e->getMessage() . ' at "' . $e->getFile() . '" on line ' . $e->getLine());
48
+            $this->fail($e->getMessage().' at "'.$e->getFile().'" on line '.$e->getLine());
49 49
         }
50 50
 
51 51
         self::assertEquals($sqlToBeConfirmed, $sqlGenerated);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $condExpr = $whereClause->conditionalExpression;
146 146
 
147 147
             // Since Phase 1 AST optimizations were included, we need to re-add the ConditionalExpression
148
-            if (! ($condExpr instanceof Query\AST\ConditionalExpression)) {
148
+            if ( ! ($condExpr instanceof Query\AST\ConditionalExpression)) {
149 149
                 $condExpr = new Query\AST\ConditionalExpression([$condExpr]);
150 150
 
151 151
                 $whereClause->conditionalExpression = $condExpr;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 $singleTerm = $selectStatement->whereClause->conditionalExpression->conditionalTerms[0];
169 169
 
170 170
                 // Since Phase 1 AST optimizations were included, we need to re-add the ConditionalExpression
171
-                if (! ($singleTerm instanceof Query\AST\ConditionalTerm)) {
171
+                if ( ! ($singleTerm instanceof Query\AST\ConditionalTerm)) {
172 172
                     $singleTerm = new Query\AST\ConditionalTerm([$singleTerm]);
173 173
 
174 174
                     $selectStatement->whereClause->conditionalExpression->conditionalTerms[0] = $singleTerm;
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
     {
207 207
         $rangeVariableDecl       = $identificationVariableDecl->rangeVariableDeclaration;
208 208
         $joinAssocPathExpression = new Query\AST\JoinAssociationPathExpression($rangeVariableDecl->aliasIdentificationVariable, 'address');
209
-        $joinAssocDeclaration    = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable . 'a', null);
209
+        $joinAssocDeclaration    = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable.'a', null);
210 210
         $join                    = new Query\AST\Join(Query\AST\Join::JOIN_TYPE_LEFT, $joinAssocDeclaration);
211
-        $selectExpression        = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable . 'a', null, false);
211
+        $selectExpression        = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable.'a', null, false);
212 212
 
213 213
         $identificationVariableDecl->joins[]                = $join;
214 214
         $selectStatement->selectClause->selectExpressions[] = $selectExpression;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $addressMetadata = $entityManager->getClassMetadata(CmsAddress::class);
219 219
 
220 220
         $this->setQueryComponent(
221
-            $rangeVariableDecl->aliasIdentificationVariable . 'a',
221
+            $rangeVariableDecl->aliasIdentificationVariable.'a',
222 222
             [
223 223
                 'metadata'     => $addressMetadata,
224 224
                 'parent'       => $rangeVariableDecl->aliasIdentificationVariable,
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Query/ParameterTypeInfererTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,16 +19,16 @@
 block discarded – undo
19 19
     public function providerParameterTypeInferer()
20 20
     {
21 21
         $data = [
22
-            [1,                 Type::INTEGER],
23
-            ['bar',             ParameterType::STRING],
24
-            ['1',               ParameterType::STRING],
25
-            [new DateTime(),     Type::DATETIME],
22
+            [1, Type::INTEGER],
23
+            ['bar', ParameterType::STRING],
24
+            ['1', ParameterType::STRING],
25
+            [new DateTime(), Type::DATETIME],
26 26
             [new DateInterval('P1D'), Type::DATEINTERVAL],
27
-            [[2],          Connection::PARAM_INT_ARRAY],
28
-            [['foo'],      Connection::PARAM_STR_ARRAY],
29
-            [['1','2'],    Connection::PARAM_STR_ARRAY],
30
-            [[],           Connection::PARAM_STR_ARRAY],
31
-            [true,              Type::BOOLEAN],
27
+            [[2], Connection::PARAM_INT_ARRAY],
28
+            [['foo'], Connection::PARAM_STR_ARRAY],
29
+            [['1', '2'], Connection::PARAM_STR_ARRAY],
30
+            [[], Connection::PARAM_STR_ARRAY],
31
+            [true, Type::BOOLEAN],
32 32
         ];
33 33
 
34 34
         if (PHP_VERSION_ID >= 50500) {
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Cache/FileLockRegionTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
     protected function createRegion()
61 61
     {
62
-        $this->directory = sys_get_temp_dir() . '/doctrine_lock_' . uniqid();
62
+        $this->directory = sys_get_temp_dir().'/doctrine_lock_'.uniqid();
63 63
 
64 64
         $region = new DefaultRegion('concurren_region_test', $this->cache);
65 65
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         $reflectionDirectory->setAccessible(true);
263 263
         $reflectionDirectory->setValue($region, str_repeat('a', 10000));
264 264
 
265
-        set_error_handler(static function () {
265
+        set_error_handler(static function() {
266 266
         }, E_WARNING);
267 267
         self::assertTrue($region->evictAll());
268 268
         restore_error_handler();
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     {
276 276
         $path = $path ?: $this->directory;
277 277
 
278
-        if (! is_dir($path)) {
278
+        if ( ! is_dir($path)) {
279 279
             return;
280 280
         }
281 281
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/PersistentCollectionTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             ->expects(self::once())
174 174
             ->method('loadCollection')
175 175
             ->with($this->collection)
176
-            ->willReturnCallback(static function (PersistentCollection $persistentCollection) use ($persistedElement) : void {
176
+            ->willReturnCallback(static function(PersistentCollection $persistentCollection) use ($persistedElement) : void {
177 177
                 $persistentCollection->unwrap()->add($persistedElement);
178 178
             });
179 179
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             ->expects(self::once())
211 211
             ->method('loadCollection')
212 212
             ->with($this->collection)
213
-            ->willReturnCallback(static function (PersistentCollection $persistentCollection) use (
213
+            ->willReturnCallback(static function(PersistentCollection $persistentCollection) use (
214 214
                 $persistedElement,
215 215
                 $newElementThatIsAlsoPersisted
216 216
             ) : void {
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
             ->expects(self::once())
253 253
             ->method('loadCollection')
254 254
             ->with($this->collection)
255
-            ->willReturnCallback(static function (PersistentCollection $persistentCollection) use (
255
+            ->willReturnCallback(static function(PersistentCollection $persistentCollection) use (
256 256
                 $persistedElement,
257 257
                 $newElementThatIsAlsoPersisted
258 258
             ) : void {
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Models/CMS/CmsComment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,6 +35,6 @@
 block discarded – undo
35 35
 
36 36
     public function __toString()
37 37
     {
38
-        return self::class . '[id=' . $this->id . ']';
38
+        return self::class.'[id='.$this->id.']';
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/TestInit.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,20 +15,20 @@
 block discarded – undo
15 15
 error_reporting(E_ALL | E_STRICT);
16 16
 date_default_timezone_set('UTC');
17 17
 
18
-if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
18
+if (file_exists(__DIR__.'/../../../vendor/autoload.php')) {
19 19
     // dependencies were installed via composer - this is the main project
20
-    require __DIR__ . '/../../../vendor/autoload.php';
21
-} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
20
+    require __DIR__.'/../../../vendor/autoload.php';
21
+} elseif (file_exists(__DIR__.'/../../../../../autoload.php')) {
22 22
     // installed as a dependency in `vendor`
23
-    require __DIR__ . '/../../../../../autoload.php';
23
+    require __DIR__.'/../../../../../autoload.php';
24 24
 } else {
25 25
     throw new Exception('Can\'t find autoload.php. Did you install dependencies via composer?');
26 26
 }
27 27
 
28
-if (! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) {
29
-    throw new Exception('Could not create ' . __DIR__ . '/Proxies Folder.');
28
+if ( ! file_exists(__DIR__.'/Proxies') && ! mkdir(__DIR__.'/Proxies')) {
29
+    throw new Exception('Could not create '.__DIR__.'/Proxies Folder.');
30 30
 }
31 31
 
32
-if (! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) {
33
-    throw new Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.');
32
+if ( ! file_exists(__DIR__.'/ORM/Proxy/generated') && ! mkdir(__DIR__.'/ORM/Proxy/generated')) {
33
+    throw new Exception('Could not create '.__DIR__.'/ORM/Proxy/generated Folder.');
34 34
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
 
306 306
         // FIXME: Order with composite keys might not be correct
307 307
         $sql = 'SELECT ' . $columnName
308
-             . ' FROM ' . $tableName
309
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
308
+                . ' FROM ' . $tableName
309
+                . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
310 310
 
311 311
         $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id);
312 312
         $versionType = $versionProperty->getType();
@@ -519,8 +519,8 @@  discard block
 block discarded – undo
519 519
         }
520 520
 
521 521
         $sql = 'UPDATE ' . $quotedTableName
522
-             . ' SET ' . implode(', ', $set)
523
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
522
+                . ' SET ' . implode(', ', $set)
523
+                . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
524 524
 
525 525
         $result = $this->conn->executeUpdate($sql, $params, $types);
526 526
 
@@ -1641,9 +1641,9 @@  discard block
 block discarded – undo
1641 1641
         $lock  = $this->getLockTablesSql($lockMode);
1642 1642
         $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1643 1643
         $sql   = 'SELECT 1 '
1644
-             . $lock
1645
-             . $where
1646
-             . $lockSql;
1644
+                . $lock
1645
+                . $where
1646
+                . $lockSql;
1647 1647
 
1648 1648
         [$params, $types] = $this->expandParameters($criteria);
1649 1649
 
@@ -2112,8 +2112,8 @@  discard block
 block discarded – undo
2112 2112
         $alias = $this->getSQLTableAlias($this->class->getTableName());
2113 2113
 
2114 2114
         $sql = 'SELECT 1 '
2115
-             . $this->getLockTablesSql(null)
2116
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
2115
+                . $this->getLockTablesSql(null)
2116
+                . ' WHERE ' . $this->getSelectConditionSQL($criteria);
2117 2117
 
2118 2118
         [$params, $types] = $this->expandParameters($criteria);
2119 2119
 
Please login to merge, or discard this patch.
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -296,16 +296,16 @@  discard block
 block discarded – undo
296 296
         $tableName      = $versionedClass->table->getQuotedQualifiedName($this->platform);
297 297
         $columnName     = $this->platform->quoteIdentifier($versionProperty->getColumnName());
298 298
         $identifier     = array_map(
299
-            function ($columnName) {
299
+            function($columnName) {
300 300
                 return $this->platform->quoteIdentifier($columnName);
301 301
             },
302 302
             array_keys($versionedClass->getIdentifierColumns($this->em))
303 303
         );
304 304
 
305 305
         // FIXME: Order with composite keys might not be correct
306
-        $sql = 'SELECT ' . $columnName
307
-             . ' FROM ' . $tableName
308
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
306
+        $sql = 'SELECT '.$columnName
307
+             . ' FROM '.$tableName
308
+             . ' WHERE '.implode(' = ? AND ', $identifier).' = ?';
309 309
 
310 310
         $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id);
311 311
         $versionType = $versionProperty->getType();
@@ -344,13 +344,13 @@  discard block
 block discarded – undo
344 344
         $tableName  = $this->class->getTableName();
345 345
         $updateData = $this->prepareUpdateData($entity);
346 346
 
347
-        if (! isset($updateData[$tableName])) {
347
+        if ( ! isset($updateData[$tableName])) {
348 348
             return;
349 349
         }
350 350
 
351 351
         $data = $updateData[$tableName];
352 352
 
353
-        if (! $data) {
353
+        if ( ! $data) {
354 354
             return;
355 355
         }
356 356
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 
403 403
             if ($value !== null) {
404 404
                 // @todo guilhermeblanco Make sure we do not have flat association values.
405
-                if (! is_array($value)) {
405
+                if ( ! is_array($value)) {
406 406
                     $value = [$targetClass->identifier[0] => $value];
407 407
                 }
408 408
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
416 416
                 $targetField          = $targetClass->fieldNames[$referencedColumnName];
417 417
 
418
-                if (! $joinColumn->getType()) {
418
+                if ( ! $joinColumn->getType()) {
419 419
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
420 420
                 }
421 421
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
                         $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
482 482
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
483 483
 
484
-                        if (! $joinColumn->getType()) {
484
+                        if ( ! $joinColumn->getType()) {
485 485
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
486 486
                         }
487 487
 
@@ -508,18 +508,18 @@  discard block
 block discarded – undo
508 508
                 case Type::SMALLINT:
509 509
                 case Type::INTEGER:
510 510
                 case Type::BIGINT:
511
-                    $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1';
511
+                    $set[] = $versionColumnName.' = '.$versionColumnName.' + 1';
512 512
                     break;
513 513
 
514 514
                 case Type::DATETIME:
515
-                    $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP';
515
+                    $set[] = $versionColumnName.' = CURRENT_TIMESTAMP';
516 516
                     break;
517 517
             }
518 518
         }
519 519
 
520
-        $sql = 'UPDATE ' . $quotedTableName
521
-             . ' SET ' . implode(', ', $set)
522
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
520
+        $sql = 'UPDATE '.$quotedTableName
521
+             . ' SET '.implode(', ', $set)
522
+             . ' WHERE '.implode(' = ? AND ', $where).' = ?';
523 523
 
524 524
         $result = $this->conn->executeUpdate($sql, $params, $types);
525 525
 
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
     protected function deleteJoinTableRecords($identifier)
537 537
     {
538 538
         foreach ($this->class->getPropertiesIterator() as $association) {
539
-            if (! ($association instanceof ManyToManyAssociationMetadata)) {
539
+            if ( ! ($association instanceof ManyToManyAssociationMetadata)) {
540 540
                 continue;
541 541
             }
542 542
 
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
             $otherKeys         = [];
549 549
             $keys              = [];
550 550
 
551
-            if (! $owningAssociation->isOwningSide()) {
551
+            if ( ! $owningAssociation->isOwningSide()) {
552 552
                 $class             = $this->em->getClassMetadata($association->getTargetEntity());
553 553
                 $owningAssociation = $class->getProperty($association->getMappedBy());
554 554
             }
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
             }
659 659
 
660 660
             // Only owning side of x-1 associations can have a FK column.
661
-            if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) {
661
+            if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) {
662 662
                 continue;
663 663
             }
664 664
 
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
                 /** @var JoinColumnMetadata $joinColumn */
679 679
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
680 680
 
681
-                if (! $joinColumn->getType()) {
681
+                if ( ! $joinColumn->getType()) {
682 682
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
683 683
                 }
684 684
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
         $propertyName = $this->class->fieldNames[$columnName];
706 706
         $property     = $this->class->getProperty($propertyName);
707 707
 
708
-        if (! $property) {
708
+        if ( ! $property) {
709 709
             return null;
710 710
         }
711 711
 
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
             /** @var JoinColumnMetadata $joinColumn */
725 725
             $referencedColumnName = $joinColumn->getReferencedColumnName();
726 726
 
727
-            if (! $joinColumn->getType()) {
727
+            if ( ! $joinColumn->getType()) {
728 728
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
729 729
             }
730 730
 
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
             $sourceKeyColumn = $joinColumn->getReferencedColumnName();
830 830
             $targetKeyColumn = $joinColumn->getColumnName();
831 831
 
832
-            if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) {
832
+            if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) {
833 833
                 throw MappingException::joinColumnMustPointToMappedField(
834 834
                     $sourceClass->getClassName(),
835 835
                     $sourceKeyColumn
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
         $criteria    = [];
1057 1057
         $parameters  = [];
1058 1058
 
1059
-        if (! $association->isOwningSide()) {
1059
+        if ( ! $association->isOwningSide()) {
1060 1060
             $class       = $this->em->getClassMetadata($association->getTargetEntity());
1061 1061
             $owningAssoc = $class->getProperty($association->getMappedBy());
1062 1062
         }
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
                 $value = $value[$targetClass->identifier[0]];
1085 1085
             }
1086 1086
 
1087
-            $criteria[$joinTableName . '.' . $quotedColumnName] = $value;
1087
+            $criteria[$joinTableName.'.'.$quotedColumnName] = $value;
1088 1088
             $parameters[]                                       = [
1089 1089
                 'value' => $value,
1090 1090
                 'field' => $fieldName,
@@ -1134,11 +1134,11 @@  discard block
 block discarded – undo
1134 1134
 
1135 1135
         switch ($lockMode) {
1136 1136
             case LockMode::PESSIMISTIC_READ:
1137
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
1137
+                $lockSql = ' '.$this->platform->getReadLockSQL();
1138 1138
                 break;
1139 1139
 
1140 1140
             case LockMode::PESSIMISTIC_WRITE:
1141
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
1141
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
1142 1142
                 break;
1143 1143
         }
1144 1144
 
@@ -1149,14 +1149,14 @@  discard block
 block discarded – undo
1149 1149
 
1150 1150
         if ($filterSql !== '') {
1151 1151
             $conditionSql = $conditionSql
1152
-                ? $conditionSql . ' AND ' . $filterSql
1152
+                ? $conditionSql.' AND '.$filterSql
1153 1153
                 : $filterSql;
1154 1154
         }
1155 1155
 
1156
-        $select = 'SELECT ' . $columnList;
1157
-        $from   = ' FROM ' . $tableName . ' ' . $tableAlias;
1158
-        $join   = $this->currentPersisterContext->selectJoinSql . $joinSql;
1159
-        $where  = ($conditionSql ? ' WHERE ' . $conditionSql : '');
1156
+        $select = 'SELECT '.$columnList;
1157
+        $from   = ' FROM '.$tableName.' '.$tableAlias;
1158
+        $join   = $this->currentPersisterContext->selectJoinSql.$joinSql;
1159
+        $where  = ($conditionSql ? ' WHERE '.$conditionSql : '');
1160 1160
         $lock   = $this->platform->appendLockHint($from, $lockMode);
1161 1161
         $query  = $select
1162 1162
             . $lock
@@ -1164,7 +1164,7 @@  discard block
 block discarded – undo
1164 1164
             . $where
1165 1165
             . $orderBySql;
1166 1166
 
1167
-        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql;
1167
+        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql;
1168 1168
     }
1169 1169
 
1170 1170
     /**
@@ -1183,13 +1183,13 @@  discard block
 block discarded – undo
1183 1183
 
1184 1184
         if ($filterSql !== '') {
1185 1185
             $conditionSql = $conditionSql
1186
-                ? $conditionSql . ' AND ' . $filterSql
1186
+                ? $conditionSql.' AND '.$filterSql
1187 1187
                 : $filterSql;
1188 1188
         }
1189 1189
 
1190 1190
         return 'SELECT COUNT(*) '
1191
-            . 'FROM ' . $tableName . ' ' . $tableAlias
1192
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
1191
+            . 'FROM '.$tableName.' '.$tableAlias
1192
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
1193 1193
     }
1194 1194
 
1195 1195
     /**
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
      */
1205 1205
     final protected function getOrderBySQL(array $orderBy, $baseTableAlias)
1206 1206
     {
1207
-        if (! $orderBy) {
1207
+        if ( ! $orderBy) {
1208 1208
             return '';
1209 1209
         }
1210 1210
 
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
         foreach ($orderBy as $fieldName => $orientation) {
1214 1214
             $orientation = strtoupper(trim($orientation));
1215 1215
 
1216
-            if (! in_array($orientation, ['ASC', 'DESC'], true)) {
1216
+            if ( ! in_array($orientation, ['ASC', 'DESC'], true)) {
1217 1217
                 throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName);
1218 1218
             }
1219 1219
 
@@ -1223,11 +1223,11 @@  discard block
 block discarded – undo
1223 1223
                 $tableAlias = $this->getSQLTableAlias($property->getTableName());
1224 1224
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
1225 1225
 
1226
-                $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation;
1226
+                $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation;
1227 1227
 
1228 1228
                 continue;
1229 1229
             } elseif ($property instanceof AssociationMetadata) {
1230
-                if (! $property->isOwningSide()) {
1230
+                if ( ! $property->isOwningSide()) {
1231 1231
                     throw InvalidFindByCall::fromInverseSideUsage(
1232 1232
                         $this->class->getClassName(),
1233 1233
                         $fieldName
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
                     /** @var JoinColumnMetadata $joinColumn */
1244 1244
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1245 1245
 
1246
-                    $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation;
1246
+                    $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation;
1247 1247
                 }
1248 1248
 
1249 1249
                 continue;
@@ -1252,7 +1252,7 @@  discard block
 block discarded – undo
1252 1252
             throw UnrecognizedField::byName($fieldName);
1253 1253
         }
1254 1254
 
1255
-        return ' ORDER BY ' . implode(', ', $orderByList);
1255
+        return ' ORDER BY '.implode(', ', $orderByList);
1256 1256
     }
1257 1257
 
1258 1258
     /**
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
                     $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide();
1295 1295
                     $isAssocFromOneEager     = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER;
1296 1296
 
1297
-                    if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) {
1297
+                    if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) {
1298 1298
                         break;
1299 1299
                     }
1300 1300
 
@@ -1309,7 +1309,7 @@  discard block
 block discarded – undo
1309 1309
                         break; // now this is why you shouldn't use inheritance
1310 1310
                     }
1311 1311
 
1312
-                    $assocAlias = 'e' . ($eagerAliasCounter++);
1312
+                    $assocAlias = 'e'.($eagerAliasCounter++);
1313 1313
 
1314 1314
                     $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName);
1315 1315
 
@@ -1337,14 +1337,14 @@  discard block
 block discarded – undo
1337 1337
                         $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy());
1338 1338
                     }
1339 1339
 
1340
-                    if (! $property->isOwningSide()) {
1340
+                    if ( ! $property->isOwningSide()) {
1341 1341
                         $owningAssociation = $eagerEntity->getProperty($property->getMappedBy());
1342 1342
                     }
1343 1343
 
1344 1344
                     $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias);
1345 1345
                     $joinTableName  = $eagerEntity->table->getQuotedQualifiedName($this->platform);
1346 1346
 
1347
-                    $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property);
1347
+                    $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property);
1348 1348
 
1349 1349
                     $sourceClass      = $this->em->getClassMetadata($owningAssociation->getSourceEntity());
1350 1350
                     $targetClass      = $this->em->getClassMetadata($owningAssociation->getTargetEntity());
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
                         $joinCondition[] = $filterSql;
1369 1369
                     }
1370 1370
 
1371
-                    $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON ';
1371
+                    $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON ';
1372 1372
                     $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition);
1373 1373
 
1374 1374
                     break;
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
      */
1391 1391
     protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r')
1392 1392
     {
1393
-        if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) {
1393
+        if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) {
1394 1394
             return '';
1395 1395
         }
1396 1396
 
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
             $referencedColumnName = $joinColumn->getReferencedColumnName();
1406 1406
             $resultColumnName     = $this->getSQLColumnAlias();
1407 1407
 
1408
-            if (! $joinColumn->getType()) {
1408
+            if ( ! $joinColumn->getType()) {
1409 1409
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
1410 1410
             }
1411 1411
 
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
         $owningAssociation = $association;
1436 1436
         $sourceTableAlias  = $this->getSQLTableAlias($this->class->getTableName());
1437 1437
 
1438
-        if (! $association->isOwningSide()) {
1438
+        if ( ! $association->isOwningSide()) {
1439 1439
             $targetEntity      = $this->em->getClassMetadata($association->getTargetEntity());
1440 1440
             $owningAssociation = $targetEntity->getProperty($association->getMappedBy());
1441 1441
         }
@@ -1456,7 +1456,7 @@  discard block
 block discarded – undo
1456 1456
             );
1457 1457
         }
1458 1458
 
1459
-        return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions);
1459
+        return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions);
1460 1460
     }
1461 1461
 
1462 1462
     /**
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
                             $columnName           = $joinColumn->getColumnName();
1551 1551
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
1552 1552
 
1553
-                            if (! $joinColumn->getType()) {
1553
+                            if ( ! $joinColumn->getType()) {
1554 1554
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
1555 1555
                             }
1556 1556
 
@@ -1589,7 +1589,7 @@  discard block
 block discarded – undo
1589 1589
 
1590 1590
         $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName());
1591 1591
 
1592
-        return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias;
1592
+        return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias;
1593 1593
     }
1594 1594
 
1595 1595
     /**
@@ -1603,14 +1603,14 @@  discard block
 block discarded – undo
1603 1603
     protected function getSQLTableAlias($tableName, $assocName = '')
1604 1604
     {
1605 1605
         if ($tableName) {
1606
-            $tableName .= '#' . $assocName;
1606
+            $tableName .= '#'.$assocName;
1607 1607
         }
1608 1608
 
1609 1609
         if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) {
1610 1610
             return $this->currentPersisterContext->sqlTableAliases[$tableName];
1611 1611
         }
1612 1612
 
1613
-        $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++;
1613
+        $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++;
1614 1614
 
1615 1615
         $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias;
1616 1616
 
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
         }
1637 1637
 
1638 1638
         $lock  = $this->getLockTablesSql($lockMode);
1639
-        $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1639
+        $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' ';
1640 1640
         $sql   = 'SELECT 1 '
1641 1641
              . $lock
1642 1642
              . $where
@@ -1659,7 +1659,7 @@  discard block
 block discarded – undo
1659 1659
         $tableName = $this->class->table->getQuotedQualifiedName($this->platform);
1660 1660
 
1661 1661
         return $this->platform->appendLockHint(
1662
-            'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()),
1662
+            'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()),
1663 1663
             $lockMode
1664 1664
         );
1665 1665
     }
@@ -1709,19 +1709,19 @@  discard block
 block discarded – undo
1709 1709
 
1710 1710
             if ($comparison !== null) {
1711 1711
                 // special case null value handling
1712
-                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) {
1713
-                    $selectedColumns[] = $column . ' IS NULL';
1712
+                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) {
1713
+                    $selectedColumns[] = $column.' IS NULL';
1714 1714
 
1715 1715
                     continue;
1716 1716
                 }
1717 1717
 
1718 1718
                 if ($comparison === Comparison::NEQ && $value === null) {
1719
-                    $selectedColumns[] = $column . ' IS NOT NULL';
1719
+                    $selectedColumns[] = $column.' IS NOT NULL';
1720 1720
 
1721 1721
                     continue;
1722 1722
                 }
1723 1723
 
1724
-                $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder);
1724
+                $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder);
1725 1725
 
1726 1726
                 continue;
1727 1727
             }
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
             $tableAlias = $this->getSQLTableAlias($property->getTableName());
1770 1770
             $columnName = $this->platform->quoteIdentifier($property->getColumnName());
1771 1771
 
1772
-            return [$tableAlias . '.' . $columnName];
1772
+            return [$tableAlias.'.'.$columnName];
1773 1773
         }
1774 1774
 
1775 1775
         if ($property instanceof AssociationMetadata) {
@@ -1778,7 +1778,7 @@  discard block
 block discarded – undo
1778 1778
 
1779 1779
             // Many-To-Many requires join table check for joinColumn
1780 1780
             if ($owningAssociation instanceof ManyToManyAssociationMetadata) {
1781
-                if (! $owningAssociation->isOwningSide()) {
1781
+                if ( ! $owningAssociation->isOwningSide()) {
1782 1782
                     $owningAssociation = $association;
1783 1783
                 }
1784 1784
 
@@ -1791,10 +1791,10 @@  discard block
 block discarded – undo
1791 1791
                 foreach ($joinColumns as $joinColumn) {
1792 1792
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1793 1793
 
1794
-                    $columns[] = $joinTableName . '.' . $quotedColumnName;
1794
+                    $columns[] = $joinTableName.'.'.$quotedColumnName;
1795 1795
                 }
1796 1796
             } else {
1797
-                if (! $owningAssociation->isOwningSide()) {
1797
+                if ( ! $owningAssociation->isOwningSide()) {
1798 1798
                     throw InvalidFindByCall::fromInverseSideUsage(
1799 1799
                         $this->class->getClassName(),
1800 1800
                         $field
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
                 foreach ($owningAssociation->getJoinColumns() as $joinColumn) {
1810 1810
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1811 1811
 
1812
-                    $columns[] = $tableAlias . '.' . $quotedColumnName;
1812
+                    $columns[] = $tableAlias.'.'.$quotedColumnName;
1813 1813
                 }
1814 1814
             }
1815 1815
 
@@ -1917,7 +1917,7 @@  discard block
 block discarded – undo
1917 1917
                 $value = $value[$targetClass->identifier[0]];
1918 1918
             }
1919 1919
 
1920
-            $criteria[$tableAlias . '.' . $quotedColumnName] = $value;
1920
+            $criteria[$tableAlias.'.'.$quotedColumnName] = $value;
1921 1921
             $parameters[]                                    = [
1922 1922
                 'value' => $value,
1923 1923
                 'field' => $fieldName,
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
             case $property instanceof AssociationMetadata:
2003 2003
                 $class = $this->em->getClassMetadata($property->getTargetEntity());
2004 2004
 
2005
-                if (! $property->isOwningSide()) {
2005
+                if ( ! $property->isOwningSide()) {
2006 2006
                     $property = $class->getProperty($property->getMappedBy());
2007 2007
                     $class    = $this->em->getClassMetadata($property->getTargetEntity());
2008 2008
                 }
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
                     /** @var JoinColumnMetadata $joinColumn */
2016 2016
                     $referencedColumnName = $joinColumn->getReferencedColumnName();
2017 2017
 
2018
-                    if (! $joinColumn->getType()) {
2018
+                    if ( ! $joinColumn->getType()) {
2019 2019
                         $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
2020 2020
                     }
2021 2021
 
@@ -2030,7 +2030,7 @@  discard block
 block discarded – undo
2030 2030
         }
2031 2031
 
2032 2032
         if (is_array($value)) {
2033
-            return array_map(static function ($type) {
2033
+            return array_map(static function($type) {
2034 2034
                 return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET;
2035 2035
             }, $types);
2036 2036
         }
@@ -2087,7 +2087,7 @@  discard block
 block discarded – undo
2087 2087
      */
2088 2088
     private function getIndividualValue($value)
2089 2089
     {
2090
-        if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
2090
+        if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
2091 2091
             return $value;
2092 2092
         }
2093 2093
 
@@ -2101,7 +2101,7 @@  discard block
 block discarded – undo
2101 2101
     {
2102 2102
         $criteria = $this->getIdentifier($entity);
2103 2103
 
2104
-        if (! $criteria) {
2104
+        if ( ! $criteria) {
2105 2105
             return false;
2106 2106
         }
2107 2107
 
@@ -2109,12 +2109,12 @@  discard block
 block discarded – undo
2109 2109
 
2110 2110
         $sql = 'SELECT 1 '
2111 2111
              . $this->getLockTablesSql(null)
2112
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
2112
+             . ' WHERE '.$this->getSelectConditionSQL($criteria);
2113 2113
 
2114 2114
         [$params, $types] = $this->expandParameters($criteria);
2115 2115
 
2116 2116
         if ($extraConditions !== null) {
2117
-            $sql                             .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions);
2117
+            $sql                             .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions);
2118 2118
             [$criteriaParams, $criteriaTypes] = $this->expandCriteriaParameters($extraConditions);
2119 2119
 
2120 2120
             $params = array_merge($params, $criteriaParams);
@@ -2124,7 +2124,7 @@  discard block
 block discarded – undo
2124 2124
         $filterSql = $this->generateFilterConditionSQL($this->class, $alias);
2125 2125
 
2126 2126
         if ($filterSql) {
2127
-            $sql .= ' AND ' . $filterSql;
2127
+            $sql .= ' AND '.$filterSql;
2128 2128
         }
2129 2129
 
2130 2130
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
@@ -2137,13 +2137,13 @@  discard block
 block discarded – undo
2137 2137
      */
2138 2138
     protected function getJoinSQLForAssociation(AssociationMetadata $association)
2139 2139
     {
2140
-        if (! $association->isOwningSide()) {
2140
+        if ( ! $association->isOwningSide()) {
2141 2141
             return 'LEFT JOIN';
2142 2142
         }
2143 2143
 
2144 2144
         // if one of the join columns is nullable, return left join
2145 2145
         foreach ($association->getJoinColumns() as $joinColumn) {
2146
-            if (! $joinColumn->isNullable()) {
2146
+            if ( ! $joinColumn->isNullable()) {
2147 2147
                 continue;
2148 2148
             }
2149 2149
 
@@ -2160,7 +2160,7 @@  discard block
 block discarded – undo
2160 2160
      */
2161 2161
     public function getSQLColumnAlias()
2162 2162
     {
2163
-        return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++);
2163
+        return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++);
2164 2164
     }
2165 2165
 
2166 2166
     /**
@@ -2179,13 +2179,13 @@  discard block
 block discarded – undo
2179 2179
             $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias);
2180 2180
 
2181 2181
             if ($filterExpr !== '') {
2182
-                $filterClauses[] = '(' . $filterExpr . ')';
2182
+                $filterClauses[] = '('.$filterExpr.')';
2183 2183
             }
2184 2184
         }
2185 2185
 
2186 2186
         $sql = implode(' AND ', $filterClauses);
2187 2187
 
2188
-        return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL"
2188
+        return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL"
2189 2189
     }
2190 2190
 
2191 2191
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
                 // It's a joined result
86 86
 
87 87
                 $parent = $this->rsm->parentAliasMap[$dqlAlias];
88
-                $path   = $parent . '.' . $dqlAlias;
88
+                $path   = $parent.'.'.$dqlAlias;
89 89
 
90 90
                 // missing parent data, skipping as RIGHT JOIN hydration is not supported.
91
-                if (! isset($nonemptyComponents[$parent])) {
91
+                if ( ! isset($nonemptyComponents[$parent])) {
92 92
                     continue;
93 93
                 }
94 94
 
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
                 if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) {
98 98
                     $first = reset($this->resultPointers);
99 99
                     // TODO: Exception if $key === null ?
100
-                    $baseElement =& $this->resultPointers[$parent][key($first)];
100
+                    $baseElement = & $this->resultPointers[$parent][key($first)];
101 101
                 } elseif (isset($this->resultPointers[$parent])) {
102
-                    $baseElement =& $this->resultPointers[$parent];
102
+                    $baseElement = & $this->resultPointers[$parent];
103 103
                 } else {
104 104
                     unset($this->resultPointers[$dqlAlias]); // Ticket #1228
105 105
 
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
                 $relation      = $parentClass->getProperty($relationAlias);
112 112
 
113 113
                 // Check the type of the relation (many or single-valued)
114
-                if (! $relation instanceof ToOneAssociationMetadata) {
114
+                if ( ! $relation instanceof ToOneAssociationMetadata) {
115 115
                     $oneToOne = false;
116 116
 
117
-                    if (! isset($baseElement[$relationAlias])) {
117
+                    if ( ! isset($baseElement[$relationAlias])) {
118 118
                         $baseElement[$relationAlias] = [];
119 119
                     }
120 120
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                         $index        = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false;
124 124
                         $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false;
125 125
 
126
-                        if (! $indexExists || ! $indexIsValid) {
126
+                        if ( ! $indexExists || ! $indexIsValid) {
127 127
                             $element = $data;
128 128
 
129 129
                             if (isset($this->rsm->indexByMap[$dqlAlias])) {
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
                 } else {
141 141
                     $oneToOne = true;
142 142
 
143
-                    if (! isset($nonemptyComponents[$dqlAlias]) &&
143
+                    if ( ! isset($nonemptyComponents[$dqlAlias]) &&
144 144
                         ( ! isset($baseElement[$relationAlias]))
145 145
                     ) {
146 146
                         $baseElement[$relationAlias] = null;
147
-                    } elseif (! isset($baseElement[$relationAlias])) {
147
+                    } elseif ( ! isset($baseElement[$relationAlias])) {
148 148
                         $baseElement[$relationAlias] = $data;
149 149
                     }
150 150
                 }
151 151
 
152
-                $coll =& $baseElement[$relationAlias];
152
+                $coll = & $baseElement[$relationAlias];
153 153
 
154 154
                 if (is_array($coll)) {
155 155
                     $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne);
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 $entityKey                    = $this->rsm->entityMappings[$dqlAlias] ?: 0;
162 162
 
163 163
                 // if this row has a NULL value for the root result id then make it a null result.
164
-                if (! isset($nonemptyComponents[$dqlAlias])) {
164
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
165 165
                     $result[] = $this->rsm->isMixed
166 166
                         ? [$entityKey => null]
167 167
                         : null;
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
             }
199 199
         }
200 200
 
201
-        if (! isset($resultKey)) {
201
+        if ( ! isset($resultKey)) {
202 202
             $this->resultCounter++;
203 203
         }
204 204
 
205 205
         // Append scalar values to mixed result sets
206 206
         if (isset($rowData['scalars'])) {
207
-            if (! isset($resultKey)) {
207
+            if ( ! isset($resultKey)) {
208 208
                 // this only ever happens when no object is fetched (scalar result only)
209 209
                 $resultKey = isset($this->rsm->indexByMap['scalars'])
210 210
                     ? $row[$this->rsm->indexByMap['scalars']]
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
         // Append new object to mixed result sets
220 220
         if (isset($rowData['newObjects'])) {
221
-            if (! isset($resultKey)) {
221
+            if ( ! isset($resultKey)) {
222 222
                 $resultKey = $this->resultCounter - 1;
223 223
             }
224 224
 
@@ -259,22 +259,22 @@  discard block
 block discarded – undo
259 259
         }
260 260
 
261 261
         if ($oneToOne) {
262
-            $this->resultPointers[$dqlAlias] =& $coll;
262
+            $this->resultPointers[$dqlAlias] = & $coll;
263 263
 
264 264
             return;
265 265
         }
266 266
 
267 267
         if ($index !== false) {
268
-            $this->resultPointers[$dqlAlias] =& $coll[$index];
268
+            $this->resultPointers[$dqlAlias] = & $coll[$index];
269 269
 
270 270
             return;
271 271
         }
272 272
 
273
-        if (! $coll) {
273
+        if ( ! $coll) {
274 274
             return;
275 275
         }
276 276
 
277 277
         end($coll);
278
-        $this->resultPointers[$dqlAlias] =& $coll[key($coll)];
278
+        $this->resultPointers[$dqlAlias] = & $coll[key($coll)];
279 279
     }
280 280
 }
Please login to merge, or discard this patch.