Completed
Pull Request — master (#6496)
by Artem
14:32
created
tests/Doctrine/Tests/ORM/Functional/Ticket/GH6402Test.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,6 @@
 block discarded – undo
5 5
 use Doctrine\Tests\Models\Quote\Address;
6 6
 use Doctrine\Tests\Models\Quote\City;
7 7
 use Doctrine\Tests\Models\Quote\FullAddress;
8
-use Doctrine\Tests\Models\Quote\Group;
9
-use Doctrine\Tests\Models\Quote\Phone;
10 8
 use Doctrine\Tests\Models\Quote\User;
11 9
 use Doctrine\Tests\OrmFunctionalTestCase;
12 10
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/OrmFunctionalTestCase.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Doctrine\Tests;
4 4
 
5 5
 use Doctrine\Common\Cache\ArrayCache;
6
-use Doctrine\DBAL\Driver\PDOSqlite\Driver as SqliteDriver;
7 6
 use Doctrine\DBAL\Logging\DebugStack;
8 7
 use Doctrine\DBAL\Types\Type;
9 8
 use Doctrine\ORM\Cache\CacheConfiguration;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/AbstractEntityInheritancePersister.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $sql    = $type->convertToPHPValueSQL($sql, $this->platform);
77 77
         }
78 78
 
79
-        return $sql . ' AS ' . $columnAlias;
79
+        return $sql.' AS '.$columnAlias;
80 80
     }
81 81
 
