@@ -1278,7 +1278,7 @@ |
||
1278 | 1278 | * |
1279 | 1279 | * @todo guilhermeblanco Only used for ClassMetadataTest. Remove if possible! |
1280 | 1280 | * |
1281 | - * @param array $subclasses The names of all mapped subclasses. |
|
1281 | + * @param string[] $subclasses The names of all mapped subclasses. |
|
1282 | 1282 | * |
1283 | 1283 | * @return void |
1284 | 1284 | */ |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * <http://www.doctrine-project.org>. |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace Doctrine\ORM\Mapping; |
24 | 24 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * |
331 | 331 | * @return void |
332 | 332 | */ |
333 | - public function setCache(?CacheMetadata $cache = null) |
|
333 | + public function setCache(? CacheMetadata $cache = null) |
|
334 | 334 | { |
335 | 335 | $this->cache = $cache; |
336 | 336 | } |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | /** |
339 | 339 | * @return CacheMetadata|null |
340 | 340 | */ |
341 | - public function getCache(): ?CacheMetadata |
|
341 | + public function getCache(): ? CacheMetadata |
|
342 | 342 | { |
343 | 343 | return $this->cache; |
344 | 344 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | /** |
347 | 347 | * @return \ReflectionClass|null |
348 | 348 | */ |
349 | - public function getReflectionClass() : ?\ReflectionClass |
|
349 | + public function getReflectionClass() : ? \ReflectionClass |
|
350 | 350 | { |
351 | 351 | return $this->reflectionClass; |
352 | 352 | } |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | */ |
375 | 375 | public function __toString() |
376 | 376 | { |
377 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
377 | + return __CLASS__.'@'.spl_object_hash($this); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | // Restore ReflectionClass and properties |
479 | 479 | $this->reflectionClass = $reflService->getClass($this->name); |
480 | 480 | |
481 | - if (! $this->reflectionClass) { |
|
481 | + if ( ! $this->reflectionClass) { |
|
482 | 482 | return; |
483 | 483 | } |
484 | 484 | |
@@ -553,11 +553,11 @@ discard block |
||
553 | 553 | } |
554 | 554 | |
555 | 555 | // Verify & complete identifier mapping |
556 | - if (! $this->identifier) { |
|
556 | + if ( ! $this->identifier) { |
|
557 | 557 | throw MappingException::identifierRequired($this->name); |
558 | 558 | } |
559 | 559 | |
560 | - $explicitlyGeneratedProperties = array_filter($this->properties, function (Property $property) : bool { |
|
560 | + $explicitlyGeneratedProperties = array_filter($this->properties, function(Property $property) : bool { |
|
561 | 561 | return $property instanceof FieldMetadata |
562 | 562 | && $property->isPrimaryKey() |
563 | 563 | && $property->hasValueGenerator(); |
@@ -578,8 +578,8 @@ discard block |
||
578 | 578 | public function validateAssociations() |
579 | 579 | { |
580 | 580 | array_map( |
581 | - function (Property $property) { |
|
582 | - if (! ($property instanceof AssociationMetadata)) { |
|
581 | + function(Property $property) { |
|
582 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
583 | 583 | return; |
584 | 584 | } |
585 | 585 | |
@@ -635,11 +635,11 @@ discard block |
||
635 | 635 | */ |
636 | 636 | public function isIdentifier($fieldName) |
637 | 637 | { |
638 | - if (! $this->identifier) { |
|
638 | + if ( ! $this->identifier) { |
|
639 | 639 | return false; |
640 | 640 | } |
641 | 641 | |
642 | - if (! $this->isIdentifierComposite()) { |
|
642 | + if ( ! $this->isIdentifierComposite()) { |
|
643 | 643 | return $fieldName === $this->identifier[0]; |
644 | 644 | } |
645 | 645 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | */ |
668 | 668 | public function getNamedQuery($queryName) |
669 | 669 | { |
670 | - if (! isset($this->namedQueries[$queryName])) { |
|
670 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
671 | 671 | throw MappingException::queryNotFound($this->name, $queryName); |
672 | 672 | } |
673 | 673 | |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | */ |
728 | 728 | public function getSqlResultSetMapping($name) |
729 | 729 | { |
730 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
730 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
731 | 731 | throw MappingException::resultMappingNotFound($this->name, $name); |
732 | 732 | } |
733 | 733 | |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | $property->setColumnName($columnName); |
763 | 763 | } |
764 | 764 | |
765 | - if (! $this->isMappedSuperclass) { |
|
765 | + if ( ! $this->isMappedSuperclass) { |
|
766 | 766 | $property->setTableName($this->getTableName()); |
767 | 767 | } |
768 | 768 | |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
783 | 783 | }; |
784 | 784 | |
785 | - if (! in_array($fieldName, $this->identifier)) { |
|
785 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
786 | 786 | $this->identifier[] = $fieldName; |
787 | 787 | } |
788 | 788 | } |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | $fieldName = $property->getName(); |
837 | 837 | $targetEntity = $property->getTargetEntity(); |
838 | 838 | |
839 | - if (! $targetEntity) { |
|
839 | + if ( ! $targetEntity) { |
|
840 | 840 | throw MappingException::missingTargetEntity($fieldName); |
841 | 841 | } |
842 | 842 | |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | $this->identifier[] = $property->getName(); |
868 | 868 | } |
869 | 869 | |
870 | - if ($this->cache && !$property->getCache()) { |
|
870 | + if ($this->cache && ! $property->getCache()) { |
|
871 | 871 | throw CacheException::nonCacheableEntityAssociation($this->name, $fieldName); |
872 | 872 | } |
873 | 873 | |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | foreach ($property->getJoinColumns() as $joinColumn) { |
921 | 921 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
922 | 922 | if (1 === count($property->getJoinColumns())) { |
923 | - if (! $property->isPrimaryKey()) { |
|
923 | + if ( ! $property->isPrimaryKey()) { |
|
924 | 924 | $joinColumn->setUnique(true); |
925 | 925 | } |
926 | 926 | } else { |
@@ -928,13 +928,13 @@ discard block |
||
928 | 928 | } |
929 | 929 | } |
930 | 930 | |
931 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
931 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
932 | 932 | |
933 | - if (! $joinColumn->getColumnName()) { |
|
933 | + if ( ! $joinColumn->getColumnName()) { |
|
934 | 934 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->name)); |
935 | 935 | } |
936 | 936 | |
937 | - if (! $joinColumn->getReferencedColumnName()) { |
|
937 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
938 | 938 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
939 | 939 | } |
940 | 940 | |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | if ($property->isOrphanRemoval()) { |
963 | 963 | $cascades = $property->getCascade(); |
964 | 964 | |
965 | - if (! in_array('remove', $cascades)) { |
|
965 | + if ( ! in_array('remove', $cascades)) { |
|
966 | 966 | $cascades[] = 'remove'; |
967 | 967 | |
968 | 968 | $property->setCascade($cascades); |
@@ -1030,14 +1030,14 @@ discard block |
||
1030 | 1030 | $property->setOwningSide(false); |
1031 | 1031 | |
1032 | 1032 | // OneToMany MUST have mappedBy |
1033 | - if (! $property->getMappedBy()) { |
|
1033 | + if ( ! $property->getMappedBy()) { |
|
1034 | 1034 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
1035 | 1035 | } |
1036 | 1036 | |
1037 | 1037 | if ($property->isOrphanRemoval()) { |
1038 | 1038 | $cascades = $property->getCascade(); |
1039 | 1039 | |
1040 | - if (! in_array('remove', $cascades)) { |
|
1040 | + if ( ! in_array('remove', $cascades)) { |
|
1041 | 1041 | $cascades[] = 'remove'; |
1042 | 1042 | |
1043 | 1043 | $property->setCascade($cascades); |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | |
1061 | 1061 | $property->setJoinTable($joinTable); |
1062 | 1062 | |
1063 | - if (! $joinTable->getName()) { |
|
1063 | + if ( ! $joinTable->getName()) { |
|
1064 | 1064 | $joinTableName = $this->namingStrategy->joinTableName( |
1065 | 1065 | $property->getSourceEntity(), |
1066 | 1066 | $property->getTargetEntity(), |
@@ -1072,7 +1072,7 @@ discard block |
||
1072 | 1072 | |
1073 | 1073 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
1074 | 1074 | |
1075 | - if (! $joinTable->getJoinColumns()) { |
|
1075 | + if ( ! $joinTable->getJoinColumns()) { |
|
1076 | 1076 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
1077 | 1077 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
1078 | 1078 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | $joinTable->addJoinColumn($joinColumn); |
1086 | 1086 | } |
1087 | 1087 | |
1088 | - if (! $joinTable->getInverseJoinColumns()) { |
|
1088 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
1089 | 1089 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
1090 | 1090 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
1091 | 1091 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -1099,13 +1099,13 @@ discard block |
||
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
1102 | - if (! $joinColumn->getReferencedColumnName()) { |
|
1102 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
1103 | 1103 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1107 | 1107 | |
1108 | - if (! $joinColumn->getColumnName()) { |
|
1108 | + if ( ! $joinColumn->getColumnName()) { |
|
1109 | 1109 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1110 | 1110 | $property->getSourceEntity(), |
1111 | 1111 | $referencedColumnName |
@@ -1116,13 +1116,13 @@ discard block |
||
1116 | 1116 | } |
1117 | 1117 | |
1118 | 1118 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
1119 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
1119 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
1120 | 1120 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1121 | 1121 | } |
1122 | 1122 | |
1123 | 1123 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
1124 | 1124 | |
1125 | - if (! $inverseJoinColumn->getColumnName()) { |
|
1125 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
1126 | 1126 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1127 | 1127 | $property->getTargetEntity(), |
1128 | 1128 | $referencedColumnName |
@@ -1215,7 +1215,7 @@ discard block |
||
1215 | 1215 | // Association defined as Id field |
1216 | 1216 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1217 | 1217 | |
1218 | - if (! $property->isOwningSide()) { |
|
1218 | + if ( ! $property->isOwningSide()) { |
|
1219 | 1219 | $property = $targetClass->getProperty($property->getMappedBy()); |
1220 | 1220 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1221 | 1221 | } |
@@ -1266,11 +1266,11 @@ discard block |
||
1266 | 1266 | { |
1267 | 1267 | $schema = empty($this->getSchemaName()) |
1268 | 1268 | ? '' |
1269 | - : $this->getSchemaName() . '_' |
|
1269 | + : $this->getSchemaName().'_' |
|
1270 | 1270 | ; |
1271 | 1271 | |
1272 | 1272 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
1273 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
1273 | + return $schema.$this->getTableName().'_id_tmp'; |
|
1274 | 1274 | } |
1275 | 1275 | |
1276 | 1276 | /** |
@@ -1356,7 +1356,7 @@ discard block |
||
1356 | 1356 | { |
1357 | 1357 | $fieldName = $property->getName(); |
1358 | 1358 | |
1359 | - if (! isset($this->properties[$fieldName])) { |
|
1359 | + if ( ! isset($this->properties[$fieldName])) { |
|
1360 | 1360 | throw MappingException::invalidOverrideFieldName($this->name, $fieldName); |
1361 | 1361 | } |
1362 | 1362 | |
@@ -1476,7 +1476,7 @@ discard block |
||
1476 | 1476 | * |
1477 | 1477 | * @return LocalColumnMetadata|null |
1478 | 1478 | */ |
1479 | - public function getColumn(string $columnName): ?LocalColumnMetadata |
|
1479 | + public function getColumn(string $columnName): ? LocalColumnMetadata |
|
1480 | 1480 | { |
1481 | 1481 | foreach ($this->properties as $property) { |
1482 | 1482 | if ($property instanceof LocalColumnMetadata && $property->getColumnName() === $columnName) { |
@@ -1583,7 +1583,7 @@ discard block |
||
1583 | 1583 | $declaringClass = $property->getDeclaringClass(); |
1584 | 1584 | |
1585 | 1585 | if ($inheritedProperty instanceof FieldMetadata) { |
1586 | - if (! $declaringClass->isMappedSuperclass) { |
|
1586 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1587 | 1587 | $inheritedProperty->setTableName($property->getTableName()); |
1588 | 1588 | } |
1589 | 1589 | |
@@ -1641,7 +1641,7 @@ discard block |
||
1641 | 1641 | throw MappingException::duplicateQueryMapping($this->name, $name); |
1642 | 1642 | } |
1643 | 1643 | |
1644 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1644 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1645 | 1645 | throw MappingException::missingQueryMapping($this->name, $name); |
1646 | 1646 | } |
1647 | 1647 | |
@@ -1664,7 +1664,7 @@ discard block |
||
1664 | 1664 | */ |
1665 | 1665 | public function addSqlResultSetMapping(array $resultMapping) |
1666 | 1666 | { |
1667 | - if (!isset($resultMapping['name'])) { |
|
1667 | + if ( ! isset($resultMapping['name'])) { |
|
1668 | 1668 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
1669 | 1669 | } |
1670 | 1670 | |
@@ -1674,7 +1674,7 @@ discard block |
||
1674 | 1674 | |
1675 | 1675 | if (isset($resultMapping['entities'])) { |
1676 | 1676 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
1677 | - if (! isset($entityResult['entityClass'])) { |
|
1677 | + if ( ! isset($entityResult['entityClass'])) { |
|
1678 | 1678 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
1679 | 1679 | } |
1680 | 1680 | |
@@ -1687,11 +1687,11 @@ discard block |
||
1687 | 1687 | |
1688 | 1688 | if (isset($entityResult['fields'])) { |
1689 | 1689 | foreach ($entityResult['fields'] as $k => $field) { |
1690 | - if (! isset($field['name'])) { |
|
1690 | + if ( ! isset($field['name'])) { |
|
1691 | 1691 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
1692 | 1692 | } |
1693 | 1693 | |
1694 | - if (! isset($field['column'])) { |
|
1694 | + if ( ! isset($field['column'])) { |
|
1695 | 1695 | $fieldName = $field['name']; |
1696 | 1696 | |
1697 | 1697 | if (strpos($fieldName, '.')) { |
@@ -1715,7 +1715,7 @@ discard block |
||
1715 | 1715 | * |
1716 | 1716 | * @return void |
1717 | 1717 | */ |
1718 | - public function setCustomRepositoryClassName(?string $repositoryClassName) |
|
1718 | + public function setCustomRepositoryClassName(? string $repositoryClassName) |
|
1719 | 1719 | { |
1720 | 1720 | $this->customRepositoryClassName = $repositoryClassName; |
1721 | 1721 | } |
@@ -1723,7 +1723,7 @@ discard block |
||
1723 | 1723 | /** |
1724 | 1724 | * @return string|null |
1725 | 1725 | */ |
1726 | - public function getCustomRepositoryClassName() : ?string |
|
1726 | + public function getCustomRepositoryClassName() : ? string |
|
1727 | 1727 | { |
1728 | 1728 | return $this->customRepositoryClassName; |
1729 | 1729 | } |
@@ -1798,11 +1798,11 @@ discard block |
||
1798 | 1798 | 'method' => $method, |
1799 | 1799 | ]; |
1800 | 1800 | |
1801 | - if (! class_exists($class)) { |
|
1801 | + if ( ! class_exists($class)) { |
|
1802 | 1802 | throw MappingException::entityListenerClassNotFound($class, $this->name); |
1803 | 1803 | } |
1804 | 1804 | |
1805 | - if (! method_exists($class, $method)) { |
|
1805 | + if ( ! method_exists($class, $method)) { |
|
1806 | 1806 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->name); |
1807 | 1807 | } |
1808 | 1808 | |
@@ -1876,7 +1876,7 @@ discard block |
||
1876 | 1876 | return; |
1877 | 1877 | } |
1878 | 1878 | |
1879 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1879 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1880 | 1880 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->name); |
1881 | 1881 | } |
1882 | 1882 | |
@@ -1973,7 +1973,7 @@ discard block |
||
1973 | 1973 | $namespace = $this->reflectionClass->getNamespaceName(); |
1974 | 1974 | |
1975 | 1975 | if ($className !== null && strpos($className, '\\') === false && $namespace) { |
1976 | - return ltrim($namespace . '\\' . $className, '\\'); |
|
1976 | + return ltrim($namespace.'\\'.$className, '\\'); |
|
1977 | 1977 | } |
1978 | 1978 | |
1979 | 1979 | return ltrim($className, '\\'); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | /** |
56 | 56 | * Constructor. |
57 | 57 | * |
58 | - * @param array|string $paths |
|
58 | + * @param string $paths |
|
59 | 59 | */ |
60 | 60 | public function __construct($paths) |
61 | 61 | { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Mapping\Driver; |
23 | 23 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return $this->classNames; |
93 | 93 | } |
94 | 94 | |
95 | - if (!$this->paths) { |
|
95 | + if ( ! $this->paths) { |
|
96 | 96 | throw MappingException::pathRequired(); |
97 | 97 | } |
98 | 98 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $includedFiles = []; |
101 | 101 | |
102 | 102 | foreach ($this->paths as $path) { |
103 | - if (!is_dir($path)) { |
|
103 | + if ( ! is_dir($path)) { |
|
104 | 104 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
105 | 105 | } |
106 | 106 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | foreach ($declared as $className) { |
126 | 126 | $rc = new \ReflectionClass($className); |
127 | 127 | $sourceFile = $rc->getFileName(); |
128 | - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { |
|
128 | + if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { |
|
129 | 129 | $classes[] = $className; |
130 | 130 | } |
131 | 131 | } |
@@ -24,7 +24,6 @@ |
||
24 | 24 | |
25 | 25 | use Doctrine\DBAL\Types\Type; |
26 | 26 | use Doctrine\ORM\Reflection\ReflectionService; |
27 | -use Doctrine\ORM\Sequencing\Generator; |
|
28 | 27 | |
29 | 28 | class FieldMetadata extends LocalColumnMetadata implements Property |
30 | 29 | { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * <http://www.doctrine-project.org>. |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace Doctrine\ORM\Mapping; |
24 | 24 |
@@ -207,7 +207,6 @@ |
||
207 | 207 | |
208 | 208 | /** |
209 | 209 | * @param ClassMetadata $targetClass |
210 | - * @param array $assoc |
|
211 | 210 | * @param mixed $actualValue |
212 | 211 | * |
213 | 212 | * @return self |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM; |
23 | 23 | use Doctrine\ORM\Mapping\AssociationMetadata; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | static public function scheduleInsertForManagedEntity($entity) |
40 | 40 | { |
41 | - return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
41 | + return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | static public function scheduleInsertForRemovedEntity($entity) |
50 | 50 | { |
51 | - return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
51 | + return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | static public function scheduleInsertTwice($entity) |
60 | 60 | { |
61 | - return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice."); |
|
61 | + return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice."); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | static public function entityWithoutIdentity($className, $entity) |
71 | 71 | { |
72 | 72 | return new self( |
73 | - "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " . |
|
73 | + "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ". |
|
74 | 74 | "id values set. It cannot be added to the identity map." |
75 | 75 | ); |
76 | 76 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | static public function readOnlyRequiresManagedEntity($entity) |
84 | 84 | { |
85 | - return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not"); |
|
85 | + return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not"); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | static public function entityNotManaged($entity) |
140 | 140 | { |
141 | - return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " . |
|
141 | + return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ". |
|
142 | 142 | "from the database or registered as new through EntityManager#persist"); |
143 | 143 | } |
144 | 144 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | static public function entityHasNoIdentity($entity, $operation) |
152 | 152 | { |
153 | - return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
153 | + return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | static public function entityIsRemoved($entity, $operation) |
163 | 163 | { |
164 | - return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
164 | + return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | static public function detachedEntityCannot($entity, $operation) |
174 | 174 | { |
175 | - return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation); |
|
175 | + return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public static function invalidObject($context, $given, $parameterIndex = 1) |
186 | 186 | { |
187 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
188 | - ' to be an entity object, '. gettype($given) . ' given.'); |
|
187 | + return new self($context.' expects parameter '.$parameterIndex. |
|
188 | + ' to be an entity object, '.gettype($given).' given.'); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public static function invalidCompositeIdentifier() |
195 | 195 | { |
196 | - return new self("Binding an entity with a composite primary key to a query is not supported. " . |
|
196 | + return new self("Binding an entity with a composite primary key to a query is not supported. ". |
|
197 | 197 | "You should split the parameter into the explicit fields and bind them separately."); |
198 | 198 | } |
199 | 199 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @param string $field |
121 | 121 | * @param array $args |
122 | 122 | * |
123 | - * @return object |
|
123 | + * @return PersistentObject |
|
124 | 124 | * |
125 | 125 | * @throws \BadMethodCallException When no persistent field exists by that name. |
126 | 126 | * @throws \InvalidArgumentException When the wrong target object type is passed to an association. |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @param string $field |
208 | 208 | * @param array $args |
209 | 209 | * |
210 | - * @return object |
|
210 | + * @return PersistentObject |
|
211 | 211 | * |
212 | 212 | * @throws \BadMethodCallException |
213 | 213 | * @throws \InvalidArgumentException |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM; |
23 | 23 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | if ($entityManager !== self::$entityManager) { |
108 | 108 | throw new \RuntimeException( |
109 | - "Trying to use PersistentObject with different EntityManager instances. " . |
|
109 | + "Trying to use PersistentObject with different EntityManager instances. ". |
|
110 | 110 | "Was PersistentObject::setEntityManager() called?" |
111 | 111 | ); |
112 | 112 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | $property = $this->cm->getProperty($field); |
133 | 133 | |
134 | - if (! $property) { |
|
134 | + if ( ! $property) { |
|
135 | 135 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
136 | 136 | } |
137 | 137 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | $property = $this->cm->getProperty($field); |
172 | 172 | |
173 | - if (! $property) { |
|
173 | + if ( ! $property) { |
|
174 | 174 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
175 | 175 | } |
176 | 176 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $mappedByField = $property->getMappedBy(); |
197 | 197 | $targetMetadata = self::$entityManager->getClassMetadata($property->getTargetEntity()); |
198 | 198 | $targetProperty = $targetMetadata->getProperty($mappedByField); |
199 | - $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField; |
|
199 | + $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField; |
|
200 | 200 | |
201 | 201 | $targetObject->$setterMethodName($this); |
202 | 202 | } |
@@ -218,21 +218,21 @@ discard block |
||
218 | 218 | |
219 | 219 | $property = $this->cm->getProperty($field); |
220 | 220 | |
221 | - if (! $property) { |
|
221 | + if ( ! $property) { |
|
222 | 222 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
223 | 223 | } |
224 | 224 | |
225 | - if (! ($property instanceof ToManyAssociationMetadata)) { |
|
225 | + if ( ! ($property instanceof ToManyAssociationMetadata)) { |
|
226 | 226 | throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getClassName()); |
227 | 227 | } |
228 | 228 | |
229 | 229 | $targetClassName = $property->getTargetEntity(); |
230 | 230 | |
231 | - if (! ($args[0] instanceof $targetClassName)) { |
|
231 | + if ( ! ($args[0] instanceof $targetClassName)) { |
|
232 | 232 | throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
233 | 233 | } |
234 | 234 | |
235 | - if (! ($this->$field instanceof Collection)) { |
|
235 | + if ( ! ($this->$field instanceof Collection)) { |
|
236 | 236 | $this->$field = new ArrayCollection($this->$field ?: []); |
237 | 237 | } |
238 | 238 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | return; |
257 | 257 | } |
258 | 258 | |
259 | - if (!self::$entityManager) { |
|
259 | + if ( ! self::$entityManager) { |
|
260 | 260 | throw new \RuntimeException("No runtime entity manager set. Call PersistentObject#setEntityManager()."); |
261 | 261 | } |
262 | 262 |
@@ -22,7 +22,6 @@ |
||
22 | 22 | namespace Doctrine\ORM\Persisters\Collection; |
23 | 23 | |
24 | 24 | use Doctrine\Common\Collections\Criteria; |
25 | -use Doctrine\ORM\Mapping\AssociationMetadata; |
|
26 | 25 | use Doctrine\ORM\Mapping\ClassMetadata; |
27 | 26 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
28 | 27 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Persisters\Collection; |
23 | 23 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $association = $collection->getMapping(); |
50 | 50 | |
51 | - if (! $association->isOwningSide()) { |
|
51 | + if ( ! $association->isOwningSide()) { |
|
52 | 52 | return; // ignore inverse side |
53 | 53 | } |
54 | 54 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $association = $collection->getMapping(); |
75 | 75 | |
76 | - if (! $association->isOwningSide()) { |
|
76 | + if ( ! $association->isOwningSide()) { |
|
77 | 77 | return; // ignore inverse side |
78 | 78 | } |
79 | 79 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | $association = $collection->getMapping(); |
106 | 106 | |
107 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
107 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
108 | 108 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
109 | 109 | } |
110 | 110 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | : $association->getMappedBy() |
115 | 115 | ; |
116 | 116 | |
117 | - $criteria = [ |
|
117 | + $criteria = [ |
|
118 | 118 | $mappedKey => $collection->getOwner(), |
119 | 119 | $association->getIndexedBy() => $index, |
120 | 120 | ]; |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
151 | 151 | $referencedName = $joinColumn->getReferencedColumnName(); |
152 | 152 | |
153 | - if (! $joinColumn->getType()) { |
|
153 | + if ( ! $joinColumn->getType()) { |
|
154 | 154 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em)); |
155 | 155 | } |
156 | 156 | |
157 | - $conditions[] = 't.' . $quotedColumnName . ' = ?'; |
|
157 | + $conditions[] = 't.'.$quotedColumnName.' = ?'; |
|
158 | 158 | $params[] = $id[$sourceClass->fieldNames[$referencedName]]; |
159 | 159 | $types[] = $joinColumn->getType(); |
160 | 160 | } |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | }*/ |
184 | 184 | |
185 | 185 | $sql = 'SELECT COUNT(*)' |
186 | - . ' FROM ' . $joinTableName . ' t' |
|
186 | + . ' FROM '.$joinTableName.' t' |
|
187 | 187 | . $joinTargetEntitySQL |
188 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
188 | + . ' WHERE '.implode(' AND ', $conditions); |
|
189 | 189 | |
190 | 190 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
191 | 191 | } |
@@ -207,13 +207,13 @@ discard block |
||
207 | 207 | { |
208 | 208 | $association = $collection->getMapping(); |
209 | 209 | |
210 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
210 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
211 | 211 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
212 | 212 | } |
213 | 213 | |
214 | 214 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
215 | 215 | |
216 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
216 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
217 | 217 | |
218 | 218 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
219 | 219 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
231 | 231 | |
232 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
232 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
233 | 233 | |
234 | 234 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
235 | 235 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
247 | 247 | |
248 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
248 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
249 | 249 | |
250 | 250 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
251 | 251 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $onConditions = $this->getOnConditionSQL($association); |
264 | 264 | $whereClauses = $params = $types = []; |
265 | 265 | |
266 | - if (! $association->isOwningSide()) { |
|
266 | + if ( ! $association->isOwningSide()) { |
|
267 | 267 | $association = $targetClass->getProperty($association->getMappedBy()); |
268 | 268 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
269 | 269 | } else { |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
275 | 275 | $referencedName = $joinColumn->getReferencedColumnName(); |
276 | 276 | |
277 | - if (! $joinColumn->getType()) { |
|
277 | + if ( ! $joinColumn->getType()) { |
|
278 | 278 | $joinColumn->setType( |
279 | 279 | PersisterHelper::getTypeOfColumn($referencedName, $ownerMetadata, $this->em) |
280 | 280 | ); |
@@ -304,11 +304,11 @@ discard block |
||
304 | 304 | |
305 | 305 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
306 | 306 | |
307 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
308 | - . ' FROM ' . $tableName . ' te' |
|
309 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
307 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
308 | + . ' FROM '.$tableName.' te' |
|
309 | + . ' JOIN '.$joinTableName.' t ON' |
|
310 | 310 | . implode(' AND ', $onConditions) |
311 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
311 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
312 | 312 | |
313 | 313 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
314 | 314 | $sql .= $this->getLimitSql($criteria); |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | |
346 | 346 | // A join is needed if there is filtering on the target entity |
347 | 347 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
348 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
349 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
348 | + $joinSql = ' JOIN '.$tableName.' te' |
|
349 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
350 | 350 | |
351 | 351 | return [$joinSql, $filterSql]; |
352 | 352 | } |
@@ -365,18 +365,18 @@ discard block |
||
365 | 365 | |
366 | 366 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
367 | 367 | if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
368 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
368 | + $filterClauses[] = '('.$filterExpr.')'; |
|
369 | 369 | } |
370 | 370 | } |
371 | 371 | |
372 | - if (! $filterClauses) { |
|
372 | + if ( ! $filterClauses) { |
|
373 | 373 | return ''; |
374 | 374 | } |
375 | 375 | |
376 | 376 | $filterSql = implode(' AND ', $filterClauses); |
377 | 377 | |
378 | 378 | return count($filterClauses) > 1 |
379 | - ? '(' . $filterSql . ')' |
|
379 | + ? '('.$filterSql.')' |
|
380 | 380 | : $filterSql |
381 | 381 | ; |
382 | 382 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
408 | 408 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
409 | 409 | |
410 | - $conditions[] = ' t.' . $quotedColumnName . ' = ' . 'te.' . $quotedReferencedColumnName; |
|
410 | + $conditions[] = ' t.'.$quotedColumnName.' = '.'te.'.$quotedReferencedColumnName; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | return $conditions; |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
430 | 430 | } |
431 | 431 | |
432 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
432 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
621 | 621 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
622 | 622 | |
623 | - if (! $owningAssociation->isOwningSide()) { |
|
623 | + if ( ! $owningAssociation->isOwningSide()) { |
|
624 | 624 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
625 | 625 | $joinTable = $owningAssociation->getJoinTable(); |
626 | 626 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | } |
633 | 633 | |
634 | 634 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
635 | - $quotedJoinTable = $joinTableName . ' t'; |
|
635 | + $quotedJoinTable = $joinTableName.' t'; |
|
636 | 636 | $whereClauses = []; |
637 | 637 | $params = []; |
638 | 638 | $types = []; |
@@ -645,39 +645,39 @@ discard block |
||
645 | 645 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
646 | 646 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
647 | 647 | |
648 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = ' . 'tr.' . $quotedReferencedColumnName; |
|
648 | + $joinConditions[] = ' t.'.$quotedColumnName.' = '.'tr.'.$quotedReferencedColumnName; |
|
649 | 649 | } |
650 | 650 | |
651 | 651 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
652 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
652 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
653 | 653 | $columnName = $targetClass->getProperty($indexBy)->getColumnName(); |
654 | 654 | |
655 | - $whereClauses[] = 'tr.' . $this->platform->quoteIdentifier($columnName) . ' = ?'; |
|
655 | + $whereClauses[] = 'tr.'.$this->platform->quoteIdentifier($columnName).' = ?'; |
|
656 | 656 | $params[] = $key; |
657 | 657 | $types[] = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em); |
658 | 658 | } |
659 | 659 | |
660 | 660 | foreach ($inverseJoinColumns as $joinColumn) { |
661 | - if (! $joinColumn->getType()) { |
|
661 | + if ( ! $joinColumn->getType()) { |
|
662 | 662 | $joinColumn->setType( |
663 | 663 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $sourceClass, $this->em) |
664 | 664 | ); |
665 | 665 | } |
666 | 666 | |
667 | - $whereClauses[] = 't.' . $this->platform->quoteIdentifier($joinColumn->getColumnName()) . ' = ?'; |
|
667 | + $whereClauses[] = 't.'.$this->platform->quoteIdentifier($joinColumn->getColumnName()).' = ?'; |
|
668 | 668 | $params[] = $id[$sourceClass->fieldNames[$joinColumn->getReferencedColumnName()]]; |
669 | 669 | $types[] = $joinColumn->getType(); |
670 | 670 | } |
671 | 671 | |
672 | 672 | if ( ! $joinNeeded) { |
673 | 673 | foreach ($joinColumns as $joinColumn) { |
674 | - if (! $joinColumn->getType()) { |
|
674 | + if ( ! $joinColumn->getType()) { |
|
675 | 675 | $joinColumn->setType( |
676 | 676 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
677 | 677 | ); |
678 | 678 | } |
679 | 679 | |
680 | - $whereClauses[] = 't.' . $this->platform->quoteIdentifier($joinColumn->getColumnName()) . ' = ?'; |
|
680 | + $whereClauses[] = 't.'.$this->platform->quoteIdentifier($joinColumn->getColumnName()).' = ?'; |
|
681 | 681 | $params[] = $key; |
682 | 682 | $types[] = $joinColumn->getType(); |
683 | 683 | } |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
688 | 688 | |
689 | 689 | if ($filterSql) { |
690 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
690 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
691 | 691 | $whereClauses[] = $filterSql; |
692 | 692 | } |
693 | 693 | } |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | $association = $collection->getMapping(); |
712 | 712 | $owningAssociation = $association; |
713 | 713 | |
714 | - if (! $association->isOwningSide()) { |
|
714 | + if ( ! $association->isOwningSide()) { |
|
715 | 715 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
716 | 716 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
717 | 717 | $sourceId = $this->uow->getEntityIdentifier($element); |
@@ -736,13 +736,13 @@ discard block |
||
736 | 736 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
737 | 737 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
738 | 738 | |
739 | - if (! $joinColumn->getType()) { |
|
739 | + if ( ! $joinColumn->getType()) { |
|
740 | 740 | $joinColumn->setType( |
741 | 741 | PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em) |
742 | 742 | ); |
743 | 743 | } |
744 | 744 | |
745 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
745 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
746 | 746 | $params[] = $sourceId[$sourceClass->fieldNames[$referencedColumnName]]; |
747 | 747 | $types[] = $joinColumn->getType(); |
748 | 748 | } |
@@ -751,13 +751,13 @@ discard block |
||
751 | 751 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
752 | 752 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
753 | 753 | |
754 | - if (! $joinColumn->getType()) { |
|
754 | + if ( ! $joinColumn->getType()) { |
|
755 | 755 | $joinColumn->setType( |
756 | 756 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
757 | 757 | ); |
758 | 758 | } |
759 | 759 | |
760 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
760 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
761 | 761 | $params[] = $targetId[$targetClass->fieldNames[$referencedColumnName]]; |
762 | 762 | $types[] = $joinColumn->getType(); |
763 | 763 | } |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
769 | 769 | |
770 | 770 | if ($filterSql) { |
771 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
771 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
772 | 772 | $whereClauses[] = $filterSql; |
773 | 773 | } |
774 | 774 | } |
@@ -817,10 +817,10 @@ discard block |
||
817 | 817 | $property = $targetClass->getProperty($name); |
818 | 818 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
819 | 819 | |
820 | - $orderBy[] = $columnName . ' ' . $direction; |
|
820 | + $orderBy[] = $columnName.' '.$direction; |
|
821 | 821 | } |
822 | 822 | |
823 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
823 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
824 | 824 | } |
825 | 825 | return ''; |
826 | 826 | } |
@@ -22,7 +22,6 @@ |
||
22 | 22 | namespace Doctrine\ORM\Persisters\Collection; |
23 | 23 | |
24 | 24 | use Doctrine\Common\Collections\Criteria; |
25 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
26 | 25 | use Doctrine\ORM\Mapping\InheritanceType; |
27 | 26 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
28 | 27 | use Doctrine\ORM\PersistentCollection; |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | return (bool) $persister->count($criteria); |
146 | 146 | } |
147 | 147 | |
148 | - /** |
|
149 | - * {@inheritdoc} |
|
150 | - */ |
|
148 | + /** |
|
149 | + * {@inheritdoc} |
|
150 | + */ |
|
151 | 151 | public function contains(PersistentCollection $collection, $element) |
152 | 152 | { |
153 | 153 | if ( ! $this->isValidEntityState($element)) { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | |
266 | 266 | // 2) Build insert table records into temporary table |
267 | 267 | $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
268 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
268 | + . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
269 | 269 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
270 | 270 | |
271 | 271 | $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Persisters\Collection; |
23 | 23 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | // the entire collection with a new would trigger this operation. |
48 | 48 | $association = $collection->getMapping(); |
49 | 49 | |
50 | - if (! $association->isOrphanRemoval()) { |
|
50 | + if ( ! $association->isOrphanRemoval()) { |
|
51 | 51 | // Handling non-orphan removal should never happen, as @OneToMany |
52 | 52 | // can only be inverse side. For owning side one to many, it is |
53 | 53 | // required to have a join table, which would classify as a ManyToManyPersister. |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | { |
80 | 80 | $association = $collection->getMapping(); |
81 | 81 | |
82 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
82 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
83 | 83 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
84 | 84 | } |
85 | 85 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | { |
129 | 129 | $association = $collection->getMapping(); |
130 | 130 | |
131 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
131 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
132 | 132 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
133 | 133 | } |
134 | 134 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // only works with single id identifier entities. Will throw an |
138 | 138 | // exception in Entity Persisters if that is not the case for the |
139 | 139 | // 'mappedBy' field. |
140 | - $criteria = [ |
|
140 | + $criteria = [ |
|
141 | 141 | $association->getMappedBy() => $collection->getOwner(), |
142 | 142 | $association->getIndexedBy() => $key, |
143 | 143 | ]; |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | { |
175 | 175 | $association = $collection->getMapping(); |
176 | 176 | |
177 | - if (! $association->isOrphanRemoval()) { |
|
177 | + if ( ! $association->isOrphanRemoval()) { |
|
178 | 178 | // no-op: this is not the owning side, therefore no operations should be applied |
179 | 179 | return false; |
180 | 180 | } |
181 | 181 | |
182 | - if (! $this->isValidEntityState($element)) { |
|
182 | + if ( ! $this->isValidEntityState($element)) { |
|
183 | 183 | return false; |
184 | 184 | } |
185 | 185 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | } |
220 | 220 | |
221 | 221 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
222 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
222 | + $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
223 | 223 | |
224 | 224 | return $this->conn->executeUpdate($statement, $parameters); |
225 | 225 | } |
@@ -258,17 +258,17 @@ discard block |
||
258 | 258 | ]; |
259 | 259 | } |
260 | 260 | |
261 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
262 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
261 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
262 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
263 | 263 | |
264 | 264 | $this->conn->executeUpdate($statement); |
265 | 265 | |
266 | 266 | // 2) Build insert table records into temporary table |
267 | - $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
268 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
267 | + $dql = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
268 | + . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner'; |
|
269 | 269 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
270 | 270 | |
271 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
|
271 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL(); |
|
272 | 272 | $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner())); |
273 | 273 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
274 | 274 | |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | foreach (array_reverse($classNames) as $className) { |
283 | 283 | $parentClass = $this->em->getClassMetadata($className); |
284 | 284 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
285 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnNameList . ')' |
|
286 | - . ' IN (SELECT ' . $idColumnNameList . ' FROM ' . $tempTable . ')'; |
|
285 | + $statement = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnNameList.')' |
|
286 | + . ' IN (SELECT '.$idColumnNameList.' FROM '.$tempTable.')'; |
|
287 | 287 | |
288 | 288 | $this->conn->executeUpdate($statement); |
289 | 289 | } |
@@ -1409,7 +1409,6 @@ |
||
1409 | 1409 | * Gets the SQL join fragment used when selecting entities from a |
1410 | 1410 | * many-to-many association. |
1411 | 1411 | * |
1412 | - * @param ManyToManyAssociationMetadata $manyToMany |
|
1413 | 1412 | * |
1414 | 1413 | * @return string |
1415 | 1414 | */ |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | |
324 | 324 | // FIXME: Order with composite keys might not be correct |
325 | 325 | $sql = 'SELECT ' . $columnName |
326 | - . ' FROM ' . $tableName |
|
327 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
326 | + . ' FROM ' . $tableName |
|
327 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
328 | 328 | |
329 | 329 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
330 | 330 | $versionType = $versionProperty->getType(); |
@@ -457,8 +457,8 @@ discard block |
||
457 | 457 | } |
458 | 458 | |
459 | 459 | $sql = 'UPDATE ' . $quotedTableName |
460 | - . ' SET ' . implode(', ', $set) |
|
461 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
460 | + . ' SET ' . implode(', ', $set) |
|
461 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
462 | 462 | |
463 | 463 | $result = $this->conn->executeUpdate($sql, $params, $types); |
464 | 464 | |
@@ -1626,9 +1626,9 @@ discard block |
||
1626 | 1626 | $lock = $this->getLockTablesSql($lockMode); |
1627 | 1627 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1628 | 1628 | $sql = 'SELECT 1 ' |
1629 | - . $lock |
|
1630 | - . $where |
|
1631 | - . $lockSql; |
|
1629 | + . $lock |
|
1630 | + . $where |
|
1631 | + . $lockSql; |
|
1632 | 1632 | |
1633 | 1633 | list($params, $types) = $this->expandParameters($criteria); |
1634 | 1634 | |
@@ -2107,8 +2107,8 @@ discard block |
||
2107 | 2107 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
2108 | 2108 | |
2109 | 2109 | $sql = 'SELECT 1 ' |
2110 | - . $this->getLockTablesSql(null) |
|
2111 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2110 | + . $this->getLockTablesSql(null) |
|
2111 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2112 | 2112 | |
2113 | 2113 | list($params, $types) = $this->expandParameters($criteria); |
2114 | 2114 | |
@@ -2142,9 +2142,9 @@ discard block |
||
2142 | 2142 | |
2143 | 2143 | // if one of the join columns is nullable, return left join |
2144 | 2144 | foreach ($association->getJoinColumns() as $joinColumn) { |
2145 | - if (! $joinColumn->isNullable()) { |
|
2146 | - continue; |
|
2147 | - } |
|
2145 | + if (! $joinColumn->isNullable()) { |
|
2146 | + continue; |
|
2147 | + } |
|
2148 | 2148 | |
2149 | 2149 | return 'LEFT JOIN'; |
2150 | 2150 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Persisters\Entity; |
23 | 23 | |
@@ -317,14 +317,14 @@ discard block |
||
317 | 317 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
318 | 318 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
319 | 319 | $identifier = array_map( |
320 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
320 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
321 | 321 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
322 | 322 | ); |
323 | 323 | |
324 | 324 | // FIXME: Order with composite keys might not be correct |
325 | - $sql = 'SELECT ' . $columnName |
|
326 | - . ' FROM ' . $tableName |
|
327 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
325 | + $sql = 'SELECT '.$columnName |
|
326 | + . ' FROM '.$tableName |
|
327 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
328 | 328 | |
329 | 329 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
330 | 330 | $versionType = $versionProperty->getType(); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | |
411 | 411 | if (($value = $identifier[$field]) !== null) { |
412 | 412 | // @todo guilhermeblanco Make sure we do not have flat association values. |
413 | - if (! is_array($value)) { |
|
413 | + if ( ! is_array($value)) { |
|
414 | 414 | $value = [$targetClass->identifier[0] => $value]; |
415 | 415 | } |
416 | 416 | |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $quotedJoinColumnName = $this->platform->quoteIdentifier($joinColumnName); |
424 | 424 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
425 | 425 | |
426 | - if (! $joinColumn->getType()) { |
|
426 | + if ( ! $joinColumn->getType()) { |
|
427 | 427 | $joinColumn->setType( |
428 | 428 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
429 | 429 | ); |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | $type = $column->getType(); |
466 | 466 | $placeholder = $type->convertToDatabaseValueSQL('?', $this->platform); |
467 | 467 | |
468 | - $set[] = $quotedColumnName . ' = ' . $placeholder; |
|
468 | + $set[] = $quotedColumnName.' = '.$placeholder; |
|
469 | 469 | $params[] = $value; |
470 | 470 | $types[] = $type; |
471 | 471 | } |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | /** @var JoinColumnMetadata $joinColumn */ |
492 | 492 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
493 | 493 | |
494 | - if (! $joinColumn->getType()) { |
|
494 | + if ( ! $joinColumn->getType()) { |
|
495 | 495 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
496 | 496 | |
497 | 497 | $joinColumn->setType( |
@@ -520,18 +520,18 @@ discard block |
||
520 | 520 | case Type::SMALLINT: |
521 | 521 | case Type::INTEGER: |
522 | 522 | case Type::BIGINT: |
523 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
523 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
524 | 524 | break; |
525 | 525 | |
526 | 526 | case Type::DATETIME: |
527 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
527 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
528 | 528 | break; |
529 | 529 | } |
530 | 530 | } |
531 | 531 | |
532 | - $sql = 'UPDATE ' . $quotedTableName |
|
533 | - . ' SET ' . implode(', ', $set) |
|
534 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
532 | + $sql = 'UPDATE '.$quotedTableName |
|
533 | + . ' SET '.implode(', ', $set) |
|
534 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
535 | 535 | |
536 | 536 | $result = $this->conn->executeUpdate($sql, $params, $types); |
537 | 537 | |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | protected function deleteJoinTableRecords($identifier) |
551 | 551 | { |
552 | 552 | foreach ($this->class->getProperties() as $association) { |
553 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
553 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
554 | 554 | continue; |
555 | 555 | } |
556 | 556 | |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | $keys = []; |
564 | 564 | |
565 | 565 | if ( ! $owningAssociation->isOwningSide()) { |
566 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
566 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
567 | 567 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
568 | 568 | } |
569 | 569 | |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | } |
676 | 676 | |
677 | 677 | // Only owning side of x-1 associations can have a FK column. |
678 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
678 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
679 | 679 | continue; |
680 | 680 | } |
681 | 681 | |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | /** @var JoinColumnMetadata $joinColumn */ |
696 | 696 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
697 | 697 | |
698 | - if (! $joinColumn->getType()) { |
|
698 | + if ( ! $joinColumn->getType()) { |
|
699 | 699 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
700 | 700 | |
701 | 701 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | $propertyName = $this->class->fieldNames[$columnName]; |
727 | 727 | $property = $this->class->getProperty($propertyName); |
728 | 728 | |
729 | - if (! $property) { |
|
729 | + if ( ! $property) { |
|
730 | 730 | return null; |
731 | 731 | } |
732 | 732 | |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | /** @var JoinColumnMetadata $joinColumn */ |
745 | 745 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
746 | 746 | |
747 | - if (! $joinColumn->getType()) { |
|
747 | + if ( ! $joinColumn->getType()) { |
|
748 | 748 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
749 | 749 | |
750 | 750 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | // unset the old value and set the new sql aliased value here. By definition |
864 | 864 | // unset($identifier[$targetKeyColumn] works here with how UnitOfWork::createEntity() calls this method. |
865 | 865 | // @todo guilhermeblanco In master we have: $identifier[$targetClass->getFieldForColumn($targetKeyColumn)] = |
866 | - $identifier[$targetTableAlias . "." . $targetKeyColumn] = $value; |
|
866 | + $identifier[$targetTableAlias.".".$targetKeyColumn] = $value; |
|
867 | 867 | |
868 | 868 | unset($identifier[$targetKeyColumn]); |
869 | 869 | } |
@@ -1083,7 +1083,7 @@ discard block |
||
1083 | 1083 | $criteria = []; |
1084 | 1084 | $parameters = []; |
1085 | 1085 | |
1086 | - if (! $association->isOwningSide()) { |
|
1086 | + if ( ! $association->isOwningSide()) { |
|
1087 | 1087 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1088 | 1088 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1089 | 1089 | } |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | $value = $value[$targetClass->identifier[0]]; |
1112 | 1112 | } |
1113 | 1113 | |
1114 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1114 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1115 | 1115 | $parameters[] = [ |
1116 | 1116 | 'value' => $value, |
1117 | 1117 | 'field' => $fieldName, |
@@ -1162,11 +1162,11 @@ discard block |
||
1162 | 1162 | |
1163 | 1163 | switch ($lockMode) { |
1164 | 1164 | case LockMode::PESSIMISTIC_READ: |
1165 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1165 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1166 | 1166 | break; |
1167 | 1167 | |
1168 | 1168 | case LockMode::PESSIMISTIC_WRITE: |
1169 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1169 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1170 | 1170 | break; |
1171 | 1171 | } |
1172 | 1172 | |
@@ -1177,14 +1177,14 @@ discard block |
||
1177 | 1177 | |
1178 | 1178 | if ('' !== $filterSql) { |
1179 | 1179 | $conditionSql = $conditionSql |
1180 | - ? $conditionSql . ' AND ' . $filterSql |
|
1180 | + ? $conditionSql.' AND '.$filterSql |
|
1181 | 1181 | : $filterSql; |
1182 | 1182 | } |
1183 | 1183 | |
1184 | - $select = 'SELECT ' . $columnList; |
|
1185 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1186 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1187 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1184 | + $select = 'SELECT '.$columnList; |
|
1185 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1186 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1187 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1188 | 1188 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1189 | 1189 | $query = $select |
1190 | 1190 | . $lock |
@@ -1192,7 +1192,7 @@ discard block |
||
1192 | 1192 | . $where |
1193 | 1193 | . $orderBySql; |
1194 | 1194 | |
1195 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1195 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1196 | 1196 | } |
1197 | 1197 | |
1198 | 1198 | /** |
@@ -1211,13 +1211,13 @@ discard block |
||
1211 | 1211 | |
1212 | 1212 | if ('' !== $filterSql) { |
1213 | 1213 | $conditionSql = $conditionSql |
1214 | - ? $conditionSql . ' AND ' . $filterSql |
|
1214 | + ? $conditionSql.' AND '.$filterSql |
|
1215 | 1215 | : $filterSql; |
1216 | 1216 | } |
1217 | 1217 | |
1218 | 1218 | $sql = 'SELECT COUNT(*) ' |
1219 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1220 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1219 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1220 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1221 | 1221 | |
1222 | 1222 | return $sql; |
1223 | 1223 | } |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | */ |
1235 | 1235 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
1236 | 1236 | { |
1237 | - if (! $orderBy) { |
|
1237 | + if ( ! $orderBy) { |
|
1238 | 1238 | return ''; |
1239 | 1239 | } |
1240 | 1240 | |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | foreach ($orderBy as $fieldName => $orientation) { |
1244 | 1244 | $orientation = strtoupper(trim($orientation)); |
1245 | 1245 | |
1246 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
1246 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
1247 | 1247 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
1248 | 1248 | } |
1249 | 1249 | |
@@ -1253,11 +1253,11 @@ discard block |
||
1253 | 1253 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1254 | 1254 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1255 | 1255 | |
1256 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1256 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1257 | 1257 | |
1258 | 1258 | continue; |
1259 | 1259 | } else if ($property instanceof AssociationMetadata) { |
1260 | - if (! $property->isOwningSide()) { |
|
1260 | + if ( ! $property->isOwningSide()) { |
|
1261 | 1261 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName); |
1262 | 1262 | } |
1263 | 1263 | |
@@ -1270,7 +1270,7 @@ discard block |
||
1270 | 1270 | /* @var JoinColumnMetadata $joinColumn */ |
1271 | 1271 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1272 | 1272 | |
1273 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1273 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1274 | 1274 | } |
1275 | 1275 | |
1276 | 1276 | continue; |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | throw ORMException::unrecognizedField($fieldName); |
1280 | 1280 | } |
1281 | 1281 | |
1282 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1282 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1283 | 1283 | } |
1284 | 1284 | |
1285 | 1285 | /** |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | |
1302 | 1302 | |
1303 | 1303 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
1304 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1304 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1305 | 1305 | |
1306 | 1306 | $eagerAliasCounter = 0; |
1307 | 1307 | $columnList = []; |
@@ -1337,7 +1337,7 @@ discard block |
||
1337 | 1337 | break; // now this is why you shouldn't use inheritance |
1338 | 1338 | } |
1339 | 1339 | |
1340 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1340 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1341 | 1341 | |
1342 | 1342 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1343 | 1343 | |
@@ -1361,14 +1361,14 @@ discard block |
||
1361 | 1361 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1362 | 1362 | } |
1363 | 1363 | |
1364 | - if (! $property->isOwningSide()) { |
|
1364 | + if ( ! $property->isOwningSide()) { |
|
1365 | 1365 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1366 | 1366 | } |
1367 | 1367 | |
1368 | 1368 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1369 | 1369 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1370 | 1370 | |
1371 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1371 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1372 | 1372 | |
1373 | 1373 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1374 | 1374 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1390,7 +1390,7 @@ discard block |
||
1390 | 1390 | $joinCondition[] = $filterSql; |
1391 | 1391 | } |
1392 | 1392 | |
1393 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1393 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1394 | 1394 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1395 | 1395 | |
1396 | 1396 | break; |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | */ |
1415 | 1415 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1416 | 1416 | { |
1417 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1417 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1418 | 1418 | return ''; |
1419 | 1419 | } |
1420 | 1420 | |
@@ -1427,7 +1427,7 @@ discard block |
||
1427 | 1427 | $quotedColumnName = $this->platform->quoteIdentifier($columnName); |
1428 | 1428 | $resultColumnName = $this->getSQLColumnAlias(); |
1429 | 1429 | |
1430 | - if (! $joinColumn->getType()) { |
|
1430 | + if ( ! $joinColumn->getType()) { |
|
1431 | 1431 | $joinColumn->setType( |
1432 | 1432 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
1433 | 1433 | ); |
@@ -1461,7 +1461,7 @@ discard block |
||
1461 | 1461 | $owningAssociation = $association; |
1462 | 1462 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1463 | 1463 | |
1464 | - if (! $association->isOwningSide()) { |
|
1464 | + if ( ! $association->isOwningSide()) { |
|
1465 | 1465 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1466 | 1466 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1467 | 1467 | } |
@@ -1483,7 +1483,7 @@ discard block |
||
1483 | 1483 | ); |
1484 | 1484 | } |
1485 | 1485 | |
1486 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1486 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1487 | 1487 | } |
1488 | 1488 | |
1489 | 1489 | /** |
@@ -1577,7 +1577,7 @@ discard block |
||
1577 | 1577 | $columnName = $joinColumn->getColumnName(); |
1578 | 1578 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1579 | 1579 | |
1580 | - if (! $joinColumn->getType()) { |
|
1580 | + if ( ! $joinColumn->getType()) { |
|
1581 | 1581 | $joinColumn->setType( |
1582 | 1582 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
1583 | 1583 | ); |
@@ -1618,7 +1618,7 @@ discard block |
||
1618 | 1618 | |
1619 | 1619 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1620 | 1620 | |
1621 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1621 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1622 | 1622 | } |
1623 | 1623 | |
1624 | 1624 | /** |
@@ -1632,14 +1632,14 @@ discard block |
||
1632 | 1632 | protected function getSQLTableAlias($tableName, $assocName = '') |
1633 | 1633 | { |
1634 | 1634 | if ($tableName) { |
1635 | - $tableName .= '#' . $assocName; |
|
1635 | + $tableName .= '#'.$assocName; |
|
1636 | 1636 | } |
1637 | 1637 | |
1638 | 1638 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1639 | 1639 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1640 | 1640 | } |
1641 | 1641 | |
1642 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1642 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1643 | 1643 | |
1644 | 1644 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1645 | 1645 | |
@@ -1666,7 +1666,7 @@ discard block |
||
1666 | 1666 | } |
1667 | 1667 | |
1668 | 1668 | $lock = $this->getLockTablesSql($lockMode); |
1669 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1669 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1670 | 1670 | $sql = 'SELECT 1 ' |
1671 | 1671 | . $lock |
1672 | 1672 | . $where |
@@ -1689,7 +1689,7 @@ discard block |
||
1689 | 1689 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1690 | 1690 | |
1691 | 1691 | return $this->platform->appendLockHint( |
1692 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1692 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1693 | 1693 | $lockMode |
1694 | 1694 | ); |
1695 | 1695 | } |
@@ -1742,19 +1742,19 @@ discard block |
||
1742 | 1742 | |
1743 | 1743 | if (null !== $comparison) { |
1744 | 1744 | // special case null value handling |
1745 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1746 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1745 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1746 | + $selectedColumns[] = $column.' IS NULL'; |
|
1747 | 1747 | |
1748 | 1748 | continue; |
1749 | 1749 | } |
1750 | 1750 | |
1751 | 1751 | if ($comparison === Comparison::NEQ && null === $value) { |
1752 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1752 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1753 | 1753 | |
1754 | 1754 | continue; |
1755 | 1755 | } |
1756 | 1756 | |
1757 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1757 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1758 | 1758 | |
1759 | 1759 | continue; |
1760 | 1760 | } |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1804 | 1804 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1805 | 1805 | |
1806 | - return [$tableAlias . '.' . $columnName]; |
|
1806 | + return [$tableAlias.'.'.$columnName]; |
|
1807 | 1807 | } |
1808 | 1808 | |
1809 | 1809 | if ($property instanceof AssociationMetadata) { |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | |
1813 | 1813 | // Many-To-Many requires join table check for joinColumn |
1814 | 1814 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1815 | - if (! $owningAssociation->isOwningSide()) { |
|
1815 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1816 | 1816 | $owningAssociation = $association; |
1817 | 1817 | } |
1818 | 1818 | |
@@ -1826,15 +1826,15 @@ discard block |
||
1826 | 1826 | foreach ($joinColumns as $joinColumn) { |
1827 | 1827 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1828 | 1828 | |
1829 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1829 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1830 | 1830 | } |
1831 | 1831 | |
1832 | 1832 | } else { |
1833 | - if (! $owningAssociation->isOwningSide()) { |
|
1833 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1834 | 1834 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field); |
1835 | 1835 | } |
1836 | 1836 | |
1837 | - $class = $this->class->isInheritedProperty($field) |
|
1837 | + $class = $this->class->isInheritedProperty($field) |
|
1838 | 1838 | ? $owningAssociation->getDeclaringClass() |
1839 | 1839 | : $this->class |
1840 | 1840 | ; |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1844 | 1844 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1845 | 1845 | |
1846 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1846 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1847 | 1847 | } |
1848 | 1848 | } |
1849 | 1849 | |
@@ -1956,7 +1956,7 @@ discard block |
||
1956 | 1956 | $value = $value[$targetClass->identifier[0]]; |
1957 | 1957 | } |
1958 | 1958 | |
1959 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
1959 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
1960 | 1960 | $parameters[] = [ |
1961 | 1961 | 'value' => $value, |
1962 | 1962 | 'field' => $fieldName, |
@@ -2043,7 +2043,7 @@ discard block |
||
2043 | 2043 | case ($property instanceof AssociationMetadata): |
2044 | 2044 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2045 | 2045 | |
2046 | - if (! $property->isOwningSide()) { |
|
2046 | + if ( ! $property->isOwningSide()) { |
|
2047 | 2047 | $property = $class->getProperty($property->getMappedBy()); |
2048 | 2048 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2049 | 2049 | } |
@@ -2054,7 +2054,7 @@ discard block |
||
2054 | 2054 | ; |
2055 | 2055 | |
2056 | 2056 | foreach ($joinColumns as $joinColumn) { |
2057 | - if (! $joinColumn->getType()) { |
|
2057 | + if ( ! $joinColumn->getType()) { |
|
2058 | 2058 | $joinColumn->setType( |
2059 | 2059 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $class, $this->em) |
2060 | 2060 | ); |
@@ -2071,7 +2071,7 @@ discard block |
||
2071 | 2071 | } |
2072 | 2072 | |
2073 | 2073 | if (is_array($value)) { |
2074 | - return array_map(function ($type) { |
|
2074 | + return array_map(function($type) { |
|
2075 | 2075 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2076 | 2076 | }, $types); |
2077 | 2077 | } |
@@ -2150,12 +2150,12 @@ discard block |
||
2150 | 2150 | |
2151 | 2151 | $sql = 'SELECT 1 ' |
2152 | 2152 | . $this->getLockTablesSql(null) |
2153 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2153 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2154 | 2154 | |
2155 | 2155 | list($params, $types) = $this->expandParameters($criteria); |
2156 | 2156 | |
2157 | 2157 | if (null !== $extraConditions) { |
2158 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2158 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2159 | 2159 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2160 | 2160 | |
2161 | 2161 | $params = array_merge($params, $criteriaParams); |
@@ -2163,7 +2163,7 @@ discard block |
||
2163 | 2163 | } |
2164 | 2164 | |
2165 | 2165 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2166 | - $sql .= ' AND ' . $filterSql; |
|
2166 | + $sql .= ' AND '.$filterSql; |
|
2167 | 2167 | } |
2168 | 2168 | |
2169 | 2169 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2178,13 +2178,13 @@ discard block |
||
2178 | 2178 | */ |
2179 | 2179 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2180 | 2180 | { |
2181 | - if (! $association->isOwningSide()) { |
|
2181 | + if ( ! $association->isOwningSide()) { |
|
2182 | 2182 | return 'LEFT JOIN'; |
2183 | 2183 | } |
2184 | 2184 | |
2185 | 2185 | // if one of the join columns is nullable, return left join |
2186 | 2186 | foreach ($association->getJoinColumns() as $joinColumn) { |
2187 | - if (! $joinColumn->isNullable()) { |
|
2187 | + if ( ! $joinColumn->isNullable()) { |
|
2188 | 2188 | continue; |
2189 | 2189 | } |
2190 | 2190 | |
@@ -2201,7 +2201,7 @@ discard block |
||
2201 | 2201 | */ |
2202 | 2202 | public function getSQLColumnAlias() |
2203 | 2203 | { |
2204 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2204 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2205 | 2205 | } |
2206 | 2206 | |
2207 | 2207 | /** |
@@ -2218,13 +2218,13 @@ discard block |
||
2218 | 2218 | |
2219 | 2219 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2220 | 2220 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2221 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2221 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2222 | 2222 | } |
2223 | 2223 | } |
2224 | 2224 | |
2225 | 2225 | $sql = implode(' AND ', $filterClauses); |
2226 | 2226 | |
2227 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2227 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2228 | 2228 | } |
2229 | 2229 | |
2230 | 2230 | /** |
@@ -25,8 +25,6 @@ |
||
25 | 25 | use Doctrine\DBAL\LockMode; |
26 | 26 | use Doctrine\DBAL\Types\Type; |
27 | 27 | use Doctrine\ORM\Mapping\AssociationMetadata; |
28 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
29 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
30 | 28 | use Doctrine\ORM\Mapping\FieldMetadata; |
31 | 29 | use Doctrine\ORM\Mapping\GeneratorType; |
32 | 30 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Persisters\Entity; |
23 | 23 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | foreach ($data as $columnName => $value) { |
131 | - if (!is_array($id) || !isset($id[$columnName])) { |
|
131 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
132 | 132 | $type = $this->columns[$columnName]->getType(); |
133 | 133 | |
134 | 134 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | if ($filterSql = $this->generateFilterConditionSQL($rootClass, $tableAlias)) { |
254 | 254 | $conditionSql .= $conditionSql |
255 | - ? ' AND ' . $filterSql |
|
255 | + ? ' AND '.$filterSql |
|
256 | 256 | : $filterSql; |
257 | 257 | } |
258 | 258 | |
@@ -260,26 +260,26 @@ discard block |
||
260 | 260 | |
261 | 261 | switch ($lockMode) { |
262 | 262 | case LockMode::PESSIMISTIC_READ: |
263 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
263 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
264 | 264 | break; |
265 | 265 | |
266 | 266 | case LockMode::PESSIMISTIC_WRITE: |
267 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
267 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
268 | 268 | break; |
269 | 269 | } |
270 | 270 | |
271 | 271 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
272 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
273 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
272 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
273 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
274 | 274 | $lock = $this->platform->appendLockHint($from, $lockMode); |
275 | 275 | $columnList = $this->getSelectColumnsSQL(); |
276 | - $query = 'SELECT ' . $columnList |
|
276 | + $query = 'SELECT '.$columnList |
|
277 | 277 | . $lock |
278 | 278 | . $joinSql |
279 | 279 | . $where |
280 | 280 | . $orderBySql; |
281 | 281 | |
282 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
282 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
@@ -301,14 +301,14 @@ discard block |
||
301 | 301 | |
302 | 302 | if ('' !== $filterSql) { |
303 | 303 | $conditionSql = $conditionSql |
304 | - ? $conditionSql . ' AND ' . $filterSql |
|
304 | + ? $conditionSql.' AND '.$filterSql |
|
305 | 305 | : $filterSql; |
306 | 306 | } |
307 | 307 | |
308 | 308 | $sql = 'SELECT COUNT(*) ' |
309 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
309 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
310 | 310 | . $joinSql |
311 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
311 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
312 | 312 | |
313 | 313 | return $sql; |
314 | 314 | } |
@@ -328,18 +328,18 @@ discard block |
||
328 | 328 | $parentClass = $this->em->getClassMetadata($parentClassName); |
329 | 329 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
330 | 330 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
331 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
331 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
332 | 332 | |
333 | 333 | foreach ($identifierColumns as $idColumn) { |
334 | 334 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
335 | 335 | |
336 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
336 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | $joinSql .= implode(' AND ', $conditions); |
340 | 340 | } |
341 | 341 | |
342 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
342 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -366,14 +366,14 @@ discard block |
||
366 | 366 | continue; |
367 | 367 | } |
368 | 368 | |
369 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
369 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
370 | 370 | continue; |
371 | 371 | } |
372 | 372 | |
373 | 373 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
374 | 374 | |
375 | 375 | foreach ($property->getJoinColumns() as $joinColumn) { |
376 | - if (! $joinColumn->getType()) { |
|
376 | + if ( ! $joinColumn->getType()) { |
|
377 | 377 | $joinColumn->setType( |
378 | 378 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
379 | 379 | ); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
394 | 394 | |
395 | 395 | $columnList[] = $discrColumnType->convertToDatabaseValueSQL( |
396 | - $this->getSQLTableAlias($discrColumn->getTableName()) . '.' . $discrColumnName, |
|
396 | + $this->getSQLTableAlias($discrColumn->getTableName()).'.'.$discrColumnName, |
|
397 | 397 | $this->platform |
398 | 398 | ); |
399 | 399 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
421 | 421 | |
422 | 422 | foreach ($property->getJoinColumns() as $joinColumn) { |
423 | - if (! $joinColumn->getType()) { |
|
423 | + if ( ! $joinColumn->getType()) { |
|
424 | 424 | $joinColumn->setType( |
425 | 425 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
426 | 426 | ); |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | $columnName = $joinColumn->getColumnName(); |
469 | 469 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
470 | 470 | |
471 | - if (! $joinColumn->getType()) { |
|
471 | + if ( ! $joinColumn->getType()) { |
|
472 | 472 | $joinColumn->setType( |
473 | 473 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
474 | 474 | ); |
@@ -526,12 +526,12 @@ discard block |
||
526 | 526 | $parentClass = $this->em->getClassMetadata($parentClassName); |
527 | 527 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
528 | 528 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
529 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
529 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
530 | 530 | |
531 | 531 | foreach ($identifierColumns as $idColumn) { |
532 | 532 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
533 | 533 | |
534 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
534 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | $joinSql .= implode(' AND ', $conditions); |
@@ -543,12 +543,12 @@ discard block |
||
543 | 543 | $subClass = $this->em->getClassMetadata($subClassName); |
544 | 544 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
545 | 545 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
546 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
546 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
547 | 547 | |
548 | 548 | foreach ($identifierColumns as $idColumn) { |
549 | 549 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
550 | 550 | |
551 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
551 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | $joinSql .= implode(' AND ', $conditions); |