Failed Conditions
Pull Request — master (#6743)
by Grégoire
11:42
created
lib/Doctrine/ORM/EntityManager/UnrecognizedIdentifierFields.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\EntityManager;
6 6
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public static function fromClassAndFieldNames(string $className, array $fieldNames) : self
12 12
     {
13 13
         return new self(
14
-            "Unrecognized identifier fields: '" . implode("', '", $fieldNames) . "' " .
14
+            "Unrecognized identifier fields: '".implode("', '", $fieldNames)."' ".
15 15
             "are not present on class '$className'."
16 16
         );
17 17
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/UnrecognizedField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Persisters;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/MetadataCacheUsesNonPersistentCache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Cache;
6 6
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public static function fromDriver(Cache $cache) : self
12 12
     {
13 13
         return new self(
14
-            'Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'
14
+            'Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.'
15 15
         );
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/QueryCacheUsesNonPersistentCache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Cache;
6 6
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public static function fromDriver(Cache $cache) : self
12 12
     {
13 13
         return new self(
14
-            'Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'
14
+            'Query Cache uses a non-persistent cache driver, '.get_class($cache).'.'
15 15
         );
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/TableGeneratorNotImplementedYet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Mapping;
7 7
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/InvalidCustomGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Mapping;
7 7
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityManager.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     {
280 280
         $query = new Query($this);
281 281
 
282
-        if (! empty($dql)) {
282
+        if ( ! empty($dql)) {
283 283
             $query->setDQL($dql);
284 284
         }
285 285
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         $class     = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
389 389
         $className = $class->getClassName();
390 390
 
391
-        if (! is_array($id)) {
391
+        if ( ! is_array($id)) {
392 392
             if ($class->isIdentifierComposite()) {
393 393
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
394 394
             }
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
         $sortedId = [];
410 410
 
411 411
         foreach ($class->identifier as $identifier) {
412
-            if (! isset($id[$identifier])) {
412
+            if ( ! isset($id[$identifier])) {
413 413
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
414 414
             }
415 415
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         // Check identity map first
427 427
         $entity = $unitOfWork->tryGetById($sortedId, $class->getRootClassName());
428 428
         if ($entity !== false) {
429
-            if (! ($entity instanceof $className)) {
429
+            if ( ! ($entity instanceof $className)) {
430 430
                 return null;
431 431
             }
432 432
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 
451 451
         switch (true) {
452 452
             case $lockMode === LockMode::OPTIMISTIC:
453
-                if (! $class->isVersioned()) {
453
+                if ( ! $class->isVersioned()) {
454 454
                     throw OptimisticLockException::notVersioned($className);
455 455
                 }
456 456
 
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 
463 463
             case $lockMode === LockMode::PESSIMISTIC_READ:
464 464
             case $lockMode === LockMode::PESSIMISTIC_WRITE:
465
-                if (! $this->getConnection()->isTransactionActive()) {
465
+                if ( ! $this->getConnection()->isTransactionActive()) {
466 466
                     throw TransactionRequiredException::transactionRequired();
467 467
                 }
468 468
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
         $class     = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
482 482
         $className = $class->getClassName();
483 483
 
484
-        if (! is_array($id)) {
484
+        if ( ! is_array($id)) {
485 485
             if ($class->isIdentifierComposite()) {
486 486
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
487 487
             }
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
         $sortedId = [];
507 507
 
508 508
         foreach ($class->identifier as $identifier) {
509
-            if (! isset($scalarId[$identifier])) {
509
+            if ( ! isset($scalarId[$identifier])) {
510 510
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
511 511
             }
512 512
 
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
         $class     = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
548 548
         $className = $class->getClassName();
549 549
 
550
-        if (! is_array($id)) {
550
+        if ( ! is_array($id)) {
551 551
             if ($class->isIdentifierComposite()) {
552 552
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
553 553
             }
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
         $sortedId = [];
569 569
 
570 570
         foreach ($class->identifier as $identifier) {
571
-            if (! isset($id[$identifier])) {
571
+            if ( ! isset($id[$identifier])) {
572 572
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
573 573
             }
574 574
 
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
      */
643 643
     public function persist($entity)
644 644
     {
645
-        if (! is_object($entity)) {
645
+        if ( ! is_object($entity)) {
646 646
             throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity);
647 647
         }
648 648
 
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
      */
666 666
     public function remove($entity)
667 667
     {
668
-        if (! is_object($entity)) {
668
+        if ( ! is_object($entity)) {
669 669
             throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity);
670 670
         }
671 671
 
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
      */
687 687
     public function refresh($entity)
688 688
     {
689
-        if (! is_object($entity)) {
689
+        if ( ! is_object($entity)) {
690 690
             throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity);
691 691
         }
692 692
 
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
      */
843 843
     public static function create($connection, Configuration $config, ?EventManager $eventManager = null)
844 844
     {
845
-        if (! $config->getMetadataDriverImpl()) {
845
+        if ( ! $config->getMetadataDriverImpl()) {
846 846
             throw MissingMappingDriverImplementation::create();
847 847
         }
848 848
 
@@ -869,12 +869,12 @@  discard block
 block discarded – undo
869 869
             return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager());
870 870
         }
871 871
 
872
-        if (! $connection instanceof Connection) {
872
+        if ( ! $connection instanceof Connection) {
873 873
             throw new \InvalidArgumentException(
874 874
                 sprintf(
875 875
                     'Invalid $connection argument of type %s given%s.',
876 876
                     is_object($connection) ? get_class($connection) : gettype($connection),
877
-                    is_object($connection) ? '' : ': "' . $connection . '"'
877
+                    is_object($connection) ? '' : ': "'.$connection.'"'
878 878
                 )
879 879
             );
880 880
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php 1 patch
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Persisters\Entity;
6 6
 
@@ -287,16 +287,16 @@  discard block
 block discarded – undo
287 287
         $tableName      = $versionedClass->table->getQuotedQualifiedName($this->platform);
288 288
         $columnName     = $this->platform->quoteIdentifier($versionProperty->getColumnName());
289 289
         $identifier     = array_map(
290
-            function ($columnName) {
290
+            function($columnName) {
291 291
                 return $this->platform->quoteIdentifier($columnName);
292 292
             },
293 293
             array_keys($versionedClass->getIdentifierColumns($this->em))
294 294
         );
295 295
 
296 296
         // FIXME: Order with composite keys might not be correct
297
-        $sql = 'SELECT ' . $columnName
298
-             . ' FROM ' . $tableName
299
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
297
+        $sql = 'SELECT '.$columnName
298
+             . ' FROM '.$tableName
299
+             . ' WHERE '.implode(' = ? AND ', $identifier).' = ?';
300 300
 
301 301
         $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id);
302 302
         $versionType = $versionProperty->getType();
@@ -335,13 +335,13 @@  discard block
 block discarded – undo
335 335
         $tableName  = $this->class->getTableName();
336 336
         $updateData = $this->prepareUpdateData($entity);
337 337
 
338
-        if (! isset($updateData[$tableName])) {
338
+        if ( ! isset($updateData[$tableName])) {
339 339
             return;
340 340
         }
341 341
 
342 342
         $data = $updateData[$tableName];
343 343
 
344
-        if (! $data) {
344
+        if ( ! $data) {
345 345
             return;
346 346
         }
347 347
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 
395 395
             if ($value !== null) {
396 396
                 // @todo guilhermeblanco Make sure we do not have flat association values.
397
-                if (! is_array($value)) {
397
+                if ( ! is_array($value)) {
398 398
                     $value = [$targetClass->identifier[0] => $value];
399 399
                 }
400 400
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
408 408
                 $targetField          = $targetClass->fieldNames[$referencedColumnName];
409 409
 
410
-                if (! $joinColumn->getType()) {
410
+                if ( ! $joinColumn->getType()) {
411 411
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
412 412
                 }
413 413
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
                         $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
474 474
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
475 475
 
476
-                        if (! $joinColumn->getType()) {
476
+                        if ( ! $joinColumn->getType()) {
477 477
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
478 478
                         }
479 479
 
@@ -500,18 +500,18 @@  discard block
 block discarded – undo
500 500
                 case Type::SMALLINT:
501 501
                 case Type::INTEGER:
502 502
                 case Type::BIGINT:
503
-                    $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1';
503
+                    $set[] = $versionColumnName.' = '.$versionColumnName.' + 1';
504 504
                     break;
505 505
 
506 506
                 case Type::DATETIME:
507
-                    $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP';
507
+                    $set[] = $versionColumnName.' = CURRENT_TIMESTAMP';
508 508
                     break;
509 509
             }
510 510
         }
511 511
 
512
-        $sql = 'UPDATE ' . $quotedTableName
513
-             . ' SET ' . implode(', ', $set)
514
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
512
+        $sql = 'UPDATE '.$quotedTableName
513
+             . ' SET '.implode(', ', $set)
514
+             . ' WHERE '.implode(' = ? AND ', $where).' = ?';
515 515
 
516 516
         $result = $this->conn->executeUpdate($sql, $params, $types);
517 517
 
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
     protected function deleteJoinTableRecords($identifier)
529 529
     {
530 530
         foreach ($this->class->getDeclaredPropertiesIterator() as $association) {
531
-            if (! ($association instanceof ManyToManyAssociationMetadata)) {
531
+            if ( ! ($association instanceof ManyToManyAssociationMetadata)) {
532 532
                 continue;
533 533
             }
534 534
 
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
             $otherKeys         = [];
541 541
             $keys              = [];
542 542
 
543
-            if (! $owningAssociation->isOwningSide()) {
543
+            if ( ! $owningAssociation->isOwningSide()) {
544 544
                 $class             = $this->em->getClassMetadata($association->getTargetEntity());
545 545
                 $owningAssociation = $class->getProperty($association->getMappedBy());
546 546
             }
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
             }
654 654
 
655 655
             // Only owning side of x-1 associations can have a FK column.
656
-            if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) {
656
+            if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) {
657 657
                 continue;
658 658
             }
659 659
 
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
                 /** @var JoinColumnMetadata $joinColumn */
674 674
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
675 675
 
676
-                if (! $joinColumn->getType()) {
676
+                if ( ! $joinColumn->getType()) {
677 677
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
678 678
                 }
679 679
 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
         $propertyName = $this->class->fieldNames[$columnName];
702 702
         $property     = $this->class->getProperty($propertyName);
703 703
 
704
-        if (! $property) {
704
+        if ( ! $property) {
705 705
             return null;
706 706
         }
707 707
 
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
             /** @var JoinColumnMetadata $joinColumn */
721 721
             $referencedColumnName = $joinColumn->getReferencedColumnName();
722 722
 
723
-            if (! $joinColumn->getType()) {
723
+            if ( ! $joinColumn->getType()) {
724 724
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
725 725
             }
726 726
 
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
             $sourceKeyColumn = $joinColumn->getReferencedColumnName();
826 826
             $targetKeyColumn = $joinColumn->getColumnName();
827 827
 
828
-            if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) {
828
+            if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) {
829 829
                 throw MappingException::joinColumnMustPointToMappedField(
830 830
                     $sourceClass->getClassName(),
831 831
                     $sourceKeyColumn
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
         $criteria    = [];
1053 1053
         $parameters  = [];
1054 1054
 
1055
-        if (! $association->isOwningSide()) {
1055
+        if ( ! $association->isOwningSide()) {
1056 1056
             $class       = $this->em->getClassMetadata($association->getTargetEntity());
1057 1057
             $owningAssoc = $class->getProperty($association->getMappedBy());
1058 1058
         }
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
                 $value = $value[$targetClass->identifier[0]];
1081 1081
             }
1082 1082
 
1083
-            $criteria[$joinTableName . '.' . $quotedColumnName] = $value;
1083
+            $criteria[$joinTableName.'.'.$quotedColumnName] = $value;
1084 1084
             $parameters[]                                       = [
1085 1085
                 'value' => $value,
1086 1086
                 'field' => $fieldName,
@@ -1130,11 +1130,11 @@  discard block
 block discarded – undo
1130 1130
 
1131 1131
         switch ($lockMode) {
1132 1132
             case LockMode::PESSIMISTIC_READ:
1133
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
1133
+                $lockSql = ' '.$this->platform->getReadLockSQL();
1134 1134
                 break;
1135 1135
 
1136 1136
             case LockMode::PESSIMISTIC_WRITE:
1137
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
1137
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
1138 1138
                 break;
1139 1139
         }
1140 1140
 
@@ -1145,14 +1145,14 @@  discard block
 block discarded – undo
1145 1145
 
1146 1146
         if ($filterSql !== '') {
1147 1147
             $conditionSql = $conditionSql
1148
-                ? $conditionSql . ' AND ' . $filterSql
1148
+                ? $conditionSql.' AND '.$filterSql
1149 1149
                 : $filterSql;
1150 1150
         }
1151 1151
 
1152
-        $select = 'SELECT ' . $columnList;
1153
-        $from   = ' FROM ' . $tableName . ' ' . $tableAlias;
1154
-        $join   = $this->currentPersisterContext->selectJoinSql . $joinSql;
1155
-        $where  = ($conditionSql ? ' WHERE ' . $conditionSql : '');
1152
+        $select = 'SELECT '.$columnList;
1153
+        $from   = ' FROM '.$tableName.' '.$tableAlias;
1154
+        $join   = $this->currentPersisterContext->selectJoinSql.$joinSql;
1155
+        $where  = ($conditionSql ? ' WHERE '.$conditionSql : '');
1156 1156
         $lock   = $this->platform->appendLockHint($from, $lockMode);
1157 1157
         $query  = $select
1158 1158
             . $lock
@@ -1160,7 +1160,7 @@  discard block
 block discarded – undo
1160 1160
             . $where
1161 1161
             . $orderBySql;
1162 1162
 
1163
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
1163
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
1164 1164
     }
1165 1165
 
1166 1166
     /**
@@ -1179,13 +1179,13 @@  discard block
 block discarded – undo
1179 1179
 
1180 1180
         if ($filterSql !== '') {
1181 1181
             $conditionSql = $conditionSql
1182
-                ? $conditionSql . ' AND ' . $filterSql
1182
+                ? $conditionSql.' AND '.$filterSql
1183 1183
                 : $filterSql;
1184 1184
         }
1185 1185
 
1186 1186
         $sql = 'SELECT COUNT(*) '
1187
-            . 'FROM ' . $tableName . ' ' . $tableAlias
1188
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
1187
+            . 'FROM '.$tableName.' '.$tableAlias
1188
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
1189 1189
 
1190 1190
         return $sql;
1191 1191
     }
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
      */
1203 1203
     final protected function getOrderBySQL(array $orderBy, $baseTableAlias)
1204 1204
     {
1205
-        if (! $orderBy) {
1205
+        if ( ! $orderBy) {
1206 1206
             return '';
1207 1207
         }
1208 1208
 
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
         foreach ($orderBy as $fieldName => $orientation) {
1212 1212
             $orientation = strtoupper(trim($orientation));
1213 1213
 
1214
-            if (! in_array($orientation, ['ASC', 'DESC'], true)) {
1214
+            if ( ! in_array($orientation, ['ASC', 'DESC'], true)) {
1215 1215
                 throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName);
1216 1216
             }
1217 1217
 
@@ -1221,11 +1221,11 @@  discard block
 block discarded – undo
1221 1221
                 $tableAlias = $this->getSQLTableAlias($property->getTableName());
1222 1222
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
1223 1223
 
1224
-                $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation;
1224
+                $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation;
1225 1225
 
1226 1226
                 continue;
1227 1227
             } elseif ($property instanceof AssociationMetadata) {
1228
-                if (! $property->isOwningSide()) {
1228
+                if ( ! $property->isOwningSide()) {
1229 1229
                     throw InvalidFindByCall::fromInverseSideUsage(
1230 1230
                         $this->class->getClassName(),
1231 1231
                         $fieldName
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
                     /* @var JoinColumnMetadata $joinColumn */
1242 1242
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1243 1243
 
1244
-                    $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation;
1244
+                    $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation;
1245 1245
                 }
1246 1246
 
1247 1247
                 continue;
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
             throw UnrecognizedField::byName($fieldName);
1251 1251
         }
1252 1252
 
1253
-        return ' ORDER BY ' . implode(', ', $orderByList);
1253
+        return ' ORDER BY '.implode(', ', $orderByList);
1254 1254
     }
1255 1255
 
1256 1256
     /**
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
                     $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide();
1293 1293
                     $isAssocFromOneEager     = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER;
1294 1294
 
1295
-                    if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) {
1295
+                    if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) {
1296 1296
                         break;
1297 1297
                     }
1298 1298
 
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
                         break; // now this is why you shouldn't use inheritance
1308 1308
                     }
1309 1309
 
1310
-                    $assocAlias = 'e' . ($eagerAliasCounter++);
1310
+                    $assocAlias = 'e'.($eagerAliasCounter++);
1311 1311
 
1312 1312
                     $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName);
1313 1313
 
@@ -1335,14 +1335,14 @@  discard block
 block discarded – undo
1335 1335
                         $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy());
1336 1336
                     }
1337 1337
 
1338
-                    if (! $property->isOwningSide()) {
1338
+                    if ( ! $property->isOwningSide()) {
1339 1339
                         $owningAssociation = $eagerEntity->getProperty($property->getMappedBy());
1340 1340
                     }
1341 1341
 
1342 1342
                     $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias);
1343 1343
                     $joinTableName  = $eagerEntity->table->getQuotedQualifiedName($this->platform);
1344 1344
 
1345
-                    $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property);
1345
+                    $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property);
1346 1346
 
1347 1347
                     $sourceClass      = $this->em->getClassMetadata($owningAssociation->getSourceEntity());
1348 1348
                     $targetClass      = $this->em->getClassMetadata($owningAssociation->getTargetEntity());
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
                         $joinCondition[] = $filterSql;
1367 1367
                     }
1368 1368
 
1369
-                    $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON ';
1369
+                    $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON ';
1370 1370
                     $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition);
1371 1371
 
1372 1372
                     break;
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
      */
1389 1389
     protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r')
1390 1390
     {
1391
-        if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) {
1391
+        if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) {
1392 1392
             return '';
1393 1393
         }
1394 1394
 
@@ -1403,7 +1403,7 @@  discard block
 block discarded – undo
1403 1403
             $referencedColumnName = $joinColumn->getReferencedColumnName();
1404 1404
             $resultColumnName     = $this->getSQLColumnAlias();
1405 1405
 
1406
-            if (! $joinColumn->getType()) {
1406
+            if ( ! $joinColumn->getType()) {
1407 1407
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
1408 1408
             }
1409 1409
 
@@ -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
         }
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
             );
1458 1458
         }
1459 1459
 
1460
-        return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions);
1460
+        return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions);
1461 1461
     }
1462 1462
 
1463 1463
     /**
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
                             $columnName           = $joinColumn->getColumnName();
1553 1553
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
1554 1554
 
1555
-                            if (! $joinColumn->getType()) {
1555
+                            if ( ! $joinColumn->getType()) {
1556 1556
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
1557 1557
                             }
1558 1558
 
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
 
1592 1592
         $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName());
1593 1593
 
1594
-        return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias;
1594
+        return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias;
1595 1595
     }
1596 1596
 
1597 1597
     /**
@@ -1605,14 +1605,14 @@  discard block
 block discarded – undo
1605 1605
     protected function getSQLTableAlias($tableName, $assocName = '')
1606 1606
     {
1607 1607
         if ($tableName) {
1608
-            $tableName .= '#' . $assocName;
1608
+            $tableName .= '#'.$assocName;
1609 1609
         }
1610 1610
 
1611 1611
         if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) {
1612 1612
             return $this->currentPersisterContext->sqlTableAliases[$tableName];
1613 1613
         }
1614 1614
 
1615
-        $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++;
1615
+        $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++;
1616 1616
 
1617 1617
         $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias;
1618 1618
 
@@ -1638,7 +1638,7 @@  discard block
 block discarded – undo
1638 1638
         }
1639 1639
 
1640 1640
         $lock  = $this->getLockTablesSql($lockMode);
1641
-        $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1641
+        $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' ';
1642 1642
         $sql   = 'SELECT 1 '
1643 1643
              . $lock
1644 1644
              . $where
@@ -1661,7 +1661,7 @@  discard block
 block discarded – undo
1661 1661
         $tableName = $this->class->table->getQuotedQualifiedName($this->platform);
1662 1662
 
1663 1663
         return $this->platform->appendLockHint(
1664
-            'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()),
1664
+            'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()),
1665 1665
             $lockMode
1666 1666
         );
1667 1667
     }
@@ -1711,19 +1711,19 @@  discard block
 block discarded – undo
1711 1711
 
1712 1712
             if ($comparison !== null) {
1713 1713
                 // special case null value handling
1714
-                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) {
1715
-                    $selectedColumns[] = $column . ' IS NULL';
1714
+                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) {
1715
+                    $selectedColumns[] = $column.' IS NULL';
1716 1716
 
1717 1717
                     continue;
1718 1718
                 }
1719 1719
 
1720 1720
                 if ($comparison === Comparison::NEQ && $value === null) {
1721
-                    $selectedColumns[] = $column . ' IS NOT NULL';
1721
+                    $selectedColumns[] = $column.' IS NOT NULL';
1722 1722
 
1723 1723
                     continue;
1724 1724
                 }
1725 1725
 
1726
-                $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder);
1726
+                $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder);
1727 1727
 
1728 1728
                 continue;
1729 1729
             }
@@ -1771,7 +1771,7 @@  discard block
 block discarded – undo
1771 1771
             $tableAlias = $this->getSQLTableAlias($property->getTableName());
1772 1772
             $columnName = $this->platform->quoteIdentifier($property->getColumnName());
1773 1773
 
1774
-            return [$tableAlias . '.' . $columnName];
1774
+            return [$tableAlias.'.'.$columnName];
1775 1775
         }
1776 1776
 
1777 1777
         if ($property instanceof AssociationMetadata) {
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
 
1781 1781
             // Many-To-Many requires join table check for joinColumn
1782 1782
             if ($owningAssociation instanceof ManyToManyAssociationMetadata) {
1783
-                if (! $owningAssociation->isOwningSide()) {
1783
+                if ( ! $owningAssociation->isOwningSide()) {
1784 1784
                     $owningAssociation = $association;
1785 1785
                 }
1786 1786
 
@@ -1794,17 +1794,17 @@  discard block
 block discarded – undo
1794 1794
                 foreach ($joinColumns as $joinColumn) {
1795 1795
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1796 1796
 
1797
-                    $columns[] = $joinTableName . '.' . $quotedColumnName;
1797
+                    $columns[] = $joinTableName.'.'.$quotedColumnName;
1798 1798
                 }
1799 1799
             } else {
1800
-                if (! $owningAssociation->isOwningSide()) {
1800
+                if ( ! $owningAssociation->isOwningSide()) {
1801 1801
                     throw InvalidFindByCall::fromInverseSideUsage(
1802 1802
                         $this->class->getClassName(),
1803 1803
                         $field
1804 1804
                     );
1805 1805
                 }
1806 1806
 
1807
-                $class      = $this->class->isInheritedProperty($field)
1807
+                $class = $this->class->isInheritedProperty($field)
1808 1808
                     ? $owningAssociation->getDeclaringClass()
1809 1809
                     : $this->class
1810 1810
                 ;
@@ -1813,7 +1813,7 @@  discard block
 block discarded – undo
1813 1813
                 foreach ($owningAssociation->getJoinColumns() as $joinColumn) {
1814 1814
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1815 1815
 
1816
-                    $columns[] = $tableAlias . '.' . $quotedColumnName;
1816
+                    $columns[] = $tableAlias.'.'.$quotedColumnName;
1817 1817
                 }
1818 1818
             }
1819 1819
 
@@ -1921,7 +1921,7 @@  discard block
 block discarded – undo
1921 1921
                 $value = $value[$targetClass->identifier[0]];
1922 1922
             }
1923 1923
 
1924
-            $criteria[$tableAlias . '.' . $quotedColumnName] = $value;
1924
+            $criteria[$tableAlias.'.'.$quotedColumnName] = $value;
1925 1925
             $parameters[]                                    = [
1926 1926
                 'value' => $value,
1927 1927
                 'field' => $fieldName,
@@ -2007,7 +2007,7 @@  discard block
 block discarded – undo
2007 2007
             case ($property instanceof AssociationMetadata):
2008 2008
                 $class = $this->em->getClassMetadata($property->getTargetEntity());
2009 2009
 
2010
-                if (! $property->isOwningSide()) {
2010
+                if ( ! $property->isOwningSide()) {
2011 2011
                     $property = $class->getProperty($property->getMappedBy());
2012 2012
                     $class    = $this->em->getClassMetadata($property->getTargetEntity());
2013 2013
                 }
@@ -2021,7 +2021,7 @@  discard block
 block discarded – undo
2021 2021
                     /** @var JoinColumnMetadata $joinColumn */
2022 2022
                     $referencedColumnName = $joinColumn->getReferencedColumnName();
2023 2023
 
2024
-                    if (! $joinColumn->getType()) {
2024
+                    if ( ! $joinColumn->getType()) {
2025 2025
                         $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
2026 2026
                     }
2027 2027
 
@@ -2036,7 +2036,7 @@  discard block
 block discarded – undo
2036 2036
         }
2037 2037
 
2038 2038
         if (is_array($value)) {
2039
-            return array_map(function ($type) {
2039
+            return array_map(function($type) {
2040 2040
                 return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET;
2041 2041
             }, $types);
2042 2042
         }
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
      */
2094 2094
     private function getIndividualValue($value)
2095 2095
     {
2096
-        if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
2096
+        if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
2097 2097
             return $value;
2098 2098
         }
2099 2099
 
@@ -2107,7 +2107,7 @@  discard block
 block discarded – undo
2107 2107
     {
2108 2108
         $criteria = $this->getIdentifier($entity);
2109 2109
 
2110
-        if (! $criteria) {
2110
+        if ( ! $criteria) {
2111 2111
             return false;
2112 2112
         }
2113 2113
 
@@ -2115,12 +2115,12 @@  discard block
 block discarded – undo
2115 2115
 
2116 2116
         $sql = 'SELECT 1 '
2117 2117
              . $this->getLockTablesSql(null)
2118
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
2118
+             . ' WHERE '.$this->getSelectConditionSQL($criteria);
2119 2119
 
2120 2120
         list($params, $types) = $this->expandParameters($criteria);
2121 2121
 
2122 2122
         if ($extraConditions !== null) {
2123
-            $sql                                 .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions);
2123
+            $sql                                 .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions);
2124 2124
             list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions);
2125 2125
 
2126 2126
             $params = array_merge($params, $criteriaParams);
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
         $filterSql = $this->generateFilterConditionSQL($this->class, $alias);
2131 2131
 
2132 2132
         if ($filterSql) {
2133
-            $sql .= ' AND ' . $filterSql;
2133
+            $sql .= ' AND '.$filterSql;
2134 2134
         }
2135 2135
 
2136 2136
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
@@ -2143,13 +2143,13 @@  discard block
 block discarded – undo
2143 2143
      */
2144 2144
     protected function getJoinSQLForAssociation(AssociationMetadata $association)
2145 2145
     {
2146
-        if (! $association->isOwningSide()) {
2146
+        if ( ! $association->isOwningSide()) {
2147 2147
             return 'LEFT JOIN';
2148 2148
         }
2149 2149
 
2150 2150
         // if one of the join columns is nullable, return left join
2151 2151
         foreach ($association->getJoinColumns() as $joinColumn) {
2152
-            if (! $joinColumn->isNullable()) {
2152
+            if ( ! $joinColumn->isNullable()) {
2153 2153
                 continue;
2154 2154
             }
2155 2155
 
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
      */
2167 2167
     public function getSQLColumnAlias()
2168 2168
     {
2169
-        return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++);
2169
+        return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++);
2170 2170
     }
2171 2171
 
2172 2172
     /**
@@ -2185,13 +2185,13 @@  discard block
 block discarded – undo
2185 2185
             $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias);
2186 2186
 
2187 2187
             if ($filterExpr !== '') {
2188
-                $filterClauses[] = '(' . $filterExpr . ')';
2188
+                $filterClauses[] = '('.$filterExpr.')';
2189 2189
             }
2190 2190
         }
2191 2191
 
2192 2192
         $sql = implode(' AND ', $filterClauses);
2193 2193
 
2194
-        return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL"
2194
+        return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL"
2195 2195
     }
2196 2196
 
2197 2197
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Configuration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     public function newDefaultAnnotationDriver(array $paths = []) : AnnotationDriver
205 205
     {
206
-        AnnotationRegistry::registerFile(__DIR__ . '/Annotation/DoctrineAnnotations.php');
206
+        AnnotationRegistry::registerFile(__DIR__.'/Annotation/DoctrineAnnotations.php');
207 207
 
208 208
         $reader = new CachedReader(new AnnotationReader(), new ArrayCache());
209 209
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      */
284 284
     public function getNamedNativeQuery(string $queryName) : array
285 285
     {
286
-        if (! isset($this->namedNativeQueries[$queryName])) {
286
+        if ( ! isset($this->namedNativeQueries[$queryName])) {
287 287
             throw NamedNativeQueryNotFound::fromName($queryName);
288 288
         }
289 289
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     {
302 302
         $queryCacheImpl = $this->getQueryCacheImpl();
303 303
 
304
-        if (! $queryCacheImpl) {
304
+        if ( ! $queryCacheImpl) {
305 305
             throw QueryCacheNotConfigured::create();
306 306
         }
307 307
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 
312 312
         $metadataCacheImpl = $this->getMetadataCacheImpl();
313 313
 
314
-        if (! $metadataCacheImpl) {
314
+        if ( ! $metadataCacheImpl) {
315 315
             throw MetadataCacheNotConfigured::create();
316 316
         }
317 317
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
     {
520 520
         $reflectionClass = new \ReflectionClass($repositoryClassName);
521 521
 
522
-        if (! $reflectionClass->implementsInterface(ObjectRepository::class)) {
522
+        if ( ! $reflectionClass->implementsInterface(ObjectRepository::class)) {
523 523
             throw InvalidEntityRepository::fromClassName($repositoryClassName);
524 524
         }
525 525
 
Please login to merge, or discard this patch.