82 82
     /**
@@ -94,6 +94,6 @@  discard block
 block discarded – undo
94 94
 
95 95
         $this->currentPersisterContext->rsm->addMetaResult('r', $columnAlias, $joinColumnName, false, $type);
96 96
 
97
-        return $tableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias;
97
+        return $tableAlias.'.'.$quotedColumnName.' AS '.$columnAlias;
98 98
     }
99 99
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                             $inheritedKeyColumns[] = $columnName;
224 224
                         }
225 225
                     }
226
-                    if (!empty($inheritedKeyColumns)) {
226
+                    if ( ! empty($inheritedKeyColumns)) {
227 227
                         // Add a FK constraint on the ID column
228 228
                         $table->addForeignKeyConstraint(
229 229
                             $this->quoteStrategy->getTableName(
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
             }
331 331
         }
332 332
 
333
-        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas() ) {
333
+        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
334 334
             $schema->visit(new RemoveNamespacedAssets());
335 335
         }
336 336
 
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
             if ( ! $definingClass) {
636 636
                 throw new \Doctrine\ORM\ORMException(
637 637
                     "Column name `".$joinColumn['referencedColumnName']."` referenced for relation from ".
638
-                    $mapping['sourceEntity'] . " towards ". $mapping['targetEntity'] . " does not exist."
638
+                    $mapping['sourceEntity']." towards ".$mapping['targetEntity']." does not exist."
639 639
                 );
640 640
             }
641 641
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
                 $columnOptions = ['notnull' => false, 'columnDefinition' => $columnDef];
668 668
 
669 669
                 if (isset($joinColumn['nullable'])) {
670
-                    $columnOptions['notnull'] = !$joinColumn['nullable'];
670
+                    $columnOptions['notnull'] = ! $joinColumn['nullable'];
671 671
                 }
672 672
 
673 673
                 if (isset($fieldMapping['options'])) {
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
                 }
715 715
             }
716 716
             $blacklistedFks[$compositeName] = true;
717
-        } elseif (!isset($blacklistedFks[$compositeName])) {
717
+        } elseif ( ! isset($blacklistedFks[$compositeName])) {
718 718
             $addedFks[$compositeName] = ['foreignTableName' => $foreignTableName, 'foreignColumns' => $foreignColumns];
719 719
             $theJoinTable->addUnnamedForeignKeyConstraint(
720 720
                 $foreignTableName,
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
                 if ($table->hasPrimaryKey()) {
822 822
                     $columns = $table->getPrimaryKey()->getColumns();
823 823
                     if (count($columns) == 1) {
824
-                        $checkSequence = $table->getName() . "_" . $columns[0] . "_seq";
824
+                        $checkSequence = $table->getName()."_".$columns[0]."_seq";
825 825
                         if ($fullSchema->hasSequence($checkSequence)) {
826 826
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
827 827
                         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             $cacheAnnot = $classAnnotations[Mapping\Cache::class];
150 150
             $cacheMap   = [
151 151
                 'region' => $cacheAnnot->region,
152
-                'usage'  => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage),
152
+                'usage'  => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$cacheAnnot->usage),
153 153
             ];
154 154
 
155 155
             $metadata->enableCache($cacheMap);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             $inheritanceTypeAnnot = $classAnnotations[Mapping\InheritanceType::class];
238 238
 
239 239
             $metadata->setInheritanceType(
240
-                constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceTypeAnnot->value)
240
+                constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceTypeAnnot->value)
241 241
             );
242 242
 
243 243
             if ($metadata->inheritanceType != Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         // Evaluate DoctrineChangeTrackingPolicy annotation
270 270
         if (isset($classAnnotations[Mapping\ChangeTrackingPolicy::class])) {
271 271
             $changeTrackingAnnot = $classAnnotations[Mapping\ChangeTrackingPolicy::class];
272
-            $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_' . $changeTrackingAnnot->value));
272
+            $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_'.$changeTrackingAnnot->value));
273 273
         }
274 274
 
275 275
         // Evaluate annotations on properties/fields
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
                 $mapping['cache'] = $metadata->getAssociationCacheDefaults(
294 294
                     $mapping['fieldName'],
295 295
                     [
296
-                        'usage'  => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage),
296
+                        'usage'  => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$cacheAnnot->usage),
297 297
                         'region' => $cacheAnnot->region,
298 298
                     ]
299 299
                 );
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
                 }
324 324
 
325 325
                 if ($generatedValueAnnot = $this->reader->getPropertyAnnotation($property, Mapping\GeneratedValue::class)) {
326
-                    $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $generatedValueAnnot->strategy));
326
+                    $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_'.$generatedValueAnnot->strategy));
327 327
                 }
328 328
 
329 329
                 if ($this->reader->getPropertyAnnotation($property, Mapping\Version::class)) {
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 
473 473
                 // Check for `fetch`
474 474
                 if ($associationOverride->fetch) {
475
-                    $override['fetch'] = constant(Mapping\ClassMetadata::class . '::FETCH_' . $associationOverride->fetch);
475
+                    $override['fetch'] = constant(Mapping\ClassMetadata::class.'::FETCH_'.$associationOverride->fetch);
476 476
                 }
477 477
 
478 478
                 $metadata->setAssociationOverride($fieldName, $override);
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
                 }
517 517
 
518 518
                 // Evaluate the listener using naming convention.
519
-                if ( ! $hasMapping ) {
519
+                if ( ! $hasMapping) {
520 520
                     EntityListenerBuilder::bindEntityListener($metadata, $listenerClassName);
521 521
                 }
522 522
             }
@@ -545,11 +545,11 @@  discard block
 block discarded – undo
545 545
      */
546 546
     private function getFetchMode($className, $fetchMode)
547 547
     {
548
-        if ( ! defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode)) {
548
+        if ( ! defined('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$fetchMode)) {
549 549
             throw MappingException::invalidFetchMode($className, $fetchMode);
550 550
         }
551 551
 
552
-        return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $fetchMode);
552
+        return constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$fetchMode);
553 553
     }
554 554
 
555 555
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         // Evaluate named native queries
110 110
         if (isset($element['namedNativeQueries'])) {
111 111
             foreach ($element['namedNativeQueries'] as $name => $mappingElement) {
112
-                if (!isset($mappingElement['name'])) {
112
+                if ( ! isset($mappingElement['name'])) {
113 113
                     $mappingElement['name'] = $name;
114 114
                 }
115 115
                 $metadata->addNamedNativeQuery(
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         // Evaluate sql result set mappings
127 127
         if (isset($element['sqlResultSetMappings'])) {
128 128
             foreach ($element['sqlResultSetMappings'] as $name => $resultSetMapping) {
129
-                if (!isset($resultSetMapping['name'])) {
129
+                if ( ! isset($resultSetMapping['name'])) {
130 130
                     $resultSetMapping['name'] = $name;
131 131
                 }
132 132
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         }
174 174
 
175 175
         if (isset($element['inheritanceType'])) {
176
-            $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType'])));
176
+            $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.strtoupper($element['inheritanceType'])));
177 177
 
178 178
             if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) {
179 179
                 // Evaluate discriminatorColumn
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
                 }
363 363
 
364 364
                 if (isset($oneToOneElement['fetch'])) {
365
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToOneElement['fetch']);
365
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToOneElement['fetch']);
366 366
                 }
367 367
 
368 368
                 if (isset($oneToOneElement['mappedBy'])) {
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
                 ];
417 417
 
418 418
                 if (isset($oneToManyElement['fetch'])) {
419
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToManyElement['fetch']);
419
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToManyElement['fetch']);
420 420
                 }
