Failed Conditions
Pull Request — master (#6743)
by Grégoire
20:26
created
lib/Doctrine/ORM/Exception/ConfigurationException.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\Exception;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Exception/SchemaToolException.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\Exception;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Exception/EntityManagerClosed.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\Exception;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Exception/RepositoryException.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\Exception;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Exception/UnrecognizedIdentifierFields.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\Exception;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Exception/ORMException.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\Exception;
6 6
 
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
 
@@ -298,16 +298,16 @@  discard block
 block discarded – undo
298 298
         $tableName      = $versionedClass->table->getQuotedQualifiedName($this->platform);
299 299
         $columnName     = $this->platform->quoteIdentifier($versionProperty->getColumnName());
300 300
         $identifier     = array_map(
301
-            function ($columnName) {
301
+            function($columnName) {
302 302
                 return $this->platform->quoteIdentifier($columnName);
303 303
             },
304 304
             array_keys($versionedClass->getIdentifierColumns($this->em))
305 305
         );
306 306
 
307 307
         // FIXME: Order with composite keys might not be correct
308
-        $sql = 'SELECT ' . $columnName
309
-             . ' FROM ' . $tableName
310
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
308
+        $sql = 'SELECT '.$columnName
309
+             . ' FROM '.$tableName
310
+             . ' WHERE '.implode(' = ? AND ', $identifier).' = ?';
311 311
 
312 312
         $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id);
313 313
         $versionType = $versionProperty->getType();
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
         $tableName  = $this->class->getTableName();
347 347
         $updateData = $this->prepareUpdateData($entity);
348 348
 
349
-        if (! isset($updateData[$tableName])) {
349
+        if ( ! isset($updateData[$tableName])) {
350 350
             return;
351 351
         }
352 352
 
353 353
         $data = $updateData[$tableName];
354 354
 
355
-        if (! $data) {
355
+        if ( ! $data) {
356 356
             return;
357 357
         }
358 358
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 
406 406
             if ($value !== null) {
407 407
                 // @todo guilhermeblanco Make sure we do not have flat association values.
408
-                if (! is_array($value)) {
408
+                if ( ! is_array($value)) {
409 409
                     $value = [$targetClass->identifier[0] => $value];
410 410
                 }
411 411
 
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
419 419
                 $targetField          = $targetClass->fieldNames[$referencedColumnName];
420 420
 
421
-                if (! $joinColumn->getType()) {
421
+                if ( ! $joinColumn->getType()) {
422 422
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
423 423
                 }
424 424
 
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                         $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
485 485
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
486 486
 
487
-                        if (! $joinColumn->getType()) {
487
+                        if ( ! $joinColumn->getType()) {
488 488
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
489 489
                         }
490 490
 
@@ -511,18 +511,18 @@  discard block
 block discarded – undo
511 511
                 case Type::SMALLINT:
512 512
                 case Type::INTEGER:
513 513
                 case Type::BIGINT:
514
-                    $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1';
514
+                    $set[] = $versionColumnName.' = '.$versionColumnName.' + 1';
515 515
                     break;
516 516
 
517 517
                 case Type::DATETIME:
518
-                    $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP';
518
+                    $set[] = $versionColumnName.' = CURRENT_TIMESTAMP';
519 519
                     break;
520 520
             }
521 521
         }
522 522
 
523
-        $sql = 'UPDATE ' . $quotedTableName
524
-             . ' SET ' . implode(', ', $set)
525
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
523
+        $sql = 'UPDATE '.$quotedTableName
524
+             . ' SET '.implode(', ', $set)
525
+             . ' WHERE '.implode(' = ? AND ', $where).' = ?';
526 526
 
527 527
         $result = $this->conn->executeUpdate($sql, $params, $types);
528 528
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
     protected function deleteJoinTableRecords($identifier)
540 540
     {
541 541
         foreach ($this->class->getDeclaredPropertiesIterator() as $association) {
542
-            if (! ($association instanceof ManyToManyAssociationMetadata)) {
542
+            if ( ! ($association instanceof ManyToManyAssociationMetadata)) {
543 543
                 continue;
544 544
             }
545 545
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
             $otherKeys         = [];
552 552
             $keys              = [];
553 553
 
554
-            if (! $owningAssociation->isOwningSide()) {
554
+            if ( ! $owningAssociation->isOwningSide()) {
555 555
                 $class             = $this->em->getClassMetadata($association->getTargetEntity());
556 556
                 $owningAssociation = $class->getProperty($association->getMappedBy());
557 557
             }
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
             }
665 665
 
666 666
             // Only owning side of x-1 associations can have a FK column.
667
-            if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) {
667
+            if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) {
668 668
                 continue;
669 669
             }
670 670
 
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
                 /** @var JoinColumnMetadata $joinColumn */
685 685
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
686 686
 
687
-                if (! $joinColumn->getType()) {
687
+                if ( ! $joinColumn->getType()) {
688 688
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
689 689
                 }
690 690
 
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
         $propertyName = $this->class->fieldNames[$columnName];
713 713
         $property     = $this->class->getProperty($propertyName);
714 714
 
715
-        if (! $property) {
715
+        if ( ! $property) {
716 716
             return null;
717 717
         }
718 718
 
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
             /** @var JoinColumnMetadata $joinColumn */
732 732
             $referencedColumnName = $joinColumn->getReferencedColumnName();
733 733
 
734
-            if (! $joinColumn->getType()) {
734
+            if ( ! $joinColumn->getType()) {
735 735
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
736 736
             }
737 737
 
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
             $sourceKeyColumn = $joinColumn->getReferencedColumnName();
837 837
             $targetKeyColumn = $joinColumn->getColumnName();
838 838
 
839
-            if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) {
839
+            if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) {
840 840
                 throw MappingException::joinColumnMustPointToMappedField(
841 841
                     $sourceClass->getClassName(),
842 842
                     $sourceKeyColumn
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
         $criteria    = [];
1064 1064
         $parameters  = [];
1065 1065
 
1066
-        if (! $association->isOwningSide()) {
1066
+        if ( ! $association->isOwningSide()) {
1067 1067
             $class       = $this->em->getClassMetadata($association->getTargetEntity());
1068 1068
             $owningAssoc = $class->getProperty($association->getMappedBy());
1069 1069
         }
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
                 $value = $value[$targetClass->identifier[0]];
1093 1093
             }
1094 1094
 
1095
-            $criteria[$joinTableName . '.' . $quotedColumnName] = $value;
1095
+            $criteria[$joinTableName.'.'.$quotedColumnName] = $value;
1096 1096
             $parameters[]                                       = [
1097 1097
                 'value' => $value,
1098 1098
                 'field' => $fieldName,
@@ -1142,11 +1142,11 @@  discard block
 block discarded – undo
1142 1142
 
1143 1143
         switch ($lockMode) {
1144 1144
             case LockMode::PESSIMISTIC_READ:
1145
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
1145
+                $lockSql = ' '.$this->platform->getReadLockSQL();
1146 1146
                 break;
1147 1147
 
1148 1148
             case LockMode::PESSIMISTIC_WRITE:
1149
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
1149
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
1150 1150
                 break;
1151 1151
         }
1152 1152
 
@@ -1157,14 +1157,14 @@  discard block
 block discarded – undo
1157 1157
 
1158 1158
         if ($filterSql !== '') {
1159 1159
             $conditionSql = $conditionSql
1160
-                ? $conditionSql . ' AND ' . $filterSql
1160
+                ? $conditionSql.' AND '.$filterSql
1161 1161
                 : $filterSql;
1162 1162
         }
1163 1163
 
1164
-        $select = 'SELECT ' . $columnList;
1165
-        $from   = ' FROM ' . $tableName . ' ' . $tableAlias;
1166
-        $join   = $this->currentPersisterContext->selectJoinSql . $joinSql;
1167
-        $where  = ($conditionSql ? ' WHERE ' . $conditionSql : '');
1164
+        $select = 'SELECT '.$columnList;
1165
+        $from   = ' FROM '.$tableName.' '.$tableAlias;
1166
+        $join   = $this->currentPersisterContext->selectJoinSql.$joinSql;
1167
+        $where  = ($conditionSql ? ' WHERE '.$conditionSql : '');
1168 1168
         $lock   = $this->platform->appendLockHint($from, $lockMode);
1169 1169
         $query  = $select
1170 1170
             . $lock
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
             . $where
1173 1173
             . $orderBySql;
1174 1174
 
1175
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
1175
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
1176 1176
     }
1177 1177
 
1178 1178
     /**
@@ -1191,13 +1191,13 @@  discard block
 block discarded – undo
1191 1191
 
1192 1192
         if ($filterSql !== '') {
1193 1193
             $conditionSql = $conditionSql
1194
-                ? $conditionSql . ' AND ' . $filterSql
1194
+                ? $conditionSql.' AND '.$filterSql
1195 1195
                 : $filterSql;
1196 1196
         }
1197 1197
 
1198 1198
         $sql = 'SELECT COUNT(*) '
1199
-            . 'FROM ' . $tableName . ' ' . $tableAlias
1200
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
1199
+            . 'FROM '.$tableName.' '.$tableAlias
1200
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
1201 1201
 
1202 1202
         return $sql;
1203 1203
     }
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
      */
1215 1215
     final protected function getOrderBySQL(array $orderBy, $baseTableAlias)
1216 1216
     {
1217
-        if (! $orderBy) {
1217
+        if ( ! $orderBy) {
1218 1218
             return '';
1219 1219
         }
1220 1220
 
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
         foreach ($orderBy as $fieldName => $orientation) {
1224 1224
             $orientation = strtoupper(trim($orientation));
1225 1225
 
1226
-            if (! in_array($orientation, ['ASC', 'DESC'], true)) {
1226
+            if ( ! in_array($orientation, ['ASC', 'DESC'], true)) {
1227 1227
                 throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName);
1228 1228
             }
1229 1229
 
@@ -1233,11 +1233,11 @@  discard block
 block discarded – undo
1233 1233
                 $tableAlias = $this->getSQLTableAlias($property->getTableName());
1234 1234
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
1235 1235
 
1236
-                $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation;
1236
+                $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation;
1237 1237
 
1238 1238
                 continue;
1239 1239
             } elseif ($property instanceof AssociationMetadata) {
1240
-                if (! $property->isOwningSide()) {
1240
+                if ( ! $property->isOwningSide()) {
1241 1241
                     throw InvalidFindByCall::fromInverseSideUsage(
1242 1242
                         $this->class->getClassName(),
1243 1243
                         $fieldName
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
                     /** @var JoinColumnMetadata $joinColumn */
1254 1254
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1255 1255
 
1256
-                    $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation;
1256
+                    $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation;
1257 1257
                 }
1258 1258
 
1259 1259
                 continue;
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
             throw UnrecognizedField::byName($fieldName);
1263 1263
         }
1264 1264
 
1265
-        return ' ORDER BY ' . implode(', ', $orderByList);
1265
+        return ' ORDER BY '.implode(', ', $orderByList);
1266 1266
     }
1267 1267
 
1268 1268
     /**
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
                     $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide();
1305 1305
                     $isAssocFromOneEager     = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER;
1306 1306
 
1307
-                    if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) {
1307
+                    if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) {
1308 1308
                         break;
1309 1309
                     }
1310 1310
 
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
                         break; // now this is why you shouldn't use inheritance
1320 1320
                     }
1321 1321
 
1322
-                    $assocAlias = 'e' . ($eagerAliasCounter++);
1322
+                    $assocAlias = 'e'.($eagerAliasCounter++);
1323 1323
 
1324 1324
                     $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName);
1325 1325
 
@@ -1347,14 +1347,14 @@  discard block
 block discarded – undo
1347 1347
                         $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy());
1348 1348
                     }
1349 1349
 
1350
-                    if (! $property->isOwningSide()) {
1350
+                    if ( ! $property->isOwningSide()) {
1351 1351
                         $owningAssociation = $eagerEntity->getProperty($property->getMappedBy());
1352 1352
                     }
1353 1353
 
1354 1354
                     $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias);
1355 1355
                     $joinTableName  = $eagerEntity->table->getQuotedQualifiedName($this->platform);
1356 1356
 
1357
-                    $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property);
1357
+                    $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property);
1358 1358
 
1359 1359
                     $sourceClass      = $this->em->getClassMetadata($owningAssociation->getSourceEntity());
1360 1360
                     $targetClass      = $this->em->getClassMetadata($owningAssociation->getTargetEntity());
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
                         $joinCondition[] = $filterSql;
1379 1379
                     }
1380 1380
 
1381
-                    $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON ';
1381
+                    $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON ';
1382 1382
                     $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition);
1383 1383
 
1384 1384
                     break;
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
      */
1401 1401
     protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r')
1402 1402
     {
1403
-        if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) {
1403
+        if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) {
1404 1404
             return '';
1405 1405
         }
1406 1406
 
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
             $referencedColumnName = $joinColumn->getReferencedColumnName();
1416 1416
             $resultColumnName     = $this->getSQLColumnAlias();
1417 1417
 
1418
-            if (! $joinColumn->getType()) {
1418
+            if ( ! $joinColumn->getType()) {
1419 1419
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
1420 1420
             }
1421 1421
 
@@ -1445,7 +1445,7 @@  discard block
 block discarded – undo
1445 1445
         $owningAssociation = $association;
1446 1446
         $sourceTableAlias  = $this->getSQLTableAlias($this->class->getTableName());
1447 1447
 
1448
-        if (! $association->isOwningSide()) {
1448
+        if ( ! $association->isOwningSide()) {
1449 1449
             $targetEntity      = $this->em->getClassMetadata($association->getTargetEntity());
1450 1450
             $owningAssociation = $targetEntity->getProperty($association->getMappedBy());
1451 1451
         }
@@ -1467,7 +1467,7 @@  discard block
 block discarded – undo
1467 1467
             );
1468 1468
         }
1469 1469
 
1470
-        return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions);
1470
+        return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions);
1471 1471
     }
1472 1472
 
1473 1473
     /**
@@ -1562,7 +1562,7 @@  discard block
 block discarded – undo
1562 1562
                             $columnName           = $joinColumn->getColumnName();
1563 1563
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
1564 1564
 
1565
-                            if (! $joinColumn->getType()) {
1565
+                            if ( ! $joinColumn->getType()) {
1566 1566
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
1567 1567
                             }
1568 1568
 
@@ -1601,7 +1601,7 @@  discard block
 block discarded – undo
1601 1601
 
1602 1602
         $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName());
1603 1603
 
1604
-        return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias;
1604
+        return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias;
1605 1605
     }
1606 1606
 
1607 1607
     /**
@@ -1615,14 +1615,14 @@  discard block
 block discarded – undo
1615 1615
     protected function getSQLTableAlias($tableName, $assocName = '')
1616 1616
     {
1617 1617
         if ($tableName) {
1618
-            $tableName .= '#' . $assocName;
1618
+            $tableName .= '#'.$assocName;
1619 1619
         }
1620 1620
 
1621 1621
         if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) {
1622 1622
             return $this->currentPersisterContext->sqlTableAliases[$tableName];
1623 1623
         }
1624 1624
 
1625
-        $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++;
1625
+        $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++;
1626 1626
 
1627 1627
         $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias;
1628 1628
 
@@ -1648,7 +1648,7 @@  discard block
 block discarded – undo
1648 1648
         }
1649 1649
 
1650 1650
         $lock  = $this->getLockTablesSql($lockMode);
1651
-        $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1651
+        $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' ';
1652 1652
         $sql   = 'SELECT 1 '
1653 1653
              . $lock
1654 1654
              . $where
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
         $tableName = $this->class->table->getQuotedQualifiedName($this->platform);
1672 1672
 
1673 1673
         return $this->platform->appendLockHint(
1674
-            'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()),
1674
+            'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()),
1675 1675
             $lockMode
1676 1676
         );
1677 1677
     }
@@ -1721,19 +1721,19 @@  discard block
 block discarded – undo
1721 1721
 
1722 1722
             if ($comparison !== null) {
1723 1723
                 // special case null value handling
1724
-                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) {
1725
-                    $selectedColumns[] = $column . ' IS NULL';
1724
+                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) {
1725
+                    $selectedColumns[] = $column.' IS NULL';
1726 1726
 
1727 1727
                     continue;
1728 1728
                 }
1729 1729
 
1730 1730
                 if ($comparison === Comparison::NEQ && $value === null) {
1731
-                    $selectedColumns[] = $column . ' IS NOT NULL';
1731
+                    $selectedColumns[] = $column.' IS NOT NULL';
1732 1732
 
1733 1733
                     continue;
1734 1734
                 }
1735 1735
 
1736
-                $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder);
1736
+                $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder);
1737 1737
 
1738 1738
                 continue;
1739 1739
             }
@@ -1781,7 +1781,7 @@  discard block
 block discarded – undo
1781 1781
             $tableAlias = $this->getSQLTableAlias($property->getTableName());
1782 1782
             $columnName = $this->platform->quoteIdentifier($property->getColumnName());
1783 1783
 
1784
-            return [$tableAlias . '.' . $columnName];
1784
+            return [$tableAlias.'.'.$columnName];
1785 1785
         }
1786 1786
 
1787 1787
         if ($property instanceof AssociationMetadata) {
@@ -1790,7 +1790,7 @@  discard block
 block discarded – undo
1790 1790
 
1791 1791
             // Many-To-Many requires join table check for joinColumn
1792 1792
             if ($owningAssociation instanceof ManyToManyAssociationMetadata) {
1793
-                if (! $owningAssociation->isOwningSide()) {
1793
+                if ( ! $owningAssociation->isOwningSide()) {
1794 1794
                     $owningAssociation = $association;
1795 1795
                 }
1796 1796
 
@@ -1804,17 +1804,17 @@  discard block
 block discarded – undo
1804 1804
                 foreach ($joinColumns as $joinColumn) {
1805 1805
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1806 1806
 
1807
-                    $columns[] = $joinTableName . '.' . $quotedColumnName;
1807
+                    $columns[] = $joinTableName.'.'.$quotedColumnName;
1808 1808
                 }
1809 1809
             } else {
1810
-                if (! $owningAssociation->isOwningSide()) {
1810
+                if ( ! $owningAssociation->isOwningSide()) {
1811 1811
                     throw InvalidFindByCall::fromInverseSideUsage(
1812 1812
                         $this->class->getClassName(),
1813 1813
                         $field
1814 1814
                     );
1815 1815
                 }
1816 1816
 
1817
-                $class      = $this->class->isInheritedProperty($field)
1817
+                $class = $this->class->isInheritedProperty($field)
1818 1818
                     ? $owningAssociation->getDeclaringClass()
1819 1819
                     : $this->class
1820 1820
                 ;
@@ -1823,7 +1823,7 @@  discard block
 block discarded – undo
1823 1823
                 foreach ($owningAssociation->getJoinColumns() as $joinColumn) {
1824 1824
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1825 1825
 
1826
-                    $columns[] = $tableAlias . '.' . $quotedColumnName;
1826
+                    $columns[] = $tableAlias.'.'.$quotedColumnName;
1827 1827
                 }
1828 1828
             }
1829 1829
 
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
                 $value = $value[$targetClass->identifier[0]];
1933 1933
             }
1934 1934
 
1935
-            $criteria[$tableAlias . '.' . $quotedColumnName] = $value;
1935
+            $criteria[$tableAlias.'.'.$quotedColumnName] = $value;
1936 1936
             $parameters[]                                    = [
1937 1937
                 'value' => $value,
1938 1938
                 'field' => $fieldName,
@@ -2017,7 +2017,7 @@  discard block
 block discarded – undo
2017 2017
             case ($property instanceof AssociationMetadata):
2018 2018
                 $class = $this->em->getClassMetadata($property->getTargetEntity());
2019 2019
 
2020
-                if (! $property->isOwningSide()) {
2020
+                if ( ! $property->isOwningSide()) {
2021 2021
                     $property = $class->getProperty($property->getMappedBy());
2022 2022
                     $class    = $this->em->getClassMetadata($property->getTargetEntity());
2023 2023
                 }
@@ -2031,7 +2031,7 @@  discard block
 block discarded – undo
2031 2031
                     /** @var JoinColumnMetadata $joinColumn */
2032 2032
                     $referencedColumnName = $joinColumn->getReferencedColumnName();
2033 2033
 
2034
-                    if (! $joinColumn->getType()) {
2034
+                    if ( ! $joinColumn->getType()) {
2035 2035
                         $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
2036 2036
                     }
2037 2037
 
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
         }
2047 2047
 
2048 2048
         if (is_array($value)) {
2049
-            return array_map(function ($type) {
2049
+            return array_map(function($type) {
2050 2050
                 return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET;
2051 2051
             }, $types);
2052 2052
         }
@@ -2103,7 +2103,7 @@  discard block
 block discarded – undo
2103 2103
      */
2104 2104
     private function getIndividualValue($value)
2105 2105
     {
2106
-        if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
2106
+        if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
2107 2107
             return $value;
2108 2108
         }
2109 2109
 
@@ -2117,7 +2117,7 @@  discard block
 block discarded – undo
2117 2117
     {
2118 2118
         $criteria = $this->getIdentifier($entity);
2119 2119
 
2120
-        if (! $criteria) {
2120
+        if ( ! $criteria) {
2121 2121
             return false;
2122 2122
         }
2123 2123
 
@@ -2125,12 +2125,12 @@  discard block
 block discarded – undo
2125 2125
 
2126 2126
         $sql = 'SELECT 1 '
2127 2127
              . $this->getLockTablesSql(null)
2128
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
2128
+             . ' WHERE '.$this->getSelectConditionSQL($criteria);
2129 2129
 
2130 2130
         list($params, $types) = $this->expandParameters($criteria);
2131 2131
 
2132 2132
         if ($extraConditions !== null) {
2133
-            $sql                                 .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions);
2133
+            $sql                                 .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions);
2134 2134
             list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions);
2135 2135
 
2136 2136
             $params = array_merge($params, $criteriaParams);
@@ -2140,7 +2140,7 @@  discard block
 block discarded – undo
2140 2140
         $filterSql = $this->generateFilterConditionSQL($this->class, $alias);
2141 2141
 
2142 2142
         if ($filterSql) {
2143
-            $sql .= ' AND ' . $filterSql;
2143
+            $sql .= ' AND '.$filterSql;
2144 2144
         }
2145 2145
 
2146 2146
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
@@ -2153,13 +2153,13 @@  discard block
 block discarded – undo
2153 2153
      */
2154 2154
     protected function getJoinSQLForAssociation(AssociationMetadata $association)
2155 2155
     {
2156
-        if (! $association->isOwningSide()) {
2156
+        if ( ! $association->isOwningSide()) {
2157 2157
             return 'LEFT JOIN';
2158 2158
         }
2159 2159
 
2160 2160
         // if one of the join columns is nullable, return left join
2161 2161
         foreach ($association->getJoinColumns() as $joinColumn) {
2162
-            if (! $joinColumn->isNullable()) {
2162
+            if ( ! $joinColumn->isNullable()) {
2163 2163
                 continue;
2164 2164
             }
2165 2165
 
@@ -2176,7 +2176,7 @@  discard block
 block discarded – undo
2176 2176
      */
2177 2177
     public function getSQLColumnAlias()
2178 2178
     {
2179
-        return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++);
2179
+        return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++);
2180 2180
     }
2181 2181
 
2182 2182
     /**
@@ -2195,13 +2195,13 @@  discard block
 block discarded – undo
2195 2195
             $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias);
2196 2196
 
2197 2197
             if ($filterExpr !== '') {
2198
-                $filterClauses[] = '(' . $filterExpr . ')';
2198
+                $filterClauses[] = '('.$filterExpr.')';
2199 2199
             }
2200 2200
         }
2201 2201
 
2202 2202
         $sql = implode(' AND ', $filterClauses);
2203 2203
 
2204
-        return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL"
2204
+        return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL"
2205 2205
     }
2206 2206
 
2207 2207
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +22 added lines, -22 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\Tools;
6 6
 
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
                     $pkColumns = [];
177 177
 
178 178
                     foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
179
-                        if (! ($property instanceof FieldMetadata)) {
179
+                        if ( ! ($property instanceof FieldMetadata)) {
180 180
                             continue;
181 181
                         }
182 182
 
183
-                        if (! $class->isInheritedProperty($fieldName)) {
183
+                        if ( ! $class->isInheritedProperty($fieldName)) {
184 184
                             $columnName = $this->platform->quoteIdentifier($property->getColumnName());
185 185
 
186 186
                             $this->gatherColumn($class, $property, $table);
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                             }
216 216
                         }
217 217
 
218
-                        if (! empty($inheritedKeyColumns)) {
218
+                        if ( ! empty($inheritedKeyColumns)) {
219 219
                             // Add a FK constraint on the ID column
220 220
                             $rootClass = $this->em->getClassMetadata($class->getRootClassName());
221 221
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 }
261 261
             }
262 262
 
263
-            if (! $table->hasIndex('primary')) {
263
+            if ( ! $table->hasIndex('primary')) {
264 264
                 $table->setPrimaryKey($pkColumns);
265 265
             }
266 266
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             $processedClasses[$class->getClassName()] = true;
321 321
 
322 322
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
323
-                if (! $property instanceof FieldMetadata
323
+                if ( ! $property instanceof FieldMetadata
324 324
                     || ! $property->hasValueGenerator()
325 325
                     || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE
326 326
                     || $class->getClassName() !== $class->getRootClassName()) {
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
                 $quotedName = $this->platform->quoteIdentifier($property->getValueGenerator()->getDefinition()['sequenceName']);
331 331
 
332
-                if (! $schema->hasSequence($quotedName)) {
332
+                if ( ! $schema->hasSequence($quotedName)) {
333 333
                     $schema->createSequence($quotedName, $property->getValueGenerator()->getDefinition()['allocationSize']);
334 334
                 }
335 335
             }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
             }
343 343
         }
344 344
 
345
-        if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
345
+        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
346 346
             $schema->visit(new RemoveNamespacedAssets());
347 347
         }
348 348
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
                 break;
382 382
         }
383 383
 
384
-        if (! empty($discrColumn->getColumnDefinition())) {
384
+        if ( ! empty($discrColumn->getColumnDefinition())) {
385 385
             $options['columnDefinition'] = $discrColumn->getColumnDefinition();
386 386
         }
387 387
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
         $pkColumns = [];
400 400
 
401 401
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
402
-            if (! ($property instanceof FieldMetadata)) {
402
+            if ( ! ($property instanceof FieldMetadata)) {
403 403
                 continue;
404 404
             }
405 405
 
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
     private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)
515 515
     {
516 516
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
517
-            if (! ($property instanceof AssociationMetadata)) {
517
+            if ( ! ($property instanceof AssociationMetadata)) {
518 518
                 continue;
519 519
             }
520 520
 
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
                 continue;
523 523
             }
524 524
 
525
-            if (! $property->isOwningSide()) {
525
+            if ( ! $property->isOwningSide()) {
526 526
                 continue;
527 527
             }
528 528
 
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
         $idColumns        = $class->getIdentifierColumns($this->em);
613 613
         $idColumnNameList = array_keys($idColumns);
614 614
 
615
-        if (! in_array($referencedColumnName, $idColumnNameList, true)) {
615
+        if ( ! in_array($referencedColumnName, $idColumnNameList, true)) {
616 616
             return null;
617 617
         }
618 618
 
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
         foreach ($class->getIdentifierFieldNames() as $fieldName) {
621 621
             $property = $class->getProperty($fieldName);
622 622
 
623
-            if (! ($property instanceof AssociationMetadata)) {
623
+            if ( ! ($property instanceof AssociationMetadata)) {
624 624
                 continue;
625 625
             }
626 626
 
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                 $joinColumn->getReferencedColumnName()
677 677
             );
678 678
 
679
-            if (! $definingClass) {
679
+            if ( ! $definingClass) {
680 680
                 throw MissingColumnException::fromColumnSourceAndTarget(
681 681
                     $joinColumn->getReferencedColumnName(),
682 682
                     $mapping->getSourceEntity(),
@@ -691,14 +691,14 @@  discard block
 block discarded – undo
691 691
             $localColumns[]      = $quotedColumnName;
692 692
             $foreignColumns[]    = $quotedReferencedColumnName;
693 693
 
694
-            if (! $theJoinTable->hasColumn($quotedColumnName)) {
694
+            if ( ! $theJoinTable->hasColumn($quotedColumnName)) {
695 695
                 // Only add the column to the table if it does not exist already.
696 696
                 // It might exist already if the foreign key is mapped into a regular
697 697
                 // property as well.
698 698
                 $property  = $definingClass->getProperty($referencedFieldName);
699 699
                 $columnDef = null;
700 700
 
701
-                if (! empty($joinColumn->getColumnDefinition())) {
701
+                if ( ! empty($joinColumn->getColumnDefinition())) {
702 702
                     $columnDef = $joinColumn->getColumnDefinition();
703 703
                 } elseif ($property->getColumnDefinition()) {
704 704
                     $columnDef = $property->getColumnDefinition();
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
                 $uniqueConstraints[] = ['columns' => [$quotedColumnName]];
733 733
             }
734 734
 
735
-            if (! empty($joinColumn->getOnDelete())) {
735
+            if ( ! empty($joinColumn->getOnDelete())) {
736 736
                 $fkOptions['onDelete'] = $joinColumn->getOnDelete();
737 737
             }
738 738
         }
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
             $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName);
744 744
         }
745 745
 
746
-        $compositeName = $theJoinTable->getName() . '.' . implode('', $localColumns);
746
+        $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns);
747 747
 
748 748
         if (isset($addedFks[$compositeName])
749 749
             && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName']
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
             }
761 761
 
762 762
             $blacklistedFks[$compositeName] = true;
763
-        } elseif (! isset($blacklistedFks[$compositeName])) {
763
+        } elseif ( ! isset($blacklistedFks[$compositeName])) {
764 764
             $addedFks[$compositeName] = [
765 765
                 'foreignTableName' => $foreignTableName,
766 766
                 'foreignColumns'   => $foreignColumns,
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
         $fullSchema = $sm->createSchema();
843 843
 
844 844
         foreach ($fullSchema->getTables() as $table) {
845
-            if (! $schema->hasTable($table->getName())) {
845
+            if ( ! $schema->hasTable($table->getName())) {
846 846
                 foreach ($table->getForeignKeys() as $foreignKey) {
847 847
                     /** @var $foreignKey \Doctrine\DBAL\Schema\ForeignKeyConstraint */
848 848
                     if ($schema->hasTable($foreignKey->getForeignTableName())) {
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
                 if ($table->hasPrimaryKey()) {
868 868
                     $columns = $table->getPrimaryKey()->getColumns();
869 869
                     if (count($columns) === 1) {
870
-                        $checkSequence = $table->getName() . '_' . $columns[0] . '_seq';
870
+                        $checkSequence = $table->getName().'_'.$columns[0].'_seq';
871 871
                         if ($fullSchema->hasSequence($checkSequence)) {
872 872
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
873 873
                         }
Please login to merge, or discard this patch.