Failed Conditions
Pull Request — master (#6743)
by Grégoire
14:59
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/UnitOfWork.php 1 patch
Spacing   +54 added lines, -54 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
 
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
         $this->computeChangeSets();
323 323
 
324
-        if (! ($this->entityInsertions ||
324
+        if ( ! ($this->entityInsertions ||
325 325
                 $this->entityDeletions ||
326 326
                 $this->entityUpdates ||
327 327
                 $this->collectionUpdates ||
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
             // Entity deletions come last and need to be in reverse commit order
381 381
             if ($this->entityDeletions) {
382 382
                 foreach (array_reverse($commitOrder) as $committedEntityName) {
383
-                    if (! $this->entityDeletions) {
383
+                    if ( ! $this->entityDeletions) {
384 384
                         break; // just a performance optimisation
385 385
                     }
386 386
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
         $oid  = spl_object_id($entity);
464 464
         $data = [];
465 465
 
466
-        if (! isset($this->entityChangeSets[$oid])) {
466
+        if ( ! isset($this->entityChangeSets[$oid])) {
467 467
             return $data;
468 468
         }
469 469
 
@@ -544,12 +544,12 @@  discard block
 block discarded – undo
544 544
                     || ! $class->getProperty($name) instanceof FieldMetadata
545 545
                     || ! $class->getProperty($name)->hasValueGenerator()
546 546
                     || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY
547
-                ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
547
+                ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
548 548
                 $actualData[$name] = $value;
549 549
             }
550 550
         }
551 551
 
552
-        if (! isset($this->originalEntityData[$oid])) {
552
+        if ( ! isset($this->originalEntityData[$oid])) {
553 553
             // Entity is either NEW or MANAGED but not yet fully persisted (only has an id).
554 554
             // These result in an INSERT.
555 555
             $this->originalEntityData[$oid] = $actualData;
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 
577 577
             foreach ($actualData as $propName => $actualValue) {
578 578
                 // skip field, its a partially omitted one!
579
-                if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) {
579
+                if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) {
580 580
                     continue;
581 581
                 }
582 582
 
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
                     if ($owner === null) { // cloned
599 599
                         $actualValue->setOwner($entity, $property);
600 600
                     } elseif ($owner !== $entity) { // no clone, we have to fix
601
-                        if (! $actualValue->isInitialized()) {
601
+                        if ( ! $actualValue->isInitialized()) {
602 602
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
603 603
                         }
604 604
 
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
                         // Check if original value exists
637 637
                         if ($orgValue instanceof PersistentCollection) {
638 638
                             // A PersistentCollection was de-referenced, so delete it.
639
-                            if (! $this->isCollectionScheduledForDeletion($orgValue)) {
639
+                            if ( ! $this->isCollectionScheduledForDeletion($orgValue)) {
640 640
                                 $this->scheduleCollectionDeletion($orgValue);
641 641
 
642 642
                                 $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 
660 660
         // Look for changes in associations of the entity
661 661
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
662
-            if (! $property instanceof AssociationMetadata) {
662
+            if ( ! $property instanceof AssociationMetadata) {
663 663
                 continue;
664 664
             }
665 665
 
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
                 // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here.
727 727
                 $oid = spl_object_id($entity);
728 728
 
729
-                if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) {
729
+                if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) {
730 730
                     $this->computeChangeSet($class, $entity);
731 731
                 }
732 732
             }
@@ -763,13 +763,13 @@  discard block
 block discarded – undo
763 763
         $targetClass    = $this->em->getClassMetadata($targetEntity);
764 764
 
765 765
         foreach ($unwrappedValue as $key => $entry) {
766
-            if (! ($entry instanceof $targetEntity)) {
766
+            if ( ! ($entry instanceof $targetEntity)) {
767 767
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry);
768 768
             }
769 769
 
770 770
             $state = $this->getEntityState($entry, self::STATE_NEW);
771 771
 
772
-            if (! ($entry instanceof $targetEntity)) {
772
+            if ( ! ($entry instanceof $targetEntity)) {
773 773
                 throw UnexpectedAssociationValue::create(
774 774
                     $association->getSourceEntity(),
775 775
                     $association->getName(),
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 
781 781
             switch ($state) {
782 782
                 case self::STATE_NEW:
783
-                    if (! in_array('persist', $association->getCascade(), true)) {
783
+                    if ( ! in_array('persist', $association->getCascade(), true)) {
784 784
                         $this->nonCascadedNewDetectedEntities[\spl_object_id($entry)] = [$association, $entry];
785 785
 
786 786
                         break;
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
         $persister      = $this->getEntityPersister($class->getClassName());
830 830
         $generationPlan->executeImmediate($this->em, $entity);
831 831
 
832
-        if (! $generationPlan->containsDeferred()) {
832
+        if ( ! $generationPlan->containsDeferred()) {
833 833
             $id                            = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity));
834 834
             $this->entityIdentifiers[$oid] = $id;
835 835
         }
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
     {
861 861
         $oid = spl_object_id($entity);
862 862
 
863
-        if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
863
+        if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
864 864
             throw ORMInvalidArgumentException::entityNotManaged($entity);
865 865
         }
866 866
 
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
                     break;
883 883
 
884 884
                 case ($property instanceof FieldMetadata):
885
-                    if (! $property->isPrimaryKey()
885
+                    if ( ! $property->isPrimaryKey()
886 886
                         || ! $property->getValueGenerator()
887 887
                         || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) {
888 888
                         $actualData[$name] = $property->getValue($entity);
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
             }
897 897
         }
898 898
 
899
-        if (! isset($this->originalEntityData[$oid])) {
899
+        if ( ! isset($this->originalEntityData[$oid])) {
900 900
             throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.');
901 901
         }
902 902
 
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
         if ($changeSet) {
915 915
             if (isset($this->entityChangeSets[$oid])) {
916 916
                 $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet);
917
-            } elseif (! isset($this->entityInsertions[$oid])) {
917
+            } elseif ( ! isset($this->entityInsertions[$oid])) {
918 918
                 $this->entityChangeSets[$oid] = $changeSet;
919 919
                 $this->entityUpdates[$oid]    = $entity;
920 920
             }
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
                 $this->recomputeSingleEntityChangeSet($class, $entity);
985 985
             }
986 986
 
987
-            if (! empty($this->entityChangeSets[$oid])) {
987
+            if ( ! empty($this->entityChangeSets[$oid])) {
988 988
 //                echo 'Update: ';
989 989
 //                \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3);
990 990
 
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
             // Entity with this $oid after deletion treated as NEW, even if the $oid
1028 1028
             // is obtained by a new entity because the old one went out of scope.
1029 1029
             //$this->entityStates[$oid] = self::STATE_NEW;
1030
-            if (! $class->isIdentifierComposite()) {
1030
+            if ( ! $class->isIdentifierComposite()) {
1031 1031
                 $property = $class->getProperty($class->getSingleIdentifierFieldName());
1032 1032
 
1033 1033
                 if ($property instanceof FieldMetadata && $property->hasValueGenerator()) {
@@ -1074,13 +1074,13 @@  discard block
 block discarded – undo
1074 1074
         // Calculate dependencies for new nodes
1075 1075
         while ($class = array_pop($newNodes)) {
1076 1076
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
1077
-                if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1077
+                if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1078 1078
                     continue;
1079 1079
                 }
1080 1080
 
1081 1081
                 $targetClass = $this->em->getClassMetadata($property->getTargetEntity());
1082 1082
 
1083
-                if (! $calc->hasNode($targetClass->getClassName())) {
1083
+                if ( ! $calc->hasNode($targetClass->getClassName())) {
1084 1084
                     $calc->addNode($targetClass->getClassName(), $targetClass);
1085 1085
 
1086 1086
                     $newNodes[] = $targetClass;
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 
1089 1089
                 $weight = ! array_filter(
1090 1090
                     $property->getJoinColumns(),
1091
-                    function (JoinColumnMetadata $joinColumn) {
1091
+                    function(JoinColumnMetadata $joinColumn) {
1092 1092
                         return $joinColumn->isNullable();
1093 1093
                     }
1094 1094
                 );
@@ -1096,14 +1096,14 @@  discard block
 block discarded – undo
1096 1096
                 $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight);
1097 1097
 
1098 1098
                 // If the target class has mapped subclasses, these share the same dependency.
1099
-                if (! $targetClass->getSubClasses()) {
1099
+                if ( ! $targetClass->getSubClasses()) {
1100 1100
                     continue;
1101 1101
                 }
1102 1102
 
1103 1103
                 foreach ($targetClass->getSubClasses() as $subClassName) {
1104 1104
                     $targetSubClass = $this->em->getClassMetadata($subClassName);
1105 1105
 
1106
-                    if (! $calc->hasNode($subClassName)) {
1106
+                    if ( ! $calc->hasNode($subClassName)) {
1107 1107
                         $calc->addNode($targetSubClass->getClassName(), $targetSubClass);
1108 1108
 
1109 1109
                         $newNodes[] = $targetSubClass;
@@ -1179,7 +1179,7 @@  discard block
 block discarded – undo
1179 1179
     {
1180 1180
         $oid = spl_object_id($entity);
1181 1181
 
1182
-        if (! isset($this->entityIdentifiers[$oid])) {
1182
+        if ( ! isset($this->entityIdentifiers[$oid])) {
1183 1183
             throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update');
1184 1184
         }
1185 1185
 
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
             throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update');
1188 1188
         }
1189 1189
 
1190
-        if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
1190
+        if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
1191 1191
             $this->entityUpdates[$oid] = $entity;
1192 1192
         }
1193 1193
     }
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
             return; // entity has not been persisted yet, so nothing more to do.
1264 1264
         }
1265 1265
 
1266
-        if (! $this->isInIdentityMap($entity)) {
1266
+        if ( ! $this->isInIdentityMap($entity)) {
1267 1267
             return;
1268 1268
         }
1269 1269
 
@@ -1271,7 +1271,7 @@  discard block
 block discarded – undo
1271 1271
 
1272 1272
         unset($this->entityUpdates[$oid]);
1273 1273
 
1274
-        if (! isset($this->entityDeletions[$oid])) {
1274
+        if ( ! isset($this->entityDeletions[$oid])) {
1275 1275
             $this->entityDeletions[$oid] = $entity;
1276 1276
             $this->entityStates[$oid]    = self::STATE_REMOVED;
1277 1277
         }
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
         $persister = $this->getEntityPersister($class->getClassName());
1374 1374
         $id        = $persister->getIdentifier($entity);
1375 1375
 
1376
-        if (! $id) {
1376
+        if ( ! $id) {
1377 1377
             return self::STATE_NEW;
1378 1378
         }
1379 1379
 
@@ -1733,7 +1733,7 @@  discard block
 block discarded – undo
1733 1733
         $class = $this->em->getClassMetadata(get_class($entity));
1734 1734
 
1735 1735
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1736
-            if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) {
1736
+            if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) {
1737 1737
                 continue;
1738 1738
             }
1739 1739
 
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
         }
1781 1781
 
1782 1782
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1783
-            if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) {
1783
+            if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) {
1784 1784
                 continue;
1785 1785
             }
1786 1786
 
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
 
1797 1797
                 case ($relatedEntities instanceof Collection):
1798 1798
                 case (is_array($relatedEntities)):
1799
-                    if (! ($association instanceof ToManyAssociationMetadata)) {
1799
+                    if ( ! ($association instanceof ToManyAssociationMetadata)) {
1800 1800
                         throw ORMInvalidArgumentException::invalidAssociation(
1801 1801
                             $this->em->getClassMetadata($targetEntity),
1802 1802
                             $association,
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
                     break;
1812 1812
 
1813 1813
                 case ($relatedEntities !== null):
1814
-                    if (! $relatedEntities instanceof $targetEntity) {
1814
+                    if ( ! $relatedEntities instanceof $targetEntity) {
1815 1815
                         throw ORMInvalidArgumentException::invalidAssociation(
1816 1816
                             $this->em->getClassMetadata($targetEntity),
1817 1817
                             $association,
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
         $class             = $this->em->getClassMetadata(get_class($entity));
1841 1841
 
1842 1842
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1843
-            if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) {
1843
+            if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) {
1844 1844
                 continue;
1845 1845
             }
1846 1846
 
@@ -1899,7 +1899,7 @@  discard block
 block discarded – undo
1899 1899
 
1900 1900
         switch (true) {
1901 1901
             case $lockMode === LockMode::OPTIMISTIC:
1902
-                if (! $class->isVersioned()) {
1902
+                if ( ! $class->isVersioned()) {
1903 1903
                     throw OptimisticLockException::notVersioned($class->getClassName());
1904 1904
                 }
1905 1905
 
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
             case $lockMode === LockMode::NONE:
1923 1923
             case $lockMode === LockMode::PESSIMISTIC_READ:
1924 1924
             case $lockMode === LockMode::PESSIMISTIC_WRITE:
1925
-                if (! $this->em->getConnection()->isTransactionActive()) {
1925
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
1926 1926
                     throw TransactionRequiredException::transactionRequired();
1927 1927
                 }
1928 1928
 
@@ -2081,7 +2081,7 @@  discard block
 block discarded – undo
2081 2081
                     $entity->addPropertyChangedListener($this);
2082 2082
                 }
2083 2083
             } else {
2084
-                if (! isset($hints[Query::HINT_REFRESH])
2084
+                if ( ! isset($hints[Query::HINT_REFRESH])
2085 2085
                     || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) {
2086 2086
                     return $entity;
2087 2087
                 }
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
         }
2130 2130
 
2131 2131
         foreach ($class->getDeclaredPropertiesIterator() as $field => $association) {
2132
-            if (! ($association instanceof AssociationMetadata)) {
2132
+            if ( ! ($association instanceof AssociationMetadata)) {
2133 2133
                 continue;
2134 2134
             }
2135 2135
 
@@ -2178,7 +2178,7 @@  discard block
 block discarded – undo
2178 2178
                 continue;
2179 2179
             }
2180 2180
 
2181
-            if (! $association->isOwningSide()) {
2181
+            if ( ! $association->isOwningSide()) {
2182 2182
                 // use the given entity association
2183 2183
                 if (isset($data[$field]) && is_object($data[$field]) &&
2184 2184
                     isset($this->entityStates[spl_object_id($data[$field])])) {
@@ -2228,7 +2228,7 @@  discard block
 block discarded – undo
2228 2228
                 $associatedId[$targetField] = $joinColumnValue;
2229 2229
             }
2230 2230
 
2231
-            if (! $associatedId) {
2231
+            if ( ! $associatedId) {
2232 2232
                 // Foreign key is NULL
2233 2233
                 $association->setValue($entity, null);
2234 2234
                 $this->originalEntityData[$oid][$field] = null;
@@ -2237,7 +2237,7 @@  discard block
 block discarded – undo
2237 2237
             }
2238 2238
 
2239 2239
             // @todo guilhermeblanco Can we remove the need of this somehow?
2240
-            if (! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2240
+            if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2241 2241
                 $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode();
2242 2242
             }
2243 2243
 
@@ -2254,7 +2254,7 @@  discard block
 block discarded – undo
2254 2254
                     // If this is an uninitialized proxy, we are deferring eager loads,
2255 2255
                     // this association is marked as eager fetch, and its an uninitialized proxy (wtf!)
2256 2256
                     // then we can append this entity for eager loading!
2257
-                    if (! $targetClass->isIdentifierComposite() &&
2257
+                    if ( ! $targetClass->isIdentifierComposite() &&
2258 2258
                         $newValue instanceof GhostObjectInterface &&
2259 2259
                         isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2260 2260
                         $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER &&
@@ -2337,7 +2337,7 @@  discard block
 block discarded – undo
2337 2337
 
2338 2338
     public function triggerEagerLoads()
2339 2339
     {
2340
-        if (! $this->eagerLoadingEntities) {
2340
+        if ( ! $this->eagerLoadingEntities) {
2341 2341
             return;
2342 2342
         }
2343 2343
 
@@ -2346,7 +2346,7 @@  discard block
 block discarded – undo
2346 2346
         $this->eagerLoadingEntities = [];
2347 2347
 
2348 2348
         foreach ($eagerLoadingEntities as $entityName => $ids) {
2349
-            if (! $ids) {
2349
+            if ( ! $ids) {
2350 2350
                 continue;
2351 2351
             }
2352 2352
 
@@ -2644,7 +2644,7 @@  discard block
 block discarded – undo
2644 2644
     {
2645 2645
         $class = $this->em->getClassMetadata(get_class($entity));
2646 2646
 
2647
-        if (! $class->getProperty($propertyName)) {
2647
+        if ( ! $class->getProperty($propertyName)) {
2648 2648
             return; // ignore non-persistent fields
2649 2649
         }
2650 2650
 
@@ -2653,7 +2653,7 @@  discard block
 block discarded – undo
2653 2653
         // Update changeset and mark entity for synchronization
2654 2654
         $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue];
2655 2655
 
2656
-        if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) {
2656
+        if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) {
2657 2657
             $this->scheduleForSynchronization($entity);
2658 2658
         }
2659 2659
     }
@@ -2735,7 +2735,7 @@  discard block
 block discarded – undo
2735 2735
      */
2736 2736
     private static function objToStr($obj)
2737 2737
     {
2738
-        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj);
2738
+        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj);
2739 2739
     }
2740 2740
 
2741 2741
     /**
@@ -2750,7 +2750,7 @@  discard block
 block discarded – undo
2750 2750
      */
2751 2751
     public function markReadOnly($object)
2752 2752
     {
2753
-        if (! is_object($object) || ! $this->isInIdentityMap($object)) {
2753
+        if ( ! is_object($object) || ! $this->isInIdentityMap($object)) {
2754 2754
             throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object);
2755 2755
         }
2756 2756
 
@@ -2768,7 +2768,7 @@  discard block
 block discarded – undo
2768 2768
      */
2769 2769
     public function isReadOnly($object)
2770 2770
     {
2771
-        if (! is_object($object)) {
2771
+        if ( ! is_object($object)) {
2772 2772
             throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object);
2773 2773
         }
2774 2774
 
@@ -2780,7 +2780,7 @@  discard block
 block discarded – undo
2780 2780
      */
2781 2781
     private function afterTransactionComplete()
2782 2782
     {
2783
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
2783
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
2784 2784
             $persister->afterTransactionComplete();
2785 2785
         });
2786 2786
     }
@@ -2790,7 +2790,7 @@  discard block
 block discarded – undo
2790 2790
      */
2791 2791
     private function afterTransactionRolledBack()
2792 2792
     {
2793
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
2793
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
2794 2794
             $persister->afterTransactionRolledBack();
2795 2795
         });
2796 2796
     }
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
      */
2801 2801
     private function performCallbackOnCachedPersister(callable $callback)
2802 2802
     {
2803
-        if (! $this->hasCache) {
2803
+        if ( ! $this->hasCache) {
2804 2804
             return;
2805 2805
         }
2806 2806
 
Please login to merge, or discard this patch.