421 421
 
422 422
                 if (isset($oneToManyElement['cascade'])) {
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                 }
459 459
 
460 460
                 if (isset($manyToOneElement['fetch'])) {
461
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToOneElement['fetch']);
461
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToOneElement['fetch']);
462 462
                 }
463 463
 
464 464
                 if (isset($manyToOneElement['inversedBy'])) {
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                 ];
504 504
 
505 505
                 if (isset($manyToManyElement['fetch'])) {
506
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToManyElement['fetch']);
506
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToManyElement['fetch']);
507 507
                 }
508 508
 
509 509
                 if (isset($manyToManyElement['mappedBy'])) {
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         if (isset($element['associationOverride']) && is_array($element['associationOverride'])) {
574 574
 
575 575
             foreach ($element['associationOverride'] as $fieldName => $associationOverrideElement) {
576
-                $override   = [];
576
+                $override = [];
577 577
 
578 578
                 // Check for joinColumn
579 579
                 if (isset($associationOverrideElement['joinColumn'])) {
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
                 if (isset($associationOverrideElement['joinTable'])) {
592 592
 
593 593
                     $joinTableElement   = $associationOverrideElement['joinTable'];
594
-                    $joinTable          =  [
594
+                    $joinTable          = [
595 595
                         'name' => $joinTableElement['name']
596 596
                     ];
597 597
 
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 
626 626
                 // Check for `fetch`
627 627
                 if (isset($associationOverrideElement['fetch'])) {
628
-                    $override['fetch'] = constant(Metadata::class . '::FETCH_' . $associationOverrideElement['fetch']);
628
+                    $override['fetch'] = constant(Metadata::class.'::FETCH_'.$associationOverrideElement['fetch']);
629 629
                 }
630 630
 
631 631
                 $metadata->setAssociationOverride($fieldName, $override);
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
         if (isset($element['lifecycleCallbacks'])) {
646 646
             foreach ($element['lifecycleCallbacks'] as $type => $methods) {
647 647
                 foreach ($methods as $method) {
648
-                    $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::' . $type));
648
+                    $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::'.$type));
649 649
                 }
650 650
             }
651 651
         }
@@ -787,12 +787,12 @@  discard block
 block discarded – undo
787 787
         $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null;
788 788
         $usage  = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null;
789 789
 
790
-        if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) {
790
+        if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) {
791 791
             throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage));
792 792
         }
793 793
 
794 794
         if ($usage) {
795
-            $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage);
795
+            $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage);
796 796
         }
797 797
 
798 798
         return [
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
      */
807 807
     protected function loadMappingFile($file)
808 808
     {
809
-        if (defined(Yaml::class . '::PARSE_KEYS_AS_STRINGS')) {
809
+        if (defined(Yaml::class.'::PARSE_KEYS_AS_STRINGS')) {
810 810
             return Yaml::parse(file_get_contents($file), Yaml::PARSE_KEYS_AS_STRINGS);
811 811
         }
812 812
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 
342 342
         // FIXME: Order with composite keys might not be correct
343 343
         $sql = 'SELECT ' . $columnName
344
-             . ' FROM '  . $tableName
345
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
344
+                . ' FROM '  . $tableName
345
+                . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
346 346
 
347 347
         $types = [];
348 348
         foreach ($id as $field => $value) {
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
         }
484 484
 
485 485
         $sql = 'UPDATE ' . $quotedTableName
486
-             . ' SET ' . implode(', ', $set)
487
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
486
+                . ' SET ' . implode(', ', $set)
487
+                . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
488 488
 
489 489
         $result = $this->conn->executeUpdate($sql, $params, $types);
490 490
 
@@ -1539,9 +1539,9 @@  discard block
 block discarded – undo
1539 1539
         $lock  = $this->getLockTablesSql($lockMode);
1540 1540
         $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1541 1541
         $sql = 'SELECT 1 '
1542
-             . $lock
1543
-             . $where
1544
-             . $lockSql;
1542
+                . $lock
1543
+                . $where
1544
+                . $lockSql;
1545 1545
 
1546 1546
         list($params, $types) = $this->expandParameters($criteria);
1547 1547
 
@@ -1992,8 +1992,8 @@  discard block
 block discarded – undo
1992 1992
         $alias = $this->getSQLTableAlias($this->class->name);
1993 1993
 
1994 1994
         $sql = 'SELECT 1 '
1995
-             . $this->getLockTablesSql(null)
1996
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
1995
+                . $this->getLockTablesSql(null)
1996
+                . ' WHERE ' . $this->getSelectConditionSQL($criteria);
1997 1997
 
1998 1998
         list($params, $types) = $this->expandParameters($criteria);
1999 1999
 
@@ -2023,9 +2023,9 @@  discard block
 block discarded – undo
2023 2023
     {
2024 2024
         // if one of the join columns is nullable, return left join
2025 2025
         foreach ($joinColumns as $joinColumn) {
2026
-             if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) {
2027
-                 return 'LEFT JOIN';
2028
-             }
2026
+                if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) {
2027
+                    return 'LEFT JOIN';
2028
+                }
2029 2029
         }
2030 2030
 
2031 2031
         return 'INNER JOIN';
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
         $columnName   = $this->quoteStrategy->getColumnName($versionField, $versionedClass, $this->platform);
341 341
 
342 342
         // FIXME: Order with composite keys might not be correct
343
-        $sql = 'SELECT ' . $columnName
344
-             . ' FROM '  . $tableName
345
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
343
+        $sql = 'SELECT '.$columnName
344
+             . ' FROM '.$tableName
345
+             . ' WHERE '.implode(' = ? AND ', $identifier).' = ?';
346 346
 
347 347
         $types = [];
348 348
         foreach ($id as $field => $value) {
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
             }
426 426
 
427 427
             $params[]   = $value;
428
-            $set[]      = $column . ' = ' . $placeholder;
428
+            $set[]      = $column.' = '.$placeholder;
429 429
             $types[]    = $this->columnTypes[$columnName];
430 430
         }
431 431
 
@@ -473,18 +473,18 @@  discard block
 block discarded – undo
473 473
                 case Type::SMALLINT:
474 474
                 case Type::INTEGER:
475 475
                 case Type::BIGINT:
476
-                    $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1';
476
+                    $set[] = $versionColumn.' = '.$versionColumn.' + 1';
477 477
                     break;
478 478
 
479 479
                 case Type::DATETIME:
480
-                    $set[] = $versionColumn . ' = CURRENT_TIMESTAMP';
480
+                    $set[] = $versionColumn.' = CURRENT_TIMESTAMP';
481 481
                     break;
482 482
             }
483 483
         }
484 484
 
485
-        $sql = 'UPDATE ' . $quotedTableName
486
-             . ' SET ' . implode(', ', $set)
487
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
485
+        $sql = 'UPDATE '.$quotedTableName
486
+             . ' SET '.implode(', ', $set)
487
+             . ' WHERE '.implode(' = ? AND ', $where).' = ?';
488 488
 
489 489
         $result = $this->conn->executeUpdate($sql, $params, $types);
490 490
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 
528 528
 
529 529
             if ($selfReferential) {
530
-                $otherColumns = (! $mapping['isOwningSide'])
530
+                $otherColumns = ( ! $mapping['isOwningSide'])
531 531
                     ? $association['joinTable']['joinColumns']
532 532
                     : $association['joinTable']['inverseJoinColumns'];
533 533
             }
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
         $tableName  = $this->quoteStrategy->getTableName($class, $this->platform);
566 566
         $idColumns  = $this->quoteStrategy->getIdentifierColumnNames($class, $this->platform);
567 567
         $id         = array_combine($idColumns, $identifier);
568
-        $types      = array_map(function ($identifier) use ($class, $self) {
568
+        $types      = array_map(function($identifier) use ($class, $self) {
569 569
             if (isset($class->fieldMappings[$identifier])) {
570 570
                 return $class->fieldMappings[$identifier]['type'];
571 571
             }
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
                     );
1029 1029
             }
1030 1030
 
1031
-            $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value;
1031
+            $criteria[$quotedJoinTable.'.'.$quotedKeyColumn] = $value;
1032 1032
             $parameters[] = [
1033 1033
                 'value' => $value,
1034 1034
                 'field' => $field,
@@ -1071,11 +1071,11 @@  discard block
 block discarded – undo
1071 1071
 
1072 1072
         switch ($lockMode) {
1073 1073
             case LockMode::PESSIMISTIC_READ:
1074
-                $lockSql = ' ' . $this->platform->getReadLockSql();
1074
+                $lockSql = ' '.$this->platform->getReadLockSql();
1075 1075
                 break;
1076 1076
 
1077 1077
             case LockMode::PESSIMISTIC_WRITE:
1078
-                $lockSql = ' ' . $this->platform->getWriteLockSql();
1078
+                $lockSql = ' '.$this->platform->getWriteLockSql();
1079 1079
                 break;
1080 1080
         }
1081 1081
 
@@ -1086,14 +1086,14 @@  discard block
 block discarded – undo
1086 1086
 
1087 1087
         if ('' !== $filterSql) {
1088 1088
             $conditionSql = $conditionSql
1089
-                ? $conditionSql . ' AND ' . $filterSql
1089
+                ? $conditionSql.' AND '.$filterSql
1090 1090
                 : $filterSql;
1091 1091
         }
1092 1092
 
1093
-        $select = 'SELECT ' . $columnList;
1094
-        $from   = ' FROM ' . $tableName . ' '. $tableAlias;
1095
-        $join   = $this->currentPersisterContext->selectJoinSql . $joinSql;
1096
-        $where  = ($conditionSql ? ' WHERE ' . $conditionSql : '');
1093
+        $select = 'SELECT '.$columnList;
1094
+        $from   = ' FROM '.$tableName.' '.$tableAlias;
1095
+        $join   = $this->currentPersisterContext->selectJoinSql.$joinSql;
1096
+        $where  = ($conditionSql ? ' WHERE '.$conditionSql : '');
1097 1097
         $lock   = $this->platform->appendLockHint($from, $lockMode);
1098 1098
         $query  = $select
1099 1099
             . $lock
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
             . $where
1102 1102
             . $orderBySql;
1103 1103
 
1104
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
1104
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
1105 1105
     }
1106 1106
 
1107 1107
     /**
@@ -1120,13 +1120,13 @@  discard block
 block discarded – undo
1120 1120
 
1121 1121
         if ('' !== $filterSql) {
1122 1122
             $conditionSql = $conditionSql
1123
-                ? $conditionSql . ' AND ' . $filterSql
1123
+                ? $conditionSql.' AND '.$filterSql
1124 1124
                 : $filterSql;
1125 1125
         }
1126 1126
 
1127 1127
         $sql = 'SELECT COUNT(*) '
1128
-            . 'FROM ' . $tableName . ' ' . $tableAlias
1129
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
1128
+            . 'FROM '.$tableName.' '.$tableAlias
1129
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
1130 1130
 
1131 1131
         return $sql;
1132 1132
     }
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
                     : $baseTableAlias;
1160 1160
 
1161 1161
                 $columnName    = $this->quoteStrategy->getColumnName($fieldName, $this->class, $this->platform);
1162
-                $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation;
1162
+                $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation;
1163 1163
 
1164 1164
                 continue;
1165 1165
             }
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 
1177 1177
                 foreach ($this->class->associationMappings[$fieldName]['joinColumns'] as $joinColumn) {
1178 1178
                     $columnName    = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1179
-                    $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation;
1179
+                    $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation;
1180 1180
                 }
1181 1181
 
1182 1182
                 continue;
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
             throw ORMException::unrecognizedField($fieldName);
1186 1186
         }
1187 1187
 
1188
-        return ' ORDER BY ' . implode(', ', $orderByList);
1188
+        return ' ORDER BY '.implode(', ', $orderByList);
1189 1189
     }
1190 1190
 
1191 1191
     /**
@@ -1213,8 +1213,8 @@  discard block
 block discarded – undo
1213 1213
             $columnList[] = $this->getSelectColumnSQL($field, $this->class);
1214 1214
         }
1215 1215
 
1216
-        $this->currentPersisterContext->selectJoinSql    = '';
1217
-        $eagerAliasCounter      = 0;
1216
+        $this->currentPersisterContext->selectJoinSql = '';
1217
+        $eagerAliasCounter = 0;
1218 1218
 
1219 1219
         foreach ($this->class->associationMappings as $assocField => $assoc) {
1220 1220
             $assocColumnSQL = $this->getSelectColumnAssociationSQL($assocField, $assoc, $this->class);
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
                 continue; // now this is why you shouldn't use inheritance
1241 1241
             }
1242 1242
 
1243
-            $assocAlias = 'e' . ($eagerAliasCounter++);
1243
+            $assocAlias = 'e'.($eagerAliasCounter++);
1244 1244
             $this->currentPersisterContext->rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField);
1245 1245
 
1246 1246
             foreach ($eagerEntity->fieldNames as $field) {
@@ -1273,14 +1273,14 @@  discard block
 block discarded – undo
1273 1273
             $joinTableName  = $this->quoteStrategy->getTableName($eagerEntity, $this->platform);
1274 1274
 
1275 1275
             if ($assoc['isOwningSide']) {
1276
-                $tableAlias           = $this->getSQLTableAlias($association['targetEntity'], $assocAlias);
1277
-                $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($association['joinColumns']);
1276
+                $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias);
1277
+                $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForJoinColumns($association['joinColumns']);
1278 1278
 
1279 1279
                 foreach ($association['joinColumns'] as $joinColumn) {
1280 1280
                     $sourceCol       = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1281 1281
                     $targetCol       = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform);
1282 1282
                     $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'])
1283
-                                        . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol;
1283
+                                        . '.'.$sourceCol.' = '.$tableAlias.'.'.$targetCol;
1284 1284
                 }
1285 1285
 
1286 1286
                 // Add filter SQL
@@ -1296,12 +1296,12 @@  discard block
 block discarded – undo
1296 1296
                     $sourceCol       = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1297 1297
                     $targetCol       = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform);
1298 1298
 
1299
-                    $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = '
1300
-                        . $this->getSQLTableAlias($association['targetEntity']) . '.' . $targetCol;
1299
+                    $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias).'.'.$sourceCol.' = '
1300
+                        . $this->getSQLTableAlias($association['targetEntity']).'.'.$targetCol;
1301 1301
                 }
1302 1302
             }
1303 1303
 
1304
-            $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON ';
1304
+            $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON ';
1305 1305
             $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition);
1306 1306
         }
1307 1307
 
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
      */
1323 1323
     protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r')
1324 1324
     {
1325
-        if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) ) {
1325
+        if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) {
1326 1326
             return '';
1327 1327
         }
1328 1328
 
@@ -1371,10 +1371,10 @@  discard block
 block discarded – undo
1371 1371
         foreach ($joinColumns as $joinColumn) {
1372 1372
             $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1373 1373
             $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform);
1374
-            $conditions[]       = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableName . '.' . $quotedSourceColumn;
1374
+            $conditions[]       = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableName.'.'.$quotedSourceColumn;
1375 1375
         }
1376 1376
 
1377
-        return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions);
1377
+        return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions);
1378 1378
     }
1379 1379
 
1380 1380
     /**
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
                 continue;
1454 1454
             }
1455 1455
 
1456
-            if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) {
1456
+            if ( ! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) {
1457 1457
                 $columns[]                = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform);
1458 1458
                 $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type'];
1459 1459
             }
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
      */
1475 1475
     protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r')
1476 1476
     {
1477
-        $root         = $alias == 'r' ? '' : $alias ;
1477
+        $root         = $alias == 'r' ? '' : $alias;
1478 1478
         $tableAlias   = $this->getSQLTableAlias($class->name, $root);
1479 1479
         $fieldMapping = $class->fieldMappings[$field];
1480 1480
         $sql          = sprintf('%s.%s', $tableAlias, $this->quoteStrategy->getColumnName($field, $class, $this->platform));
@@ -1487,7 +1487,7 @@  discard block
 block discarded – undo
1487 1487
             $sql  = $type->convertToPHPValueSQL($sql, $this->platform);
1488 1488
         }
1489 1489
 
1490
-        return $sql . ' AS ' . $columnAlias;
1490
+        return $sql.' AS '.$columnAlias;
1491 1491
     }
1492 1492
 
1493 1493
     /**
@@ -1503,14 +1503,14 @@  discard block
 block discarded – undo
1503 1503
     protected function getSQLTableAlias($className, $assocName = '')
1504 1504
     {
1505 1505
         if ($assocName) {
1506
-            $className .= '#' . $assocName;
1506
+            $className .= '#'.$assocName;
1507 1507
         }
1508 1508
 
1509 1509
         if (isset($this->currentPersisterContext->sqlTableAliases[$className])) {
1510 1510
             return $this->currentPersisterContext->sqlTableAliases[$className];
1511 1511
         }
1512 1512
 
1513
-        $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++;
1513
+        $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++;
1514 1514
 
1515 1515
         $this->currentPersisterContext->sqlTableAliases[$className] = $tableAlias;
1516 1516
 
@@ -1537,7 +1537,7 @@  discard block
 block discarded – undo
1537 1537
         }
1538 1538
 
1539 1539
         $lock  = $this->getLockTablesSql($lockMode);
1540
-        $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1540
+        $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' ';
1541 1541
         $sql = 'SELECT 1 '
1542 1542
              . $lock
1543 1543
              . $where
@@ -1559,7 +1559,7 @@  discard block
 block discarded – undo
1559 1559
     {
1560 1560
         return $this->platform->appendLockHint(
1561 1561
             'FROM '
1562
-            . $this->quoteStrategy->getTableName($this->class, $this->platform) . ' '
1562
+            . $this->quoteStrategy->getTableName($this->class, $this->platform).' '
1563 1563
             . $this->getSQLTableAlias($this->class->name),
1564 1564
             $lockMode
1565 1565
         );
@@ -1611,19 +1611,19 @@  discard block
 block discarded – undo
1611 1611
 
1612 1612
             if (null !== $comparison) {
1613 1613
                 // special case null value handling
1614
-                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) {
1615
-                    $selectedColumns[] = $column . ' IS NULL';
1614
+                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) {
1615
+                    $selectedColumns[] = $column.' IS NULL';
1616 1616
 
1617 1617
                     continue;
1618 1618
                 }
1619 1619
 
1620 1620
                 if ($comparison === Comparison::NEQ && null === $value) {
1621
-                    $selectedColumns[] = $column . ' IS NOT NULL';
1621
+                    $selectedColumns[] = $column.' IS NOT NULL';
1622 1622
 
1623 1623
                     continue;
1624 1624
                 }
1625 1625
 
1626
-                $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder);
1626
+                $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder);
1627 1627
 
1628 1628
                 continue;
1629 1629
             }
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
                 ? $this->class->fieldMappings[$field]['inherited']
1672 1672
                 : $this->class->name;
1673 1673
 
1674
-            return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)];
1674
+            return [$this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getColumnName($field, $this->class, $this->platform)];
1675 1675
         }
1676 1676
 
1677 1677
         if (isset($this->class->associationMappings[$field])) {
@@ -1692,7 +1692,7 @@  discard block
 block discarded – undo
1692 1692
 
1693 1693
 
1694 1694
                 foreach ($joinColumns as $joinColumn) {
1695
-                    $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
1695
+                    $columns[] = $joinTableName.'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
1696 1696
                 }
1697 1697
 
1698 1698
             } else {
@@ -1700,12 +1700,12 @@  discard block
 block discarded – undo
1700 1700
                     throw ORMException::invalidFindByInverseAssociation($this->class->name, $field);
1701 1701
                 }
1702 1702
 
1703
-                $className  = (isset($association['inherited']))
1703
+                $className = (isset($association['inherited']))
1704 1704
                     ? $association['inherited']
1705 1705
                     : $this->class->name;
1706 1706
 
1707 1707
                 foreach ($association['joinColumns'] as $joinColumn) {
1708
-                    $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1708
+                    $columns[] = $this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1709 1709
                 }
1710 1710
             }
1711 1711
             return $columns;
@@ -1797,7 +1797,7 @@  discard block
 block discarded – undo
1797 1797
                     $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]];
1798 1798
                 }
1799 1799
 
1800
-                $criteria[$tableAlias . "." . $targetKeyColumn] = $value;
1800
+                $criteria[$tableAlias.".".$targetKeyColumn] = $value;
1801 1801
                 $parameters[]                                   = [
1802 1802
                     'value' => $value,
1803 1803
                     'field' => $field,
@@ -1810,7 +1810,7 @@  discard block
 block discarded – undo
1810 1810
             $field = $sourceClass->fieldNames[$sourceKeyColumn];
1811 1811
             $value = $sourceClass->reflFields[$field]->getValue($sourceEntity);
1812 1812
 
1813
-            $criteria[$tableAlias . "." . $targetKeyColumn] = $value;
1813
+            $criteria[$tableAlias.".".$targetKeyColumn] = $value;
1814 1814
             $parameters[] = [
1815 1815
                 'value' => $value,
1816 1816
                 'field' => $field,
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
                 $assoc = $class->associationMappings[$field];
1898 1898
                 $class = $this->em->getClassMetadata($assoc['targetEntity']);
1899 1899
 
1900
-                if (! $assoc['isOwningSide']) {
1900
+                if ( ! $assoc['isOwningSide']) {
1901 1901
                     $assoc = $class->associationMappings[$assoc['mappedBy']];
1902 1902
                     $class = $this->em->getClassMetadata($assoc['targetEntity']);
1903 1903
                 }
@@ -1906,7 +1906,7 @@  discard block
 block discarded – undo
1906 1906
                     ? $assoc['relationToTargetKeyColumns']
1907 1907
                     : $assoc['sourceToTargetKeyColumns'];
1908 1908
 
1909
-                foreach ($columns as $column){
1909
+                foreach ($columns as $column) {
1910 1910
                     $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em);
1911 1911
                 }
1912 1912
                 break;
@@ -1917,7 +1917,7 @@  discard block
 block discarded – undo
1917 1917
         }
1918 1918
 
1919 1919
         if (is_array($value)) {
1920
-            return array_map(function ($type) {
1920
+            return array_map(function($type) {
1921 1921
                 $type = Type::getType($type);
1922 1922
 
1923 1923
                 return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET;
@@ -1993,12 +1993,12 @@  discard block
 block discarded – undo
1993 1993
 
1994 1994
         $sql = 'SELECT 1 '
1995 1995
              . $this->getLockTablesSql(null)
1996
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
1996
+             . ' WHERE '.$this->getSelectConditionSQL($criteria);
1997 1997
 
1998 1998
         list($params, $types) = $this->expandParameters($criteria);
1999 1999
 
2000 2000
         if (null !== $extraConditions) {
2001
-            $sql                                 .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions);
2001
+            $sql                                 .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions);
2002 2002
             list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions);
2003 2003
 
2004 2004
             $params = array_merge($params, $criteriaParams);
@@ -2006,7 +2006,7 @@  discard block
 block discarded – undo
2006 2006
         }
2007 2007
 
2008 2008
         if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) {
2009
-            $sql .= ' AND ' . $filterSql;
2009
+            $sql .= ' AND '.$filterSql;
2010 2010
         }
2011 2011
 
2012 2012
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
@@ -2053,13 +2053,13 @@  discard block
 block discarded – undo
2053 2053
 
2054 2054
         foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
2055 2055
             if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) {
2056
-                $filterClauses[] = '(' . $filterExpr . ')';
2056
+                $filterClauses[] = '('.$filterExpr.')';
2057 2057
             }
2058 2058
         }
2059 2059
 
2060 2060
         $sql = implode(' AND ', $filterClauses);
2061 2061
 
2062
-        return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL"
2062
+        return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL"
2063 2063
     }
2064 2064
 
2065 2065
     /**
Please login to merge, or discard this patch.