@@ -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 | */ |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Mapping; |
7 | 7 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | * |
314 | 314 | * @return void |
315 | 315 | */ |
316 | - public function setCache(?CacheMetadata $cache = null) |
|
316 | + public function setCache(? CacheMetadata $cache = null) |
|
317 | 317 | { |
318 | 318 | $this->cache = $cache; |
319 | 319 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | /** |
322 | 322 | * @return CacheMetadata|null |
323 | 323 | */ |
324 | - public function getCache(): ?CacheMetadata |
|
324 | + public function getCache(): ? CacheMetadata |
|
325 | 325 | { |
326 | 326 | return $this->cache; |
327 | 327 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | /** |
330 | 330 | * @return \ReflectionClass|null |
331 | 331 | */ |
332 | - public function getReflectionClass() : ?\ReflectionClass |
|
332 | + public function getReflectionClass() : ? \ReflectionClass |
|
333 | 333 | { |
334 | 334 | return $this->reflectionClass; |
335 | 335 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function __toString() |
359 | 359 | { |
360 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
360 | + return __CLASS__.'@'.spl_object_hash($this); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | // Restore ReflectionClass and properties |
462 | 462 | $this->reflectionClass = $reflService->getClass($this->name); |
463 | 463 | |
464 | - if (! $this->reflectionClass) { |
|
464 | + if ( ! $this->reflectionClass) { |
|
465 | 465 | return; |
466 | 466 | } |
467 | 467 | |
@@ -536,11 +536,11 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | // Verify & complete identifier mapping |
539 | - if (! $this->identifier) { |
|
539 | + if ( ! $this->identifier) { |
|
540 | 540 | throw MappingException::identifierRequired($this->name); |
541 | 541 | } |
542 | 542 | |
543 | - $explicitlyGeneratedProperties = array_filter($this->properties, function (Property $property) : bool { |
|
543 | + $explicitlyGeneratedProperties = array_filter($this->properties, function(Property $property) : bool { |
|
544 | 544 | return $property instanceof FieldMetadata |
545 | 545 | && $property->isPrimaryKey() |
546 | 546 | && $property->hasValueGenerator(); |
@@ -561,8 +561,8 @@ discard block |
||
561 | 561 | public function validateAssociations() |
562 | 562 | { |
563 | 563 | array_map( |
564 | - function (Property $property) { |
|
565 | - if (! ($property instanceof AssociationMetadata)) { |
|
564 | + function(Property $property) { |
|
565 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
566 | 566 | return; |
567 | 567 | } |
568 | 568 | |
@@ -618,11 +618,11 @@ discard block |
||
618 | 618 | */ |
619 | 619 | public function isIdentifier($fieldName) |
620 | 620 | { |
621 | - if (! $this->identifier) { |
|
621 | + if ( ! $this->identifier) { |
|
622 | 622 | return false; |
623 | 623 | } |
624 | 624 | |
625 | - if (! $this->isIdentifierComposite()) { |
|
625 | + if ( ! $this->isIdentifierComposite()) { |
|
626 | 626 | return $fieldName === $this->identifier[0]; |
627 | 627 | } |
628 | 628 | |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | */ |
651 | 651 | public function getNamedQuery($queryName) |
652 | 652 | { |
653 | - if (! isset($this->namedQueries[$queryName])) { |
|
653 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
654 | 654 | throw MappingException::queryNotFound($this->name, $queryName); |
655 | 655 | } |
656 | 656 | |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | */ |
711 | 711 | public function getSqlResultSetMapping($name) |
712 | 712 | { |
713 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
713 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
714 | 714 | throw MappingException::resultMappingNotFound($this->name, $name); |
715 | 715 | } |
716 | 716 | |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | $property->setColumnName($columnName); |
746 | 746 | } |
747 | 747 | |
748 | - if (! $this->isMappedSuperclass) { |
|
748 | + if ( ! $this->isMappedSuperclass) { |
|
749 | 749 | $property->setTableName($this->getTableName()); |
750 | 750 | } |
751 | 751 | |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
766 | 766 | }; |
767 | 767 | |
768 | - if (! in_array($fieldName, $this->identifier)) { |
|
768 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
769 | 769 | $this->identifier[] = $fieldName; |
770 | 770 | } |
771 | 771 | } |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | $fieldName = $property->getName(); |
820 | 820 | $targetEntity = $property->getTargetEntity(); |
821 | 821 | |
822 | - if (! $targetEntity) { |
|
822 | + if ( ! $targetEntity) { |
|
823 | 823 | throw MappingException::missingTargetEntity($fieldName); |
824 | 824 | } |
825 | 825 | |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | $this->identifier[] = $property->getName(); |
851 | 851 | } |
852 | 852 | |
853 | - if ($this->cache && !$property->getCache()) { |
|
853 | + if ($this->cache && ! $property->getCache()) { |
|
854 | 854 | throw CacheException::nonCacheableEntityAssociation($this->name, $fieldName); |
855 | 855 | } |
856 | 856 | |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | foreach ($property->getJoinColumns() as $joinColumn) { |
904 | 904 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
905 | 905 | if (1 === count($property->getJoinColumns())) { |
906 | - if (! $property->isPrimaryKey()) { |
|
906 | + if ( ! $property->isPrimaryKey()) { |
|
907 | 907 | $joinColumn->setUnique(true); |
908 | 908 | } |
909 | 909 | } else { |
@@ -911,13 +911,13 @@ discard block |
||
911 | 911 | } |
912 | 912 | } |
913 | 913 | |
914 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
914 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
915 | 915 | |
916 | - if (! $joinColumn->getColumnName()) { |
|
916 | + if ( ! $joinColumn->getColumnName()) { |
|
917 | 917 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->name)); |
918 | 918 | } |
919 | 919 | |
920 | - if (! $joinColumn->getReferencedColumnName()) { |
|
920 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
921 | 921 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
922 | 922 | } |
923 | 923 | |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | if ($property->isOrphanRemoval()) { |
946 | 946 | $cascades = $property->getCascade(); |
947 | 947 | |
948 | - if (! in_array('remove', $cascades)) { |
|
948 | + if ( ! in_array('remove', $cascades)) { |
|
949 | 949 | $cascades[] = 'remove'; |
950 | 950 | |
951 | 951 | $property->setCascade($cascades); |
@@ -1013,14 +1013,14 @@ discard block |
||
1013 | 1013 | $property->setOwningSide(false); |
1014 | 1014 | |
1015 | 1015 | // OneToMany MUST have mappedBy |
1016 | - if (! $property->getMappedBy()) { |
|
1016 | + if ( ! $property->getMappedBy()) { |
|
1017 | 1017 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | if ($property->isOrphanRemoval()) { |
1021 | 1021 | $cascades = $property->getCascade(); |
1022 | 1022 | |
1023 | - if (! in_array('remove', $cascades)) { |
|
1023 | + if ( ! in_array('remove', $cascades)) { |
|
1024 | 1024 | $cascades[] = 'remove'; |
1025 | 1025 | |
1026 | 1026 | $property->setCascade($cascades); |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | |
1044 | 1044 | $property->setJoinTable($joinTable); |
1045 | 1045 | |
1046 | - if (! $joinTable->getName()) { |
|
1046 | + if ( ! $joinTable->getName()) { |
|
1047 | 1047 | $joinTableName = $this->namingStrategy->joinTableName( |
1048 | 1048 | $property->getSourceEntity(), |
1049 | 1049 | $property->getTargetEntity(), |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | |
1056 | 1056 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
1057 | 1057 | |
1058 | - if (! $joinTable->getJoinColumns()) { |
|
1058 | + if ( ! $joinTable->getJoinColumns()) { |
|
1059 | 1059 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
1060 | 1060 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
1061 | 1061 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | $joinTable->addJoinColumn($joinColumn); |
1069 | 1069 | } |
1070 | 1070 | |
1071 | - if (! $joinTable->getInverseJoinColumns()) { |
|
1071 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
1072 | 1072 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
1073 | 1073 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
1074 | 1074 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -1082,13 +1082,13 @@ discard block |
||
1082 | 1082 | } |
1083 | 1083 | |
1084 | 1084 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
1085 | - if (! $joinColumn->getReferencedColumnName()) { |
|
1085 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
1086 | 1086 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1087 | 1087 | } |
1088 | 1088 | |
1089 | 1089 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1090 | 1090 | |
1091 | - if (! $joinColumn->getColumnName()) { |
|
1091 | + if ( ! $joinColumn->getColumnName()) { |
|
1092 | 1092 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1093 | 1093 | $property->getSourceEntity(), |
1094 | 1094 | $referencedColumnName |
@@ -1099,13 +1099,13 @@ discard block |
||
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
1102 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
1102 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
1103 | 1103 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
1107 | 1107 | |
1108 | - if (! $inverseJoinColumn->getColumnName()) { |
|
1108 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
1109 | 1109 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1110 | 1110 | $property->getTargetEntity(), |
1111 | 1111 | $referencedColumnName |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | // Association defined as Id field |
1199 | 1199 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1200 | 1200 | |
1201 | - if (! $property->isOwningSide()) { |
|
1201 | + if ( ! $property->isOwningSide()) { |
|
1202 | 1202 | $property = $targetClass->getProperty($property->getMappedBy()); |
1203 | 1203 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1204 | 1204 | } |
@@ -1249,11 +1249,11 @@ discard block |
||
1249 | 1249 | { |
1250 | 1250 | $schema = empty($this->getSchemaName()) |
1251 | 1251 | ? '' |
1252 | - : $this->getSchemaName() . '_' |
|
1252 | + : $this->getSchemaName().'_' |
|
1253 | 1253 | ; |
1254 | 1254 | |
1255 | 1255 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
1256 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
1256 | + return $schema.$this->getTableName().'_id_tmp'; |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | /** |
@@ -1339,7 +1339,7 @@ discard block |
||
1339 | 1339 | { |
1340 | 1340 | $fieldName = $property->getName(); |
1341 | 1341 | |
1342 | - if (! isset($this->properties[$fieldName])) { |
|
1342 | + if ( ! isset($this->properties[$fieldName])) { |
|
1343 | 1343 | throw MappingException::invalidOverrideFieldName($this->name, $fieldName); |
1344 | 1344 | } |
1345 | 1345 | |
@@ -1459,7 +1459,7 @@ discard block |
||
1459 | 1459 | * |
1460 | 1460 | * @return LocalColumnMetadata|null |
1461 | 1461 | */ |
1462 | - public function getColumn(string $columnName): ?LocalColumnMetadata |
|
1462 | + public function getColumn(string $columnName): ? LocalColumnMetadata |
|
1463 | 1463 | { |
1464 | 1464 | foreach ($this->properties as $property) { |
1465 | 1465 | if ($property instanceof LocalColumnMetadata && $property->getColumnName() === $columnName) { |
@@ -1566,7 +1566,7 @@ discard block |
||
1566 | 1566 | $declaringClass = $property->getDeclaringClass(); |
1567 | 1567 | |
1568 | 1568 | if ($inheritedProperty instanceof FieldMetadata) { |
1569 | - if (! $declaringClass->isMappedSuperclass) { |
|
1569 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1570 | 1570 | $inheritedProperty->setTableName($property->getTableName()); |
1571 | 1571 | } |
1572 | 1572 | |
@@ -1624,7 +1624,7 @@ discard block |
||
1624 | 1624 | throw MappingException::duplicateQueryMapping($this->name, $name); |
1625 | 1625 | } |
1626 | 1626 | |
1627 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1627 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1628 | 1628 | throw MappingException::missingQueryMapping($this->name, $name); |
1629 | 1629 | } |
1630 | 1630 | |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | */ |
1648 | 1648 | public function addSqlResultSetMapping(array $resultMapping) |
1649 | 1649 | { |
1650 | - if (!isset($resultMapping['name'])) { |
|
1650 | + if ( ! isset($resultMapping['name'])) { |
|
1651 | 1651 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
1652 | 1652 | } |
1653 | 1653 | |
@@ -1657,7 +1657,7 @@ discard block |
||
1657 | 1657 | |
1658 | 1658 | if (isset($resultMapping['entities'])) { |
1659 | 1659 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
1660 | - if (! isset($entityResult['entityClass'])) { |
|
1660 | + if ( ! isset($entityResult['entityClass'])) { |
|
1661 | 1661 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
1662 | 1662 | } |
1663 | 1663 | |
@@ -1670,11 +1670,11 @@ discard block |
||
1670 | 1670 | |
1671 | 1671 | if (isset($entityResult['fields'])) { |
1672 | 1672 | foreach ($entityResult['fields'] as $k => $field) { |
1673 | - if (! isset($field['name'])) { |
|
1673 | + if ( ! isset($field['name'])) { |
|
1674 | 1674 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
1675 | 1675 | } |
1676 | 1676 | |
1677 | - if (! isset($field['column'])) { |
|
1677 | + if ( ! isset($field['column'])) { |
|
1678 | 1678 | $fieldName = $field['name']; |
1679 | 1679 | |
1680 | 1680 | if (strpos($fieldName, '.')) { |
@@ -1698,7 +1698,7 @@ discard block |
||
1698 | 1698 | * |
1699 | 1699 | * @return void |
1700 | 1700 | */ |
1701 | - public function setCustomRepositoryClassName(?string $repositoryClassName) |
|
1701 | + public function setCustomRepositoryClassName(? string $repositoryClassName) |
|
1702 | 1702 | { |
1703 | 1703 | $this->customRepositoryClassName = $repositoryClassName; |
1704 | 1704 | } |
@@ -1706,7 +1706,7 @@ discard block |
||
1706 | 1706 | /** |
1707 | 1707 | * @return string|null |
1708 | 1708 | */ |
1709 | - public function getCustomRepositoryClassName() : ?string |
|
1709 | + public function getCustomRepositoryClassName() : ? string |
|
1710 | 1710 | { |
1711 | 1711 | return $this->customRepositoryClassName; |
1712 | 1712 | } |
@@ -1781,11 +1781,11 @@ discard block |
||
1781 | 1781 | 'method' => $method, |
1782 | 1782 | ]; |
1783 | 1783 | |
1784 | - if (! class_exists($class)) { |
|
1784 | + if ( ! class_exists($class)) { |
|
1785 | 1785 | throw MappingException::entityListenerClassNotFound($class, $this->name); |
1786 | 1786 | } |
1787 | 1787 | |
1788 | - if (! method_exists($class, $method)) { |
|
1788 | + if ( ! method_exists($class, $method)) { |
|
1789 | 1789 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->name); |
1790 | 1790 | } |
1791 | 1791 | |
@@ -1859,7 +1859,7 @@ discard block |
||
1859 | 1859 | return; |
1860 | 1860 | } |
1861 | 1861 | |
1862 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1862 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1863 | 1863 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->name); |
1864 | 1864 | } |
1865 | 1865 | |
@@ -1956,7 +1956,7 @@ discard block |
||
1956 | 1956 | $namespace = $this->reflectionClass->getNamespaceName(); |
1957 | 1957 | |
1958 | 1958 | if ($className !== null && strpos($className, '\\') === false && $namespace) { |
1959 | - return ltrim($namespace . '\\' . $className, '\\'); |
|
1959 | + return ltrim($namespace.'\\'.$className, '\\'); |
|
1960 | 1960 | } |
1961 | 1961 | |
1962 | 1962 | 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 | { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Mapping\Driver; |
6 | 6 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | return $this->classNames; |
76 | 76 | } |
77 | 77 | |
78 | - if (!$this->paths) { |
|
78 | + if ( ! $this->paths) { |
|
79 | 79 | throw MappingException::pathRequired(); |
80 | 80 | } |
81 | 81 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $includedFiles = []; |
84 | 84 | |
85 | 85 | foreach ($this->paths as $path) { |
86 | - if (!is_dir($path)) { |
|
86 | + if ( ! is_dir($path)) { |
|
87 | 87 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
88 | 88 | } |
89 | 89 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | foreach ($declared as $className) { |
109 | 109 | $rc = new \ReflectionClass($className); |
110 | 110 | $sourceFile = $rc->getFileName(); |
111 | - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { |
|
111 | + if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { |
|
112 | 112 | $classes[] = $className; |
113 | 113 | } |
114 | 114 | } |
@@ -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 | { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Mapping; |
7 | 7 |
@@ -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 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | use Doctrine\ORM\Mapping\AssociationMetadata; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | static public function scheduleInsertForManagedEntity($entity) |
23 | 23 | { |
24 | - return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
24 | + return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | static public function scheduleInsertForRemovedEntity($entity) |
33 | 33 | { |
34 | - return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
34 | + return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | static public function scheduleInsertTwice($entity) |
43 | 43 | { |
44 | - return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice."); |
|
44 | + return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice."); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | static public function entityWithoutIdentity($className, $entity) |
54 | 54 | { |
55 | 55 | return new self( |
56 | - "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " . |
|
56 | + "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ". |
|
57 | 57 | "id values set. It cannot be added to the identity map." |
58 | 58 | ); |
59 | 59 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | static public function readOnlyRequiresManagedEntity($entity) |
67 | 67 | { |
68 | - return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not"); |
|
68 | + return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not"); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | static public function entityNotManaged($entity) |
123 | 123 | { |
124 | - return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " . |
|
124 | + return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ". |
|
125 | 125 | "from the database or registered as new through EntityManager#persist"); |
126 | 126 | } |
127 | 127 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | static public function entityHasNoIdentity($entity, $operation) |
135 | 135 | { |
136 | - return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
136 | + return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | static public function entityIsRemoved($entity, $operation) |
146 | 146 | { |
147 | - return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
147 | + return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | static public function detachedEntityCannot($entity, $operation) |
157 | 157 | { |
158 | - return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation); |
|
158 | + return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public static function invalidObject($context, $given, $parameterIndex = 1) |
169 | 169 | { |
170 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
171 | - ' to be an entity object, '. gettype($given) . ' given.'); |
|
170 | + return new self($context.' expects parameter '.$parameterIndex. |
|
171 | + ' to be an entity object, '.gettype($given).' given.'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public static function invalidCompositeIdentifier() |
178 | 178 | { |
179 | - return new self("Binding an entity with a composite primary key to a query is not supported. " . |
|
179 | + return new self("Binding an entity with a composite primary key to a query is not supported. ". |
|
180 | 180 | "You should split the parameter into the explicit fields and bind them separately."); |
181 | 181 | } |
182 | 182 |
@@ -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 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | if ($entityManager !== self::$entityManager) { |
91 | 91 | throw new \RuntimeException( |
92 | - "Trying to use PersistentObject with different EntityManager instances. " . |
|
92 | + "Trying to use PersistentObject with different EntityManager instances. ". |
|
93 | 93 | "Was PersistentObject::setEntityManager() called?" |
94 | 94 | ); |
95 | 95 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $property = $this->cm->getProperty($field); |
116 | 116 | |
117 | - if (! $property) { |
|
117 | + if ( ! $property) { |
|
118 | 118 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
119 | 119 | } |
120 | 120 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | $property = $this->cm->getProperty($field); |
155 | 155 | |
156 | - if (! $property) { |
|
156 | + if ( ! $property) { |
|
157 | 157 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
158 | 158 | } |
159 | 159 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $mappedByField = $property->getMappedBy(); |
180 | 180 | $targetMetadata = self::$entityManager->getClassMetadata($property->getTargetEntity()); |
181 | 181 | $targetProperty = $targetMetadata->getProperty($mappedByField); |
182 | - $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField; |
|
182 | + $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField; |
|
183 | 183 | |
184 | 184 | $targetObject->$setterMethodName($this); |
185 | 185 | } |
@@ -201,21 +201,21 @@ discard block |
||
201 | 201 | |
202 | 202 | $property = $this->cm->getProperty($field); |
203 | 203 | |
204 | - if (! $property) { |
|
204 | + if ( ! $property) { |
|
205 | 205 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
206 | 206 | } |
207 | 207 | |
208 | - if (! ($property instanceof ToManyAssociationMetadata)) { |
|
208 | + if ( ! ($property instanceof ToManyAssociationMetadata)) { |
|
209 | 209 | throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getClassName()); |
210 | 210 | } |
211 | 211 | |
212 | 212 | $targetClassName = $property->getTargetEntity(); |
213 | 213 | |
214 | - if (! ($args[0] instanceof $targetClassName)) { |
|
214 | + if ( ! ($args[0] instanceof $targetClassName)) { |
|
215 | 215 | throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
216 | 216 | } |
217 | 217 | |
218 | - if (! ($this->$field instanceof Collection)) { |
|
218 | + if ( ! ($this->$field instanceof Collection)) { |
|
219 | 219 | $this->$field = new ArrayCollection($this->$field ?: []); |
220 | 220 | } |
221 | 221 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | return; |
240 | 240 | } |
241 | 241 | |
242 | - if (!self::$entityManager) { |
|
242 | + if ( ! self::$entityManager) { |
|
243 | 243 | throw new \RuntimeException("No runtime entity manager set. Call PersistentObject#setEntityManager()."); |
244 | 244 | } |
245 | 245 |
@@ -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; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Persisters\Collection; |
6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $association = $collection->getMapping(); |
33 | 33 | |
34 | - if (! $association->isOwningSide()) { |
|
34 | + if ( ! $association->isOwningSide()) { |
|
35 | 35 | return; // ignore inverse side |
36 | 36 | } |
37 | 37 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $association = $collection->getMapping(); |
58 | 58 | |
59 | - if (! $association->isOwningSide()) { |
|
59 | + if ( ! $association->isOwningSide()) { |
|
60 | 60 | return; // ignore inverse side |
61 | 61 | } |
62 | 62 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | { |
88 | 88 | $association = $collection->getMapping(); |
89 | 89 | |
90 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
90 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
91 | 91 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
92 | 92 | } |
93 | 93 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | : $association->getMappedBy() |
98 | 98 | ; |
99 | 99 | |
100 | - $criteria = [ |
|
100 | + $criteria = [ |
|
101 | 101 | $mappedKey => $collection->getOwner(), |
102 | 102 | $association->getIndexedBy() => $index, |
103 | 103 | ]; |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
134 | 134 | $referencedName = $joinColumn->getReferencedColumnName(); |
135 | 135 | |
136 | - if (! $joinColumn->getType()) { |
|
136 | + if ( ! $joinColumn->getType()) { |
|
137 | 137 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em)); |
138 | 138 | } |
139 | 139 | |
140 | - $conditions[] = 't.' . $quotedColumnName . ' = ?'; |
|
140 | + $conditions[] = 't.'.$quotedColumnName.' = ?'; |
|
141 | 141 | $params[] = $id[$sourceClass->fieldNames[$referencedName]]; |
142 | 142 | $types[] = $joinColumn->getType(); |
143 | 143 | } |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | }*/ |
167 | 167 | |
168 | 168 | $sql = 'SELECT COUNT(*)' |
169 | - . ' FROM ' . $joinTableName . ' t' |
|
169 | + . ' FROM '.$joinTableName.' t' |
|
170 | 170 | . $joinTargetEntitySQL |
171 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
171 | + . ' WHERE '.implode(' AND ', $conditions); |
|
172 | 172 | |
173 | 173 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
174 | 174 | } |
@@ -190,13 +190,13 @@ discard block |
||
190 | 190 | { |
191 | 191 | $association = $collection->getMapping(); |
192 | 192 | |
193 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
193 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
194 | 194 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
195 | 195 | } |
196 | 196 | |
197 | 197 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
198 | 198 | |
199 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
199 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
200 | 200 | |
201 | 201 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
202 | 202 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
214 | 214 | |
215 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
215 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
216 | 216 | |
217 | 217 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
218 | 218 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
230 | 230 | |
231 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
231 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
232 | 232 | |
233 | 233 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
234 | 234 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $onConditions = $this->getOnConditionSQL($association); |
247 | 247 | $whereClauses = $params = $types = []; |
248 | 248 | |
249 | - if (! $association->isOwningSide()) { |
|
249 | + if ( ! $association->isOwningSide()) { |
|
250 | 250 | $association = $targetClass->getProperty($association->getMappedBy()); |
251 | 251 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
252 | 252 | } else { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
258 | 258 | $referencedName = $joinColumn->getReferencedColumnName(); |
259 | 259 | |
260 | - if (! $joinColumn->getType()) { |
|
260 | + if ( ! $joinColumn->getType()) { |
|
261 | 261 | $joinColumn->setType( |
262 | 262 | PersisterHelper::getTypeOfColumn($referencedName, $ownerMetadata, $this->em) |
263 | 263 | ); |
@@ -287,11 +287,11 @@ discard block |
||
287 | 287 | |
288 | 288 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
289 | 289 | |
290 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
291 | - . ' FROM ' . $tableName . ' te' |
|
292 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
290 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
291 | + . ' FROM '.$tableName.' te' |
|
292 | + . ' JOIN '.$joinTableName.' t ON' |
|
293 | 293 | . implode(' AND ', $onConditions) |
294 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
294 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
295 | 295 | |
296 | 296 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
297 | 297 | $sql .= $this->getLimitSql($criteria); |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | |
329 | 329 | // A join is needed if there is filtering on the target entity |
330 | 330 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
331 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
332 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
331 | + $joinSql = ' JOIN '.$tableName.' te' |
|
332 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
333 | 333 | |
334 | 334 | return [$joinSql, $filterSql]; |
335 | 335 | } |
@@ -348,18 +348,18 @@ discard block |
||
348 | 348 | |
349 | 349 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
350 | 350 | if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
351 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
351 | + $filterClauses[] = '('.$filterExpr.')'; |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | |
355 | - if (! $filterClauses) { |
|
355 | + if ( ! $filterClauses) { |
|
356 | 356 | return ''; |
357 | 357 | } |
358 | 358 | |
359 | 359 | $filterSql = implode(' AND ', $filterClauses); |
360 | 360 | |
361 | 361 | return count($filterClauses) > 1 |
362 | - ? '(' . $filterSql . ')' |
|
362 | + ? '('.$filterSql.')' |
|
363 | 363 | : $filterSql |
364 | 364 | ; |
365 | 365 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
391 | 391 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
392 | 392 | |
393 | - $conditions[] = ' t.' . $quotedColumnName . ' = ' . 'te.' . $quotedReferencedColumnName; |
|
393 | + $conditions[] = ' t.'.$quotedColumnName.' = '.'te.'.$quotedReferencedColumnName; |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | return $conditions; |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
413 | 413 | } |
414 | 414 | |
415 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
415 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | /** |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
604 | 604 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
605 | 605 | |
606 | - if (! $owningAssociation->isOwningSide()) { |
|
606 | + if ( ! $owningAssociation->isOwningSide()) { |
|
607 | 607 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
608 | 608 | $joinTable = $owningAssociation->getJoinTable(); |
609 | 609 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | } |
616 | 616 | |
617 | 617 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
618 | - $quotedJoinTable = $joinTableName . ' t'; |
|
618 | + $quotedJoinTable = $joinTableName.' t'; |
|
619 | 619 | $whereClauses = []; |
620 | 620 | $params = []; |
621 | 621 | $types = []; |
@@ -628,39 +628,39 @@ discard block |
||
628 | 628 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
629 | 629 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
630 | 630 | |
631 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = ' . 'tr.' . $quotedReferencedColumnName; |
|
631 | + $joinConditions[] = ' t.'.$quotedColumnName.' = '.'tr.'.$quotedReferencedColumnName; |
|
632 | 632 | } |
633 | 633 | |
634 | 634 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
635 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
635 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
636 | 636 | $columnName = $targetClass->getProperty($indexBy)->getColumnName(); |
637 | 637 | |
638 | - $whereClauses[] = 'tr.' . $this->platform->quoteIdentifier($columnName) . ' = ?'; |
|
638 | + $whereClauses[] = 'tr.'.$this->platform->quoteIdentifier($columnName).' = ?'; |
|
639 | 639 | $params[] = $key; |
640 | 640 | $types[] = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em); |
641 | 641 | } |
642 | 642 | |
643 | 643 | foreach ($inverseJoinColumns as $joinColumn) { |
644 | - if (! $joinColumn->getType()) { |
|
644 | + if ( ! $joinColumn->getType()) { |
|
645 | 645 | $joinColumn->setType( |
646 | 646 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $sourceClass, $this->em) |
647 | 647 | ); |
648 | 648 | } |
649 | 649 | |
650 | - $whereClauses[] = 't.' . $this->platform->quoteIdentifier($joinColumn->getColumnName()) . ' = ?'; |
|
650 | + $whereClauses[] = 't.'.$this->platform->quoteIdentifier($joinColumn->getColumnName()).' = ?'; |
|
651 | 651 | $params[] = $id[$sourceClass->fieldNames[$joinColumn->getReferencedColumnName()]]; |
652 | 652 | $types[] = $joinColumn->getType(); |
653 | 653 | } |
654 | 654 | |
655 | 655 | if ( ! $joinNeeded) { |
656 | 656 | foreach ($joinColumns as $joinColumn) { |
657 | - if (! $joinColumn->getType()) { |
|
657 | + if ( ! $joinColumn->getType()) { |
|
658 | 658 | $joinColumn->setType( |
659 | 659 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
660 | 660 | ); |
661 | 661 | } |
662 | 662 | |
663 | - $whereClauses[] = 't.' . $this->platform->quoteIdentifier($joinColumn->getColumnName()) . ' = ?'; |
|
663 | + $whereClauses[] = 't.'.$this->platform->quoteIdentifier($joinColumn->getColumnName()).' = ?'; |
|
664 | 664 | $params[] = $key; |
665 | 665 | $types[] = $joinColumn->getType(); |
666 | 666 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
671 | 671 | |
672 | 672 | if ($filterSql) { |
673 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
673 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
674 | 674 | $whereClauses[] = $filterSql; |
675 | 675 | } |
676 | 676 | } |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | $association = $collection->getMapping(); |
695 | 695 | $owningAssociation = $association; |
696 | 696 | |
697 | - if (! $association->isOwningSide()) { |
|
697 | + if ( ! $association->isOwningSide()) { |
|
698 | 698 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
699 | 699 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
700 | 700 | $sourceId = $this->uow->getEntityIdentifier($element); |
@@ -719,13 +719,13 @@ discard block |
||
719 | 719 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
720 | 720 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
721 | 721 | |
722 | - if (! $joinColumn->getType()) { |
|
722 | + if ( ! $joinColumn->getType()) { |
|
723 | 723 | $joinColumn->setType( |
724 | 724 | PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em) |
725 | 725 | ); |
726 | 726 | } |
727 | 727 | |
728 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
728 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
729 | 729 | $params[] = $sourceId[$sourceClass->fieldNames[$referencedColumnName]]; |
730 | 730 | $types[] = $joinColumn->getType(); |
731 | 731 | } |
@@ -734,13 +734,13 @@ discard block |
||
734 | 734 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
735 | 735 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
736 | 736 | |
737 | - if (! $joinColumn->getType()) { |
|
737 | + if ( ! $joinColumn->getType()) { |
|
738 | 738 | $joinColumn->setType( |
739 | 739 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
740 | 740 | ); |
741 | 741 | } |
742 | 742 | |
743 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
743 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
744 | 744 | $params[] = $targetId[$targetClass->fieldNames[$referencedColumnName]]; |
745 | 745 | $types[] = $joinColumn->getType(); |
746 | 746 | } |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
752 | 752 | |
753 | 753 | if ($filterSql) { |
754 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
754 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
755 | 755 | $whereClauses[] = $filterSql; |
756 | 756 | } |
757 | 757 | } |
@@ -800,10 +800,10 @@ discard block |
||
800 | 800 | $property = $targetClass->getProperty($name); |
801 | 801 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
802 | 802 | |
803 | - $orderBy[] = $columnName . ' ' . $direction; |
|
803 | + $orderBy[] = $columnName.' '.$direction; |
|
804 | 804 | } |
805 | 805 | |
806 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
806 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
807 | 807 | } |
808 | 808 | return ''; |
809 | 809 | } |
@@ -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(); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Persisters\Collection; |
6 | 6 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // the entire collection with a new would trigger this operation. |
31 | 31 | $association = $collection->getMapping(); |
32 | 32 | |
33 | - if (! $association->isOrphanRemoval()) { |
|
33 | + if ( ! $association->isOrphanRemoval()) { |
|
34 | 34 | // Handling non-orphan removal should never happen, as @OneToMany |
35 | 35 | // can only be inverse side. For owning side one to many, it is |
36 | 36 | // required to have a join table, which would classify as a ManyToManyPersister. |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $association = $collection->getMapping(); |
64 | 64 | |
65 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
65 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
66 | 66 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
67 | 67 | } |
68 | 68 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $association = $collection->getMapping(); |
113 | 113 | |
114 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
114 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
115 | 115 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
116 | 116 | } |
117 | 117 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | // only works with single id identifier entities. Will throw an |
121 | 121 | // exception in Entity Persisters if that is not the case for the |
122 | 122 | // 'mappedBy' field. |
123 | - $criteria = [ |
|
123 | + $criteria = [ |
|
124 | 124 | $association->getMappedBy() => $collection->getOwner(), |
125 | 125 | $association->getIndexedBy() => $key, |
126 | 126 | ]; |
@@ -157,12 +157,12 @@ discard block |
||
157 | 157 | { |
158 | 158 | $association = $collection->getMapping(); |
159 | 159 | |
160 | - if (! $association->isOrphanRemoval()) { |
|
160 | + if ( ! $association->isOrphanRemoval()) { |
|
161 | 161 | // no-op: this is not the owning side, therefore no operations should be applied |
162 | 162 | return false; |
163 | 163 | } |
164 | 164 | |
165 | - if (! $this->isValidEntityState($element)) { |
|
165 | + if ( ! $this->isValidEntityState($element)) { |
|
166 | 166 | return false; |
167 | 167 | } |
168 | 168 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
205 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
205 | + $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
206 | 206 | |
207 | 207 | return $this->conn->executeUpdate($statement, $parameters); |
208 | 208 | } |
@@ -241,17 +241,17 @@ discard block |
||
241 | 241 | ]; |
242 | 242 | } |
243 | 243 | |
244 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
245 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
244 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
245 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
246 | 246 | |
247 | 247 | $this->conn->executeUpdate($statement); |
248 | 248 | |
249 | 249 | // 2) Build insert table records into temporary table |
250 | - $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
251 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
250 | + $dql = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
251 | + . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner'; |
|
252 | 252 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
253 | 253 | |
254 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
|
254 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL(); |
|
255 | 255 | $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner())); |
256 | 256 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
257 | 257 | |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | foreach (array_reverse($classNames) as $className) { |
266 | 266 | $parentClass = $this->em->getClassMetadata($className); |
267 | 267 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
268 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnNameList . ')' |
|
269 | - . ' IN (SELECT ' . $idColumnNameList . ' FROM ' . $tempTable . ')'; |
|
268 | + $statement = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnNameList.')' |
|
269 | + . ' IN (SELECT '.$idColumnNameList.' FROM '.$tempTable.')'; |
|
270 | 270 | |
271 | 271 | $this->conn->executeUpdate($statement); |
272 | 272 | } |
@@ -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 | } |
@@ -1,6 +1,6 @@ discard block |
||
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 | |
@@ -300,14 +300,14 @@ discard block |
||
300 | 300 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
301 | 301 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
302 | 302 | $identifier = array_map( |
303 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
303 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
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(); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | |
394 | 394 | if (($value = $identifier[$field]) !== null) { |
395 | 395 | // @todo guilhermeblanco Make sure we do not have flat association values. |
396 | - if (! is_array($value)) { |
|
396 | + if ( ! is_array($value)) { |
|
397 | 397 | $value = [$targetClass->identifier[0] => $value]; |
398 | 398 | } |
399 | 399 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $quotedJoinColumnName = $this->platform->quoteIdentifier($joinColumnName); |
407 | 407 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
408 | 408 | |
409 | - if (! $joinColumn->getType()) { |
|
409 | + if ( ! $joinColumn->getType()) { |
|
410 | 410 | $joinColumn->setType( |
411 | 411 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
412 | 412 | ); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | $type = $column->getType(); |
449 | 449 | $placeholder = $type->convertToDatabaseValueSQL('?', $this->platform); |
450 | 450 | |
451 | - $set[] = $quotedColumnName . ' = ' . $placeholder; |
|
451 | + $set[] = $quotedColumnName.' = '.$placeholder; |
|
452 | 452 | $params[] = $value; |
453 | 453 | $types[] = $type; |
454 | 454 | } |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | /** @var JoinColumnMetadata $joinColumn */ |
476 | 476 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
477 | 477 | |
478 | - if (! $joinColumn->getType()) { |
|
478 | + if ( ! $joinColumn->getType()) { |
|
479 | 479 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
480 | 480 | |
481 | 481 | $joinColumn->setType( |
@@ -504,18 +504,18 @@ discard block |
||
504 | 504 | case Type::SMALLINT: |
505 | 505 | case Type::INTEGER: |
506 | 506 | case Type::BIGINT: |
507 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
507 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
508 | 508 | break; |
509 | 509 | |
510 | 510 | case Type::DATETIME: |
511 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
511 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
512 | 512 | break; |
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
516 | - $sql = 'UPDATE ' . $quotedTableName |
|
517 | - . ' SET ' . implode(', ', $set) |
|
518 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
516 | + $sql = 'UPDATE '.$quotedTableName |
|
517 | + . ' SET '.implode(', ', $set) |
|
518 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
519 | 519 | |
520 | 520 | $result = $this->conn->executeUpdate($sql, $params, $types); |
521 | 521 | |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | protected function deleteJoinTableRecords($identifier) |
535 | 535 | { |
536 | 536 | foreach ($this->class->getProperties() as $association) { |
537 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
537 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
538 | 538 | continue; |
539 | 539 | } |
540 | 540 | |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $keys = []; |
548 | 548 | |
549 | 549 | if ( ! $owningAssociation->isOwningSide()) { |
550 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
550 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
551 | 551 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
552 | 552 | } |
553 | 553 | |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | } |
660 | 660 | |
661 | 661 | // Only owning side of x-1 associations can have a FK column. |
662 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
662 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
663 | 663 | continue; |
664 | 664 | } |
665 | 665 | |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | /** @var JoinColumnMetadata $joinColumn */ |
680 | 680 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
681 | 681 | |
682 | - if (! $joinColumn->getType()) { |
|
682 | + if ( ! $joinColumn->getType()) { |
|
683 | 683 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
684 | 684 | |
685 | 685 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | $propertyName = $this->class->fieldNames[$columnName]; |
711 | 711 | $property = $this->class->getProperty($propertyName); |
712 | 712 | |
713 | - if (! $property) { |
|
713 | + if ( ! $property) { |
|
714 | 714 | return null; |
715 | 715 | } |
716 | 716 | |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | /** @var JoinColumnMetadata $joinColumn */ |
729 | 729 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
730 | 730 | |
731 | - if (! $joinColumn->getType()) { |
|
731 | + if ( ! $joinColumn->getType()) { |
|
732 | 732 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
733 | 733 | |
734 | 734 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
@@ -847,7 +847,7 @@ discard block |
||
847 | 847 | // unset the old value and set the new sql aliased value here. By definition |
848 | 848 | // unset($identifier[$targetKeyColumn] works here with how UnitOfWork::createEntity() calls this method. |
849 | 849 | // @todo guilhermeblanco In master we have: $identifier[$targetClass->getFieldForColumn($targetKeyColumn)] = |
850 | - $identifier[$targetTableAlias . "." . $targetKeyColumn] = $value; |
|
850 | + $identifier[$targetTableAlias.".".$targetKeyColumn] = $value; |
|
851 | 851 | |
852 | 852 | unset($identifier[$targetKeyColumn]); |
853 | 853 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
1067 | 1067 | $criteria = []; |
1068 | 1068 | $parameters = []; |
1069 | 1069 | |
1070 | - if (! $association->isOwningSide()) { |
|
1070 | + if ( ! $association->isOwningSide()) { |
|
1071 | 1071 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1072 | 1072 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1073 | 1073 | } |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | $value = $value[$targetClass->identifier[0]]; |
1096 | 1096 | } |
1097 | 1097 | |
1098 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1098 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1099 | 1099 | $parameters[] = [ |
1100 | 1100 | 'value' => $value, |
1101 | 1101 | 'field' => $fieldName, |
@@ -1146,11 +1146,11 @@ discard block |
||
1146 | 1146 | |
1147 | 1147 | switch ($lockMode) { |
1148 | 1148 | case LockMode::PESSIMISTIC_READ: |
1149 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1149 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1150 | 1150 | break; |
1151 | 1151 | |
1152 | 1152 | case LockMode::PESSIMISTIC_WRITE: |
1153 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1153 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1154 | 1154 | break; |
1155 | 1155 | } |
1156 | 1156 | |
@@ -1161,14 +1161,14 @@ discard block |
||
1161 | 1161 | |
1162 | 1162 | if ('' !== $filterSql) { |
1163 | 1163 | $conditionSql = $conditionSql |
1164 | - ? $conditionSql . ' AND ' . $filterSql |
|
1164 | + ? $conditionSql.' AND '.$filterSql |
|
1165 | 1165 | : $filterSql; |
1166 | 1166 | } |
1167 | 1167 | |
1168 | - $select = 'SELECT ' . $columnList; |
|
1169 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1170 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1171 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1168 | + $select = 'SELECT '.$columnList; |
|
1169 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1170 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1171 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1172 | 1172 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1173 | 1173 | $query = $select |
1174 | 1174 | . $lock |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | . $where |
1177 | 1177 | . $orderBySql; |
1178 | 1178 | |
1179 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1179 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | /** |
@@ -1195,13 +1195,13 @@ discard block |
||
1195 | 1195 | |
1196 | 1196 | if ('' !== $filterSql) { |
1197 | 1197 | $conditionSql = $conditionSql |
1198 | - ? $conditionSql . ' AND ' . $filterSql |
|
1198 | + ? $conditionSql.' AND '.$filterSql |
|
1199 | 1199 | : $filterSql; |
1200 | 1200 | } |
1201 | 1201 | |
1202 | 1202 | $sql = 'SELECT COUNT(*) ' |
1203 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1204 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1203 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1204 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1205 | 1205 | |
1206 | 1206 | return $sql; |
1207 | 1207 | } |
@@ -1218,7 +1218,7 @@ discard block |
||
1218 | 1218 | */ |
1219 | 1219 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
1220 | 1220 | { |
1221 | - if (! $orderBy) { |
|
1221 | + if ( ! $orderBy) { |
|
1222 | 1222 | return ''; |
1223 | 1223 | } |
1224 | 1224 | |
@@ -1227,7 +1227,7 @@ discard block |
||
1227 | 1227 | foreach ($orderBy as $fieldName => $orientation) { |
1228 | 1228 | $orientation = strtoupper(trim($orientation)); |
1229 | 1229 | |
1230 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
1230 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
1231 | 1231 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
1232 | 1232 | } |
1233 | 1233 | |
@@ -1237,11 +1237,11 @@ discard block |
||
1237 | 1237 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1238 | 1238 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1239 | 1239 | |
1240 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1240 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1241 | 1241 | |
1242 | 1242 | continue; |
1243 | 1243 | } else if ($property instanceof AssociationMetadata) { |
1244 | - if (! $property->isOwningSide()) { |
|
1244 | + if ( ! $property->isOwningSide()) { |
|
1245 | 1245 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName); |
1246 | 1246 | } |
1247 | 1247 | |
@@ -1254,7 +1254,7 @@ discard block |
||
1254 | 1254 | /* @var JoinColumnMetadata $joinColumn */ |
1255 | 1255 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1256 | 1256 | |
1257 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1257 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 | continue; |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | throw ORMException::unrecognizedField($fieldName); |
1264 | 1264 | } |
1265 | 1265 | |
1266 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1266 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1267 | 1267 | } |
1268 | 1268 | |
1269 | 1269 | /** |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | |
1286 | 1286 | |
1287 | 1287 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
1288 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1288 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1289 | 1289 | |
1290 | 1290 | $eagerAliasCounter = 0; |
1291 | 1291 | $columnList = []; |
@@ -1321,7 +1321,7 @@ discard block |
||
1321 | 1321 | break; // now this is why you shouldn't use inheritance |
1322 | 1322 | } |
1323 | 1323 | |
1324 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1324 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1325 | 1325 | |
1326 | 1326 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1327 | 1327 | |
@@ -1345,14 +1345,14 @@ discard block |
||
1345 | 1345 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1346 | 1346 | } |
1347 | 1347 | |
1348 | - if (! $property->isOwningSide()) { |
|
1348 | + if ( ! $property->isOwningSide()) { |
|
1349 | 1349 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1350 | 1350 | } |
1351 | 1351 | |
1352 | 1352 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1353 | 1353 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1354 | 1354 | |
1355 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1355 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1356 | 1356 | |
1357 | 1357 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1358 | 1358 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1374,7 +1374,7 @@ discard block |
||
1374 | 1374 | $joinCondition[] = $filterSql; |
1375 | 1375 | } |
1376 | 1376 | |
1377 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1377 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1378 | 1378 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1379 | 1379 | |
1380 | 1380 | break; |
@@ -1398,7 +1398,7 @@ discard block |
||
1398 | 1398 | */ |
1399 | 1399 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1400 | 1400 | { |
1401 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1401 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1402 | 1402 | return ''; |
1403 | 1403 | } |
1404 | 1404 | |
@@ -1411,7 +1411,7 @@ discard block |
||
1411 | 1411 | $quotedColumnName = $this->platform->quoteIdentifier($columnName); |
1412 | 1412 | $resultColumnName = $this->getSQLColumnAlias(); |
1413 | 1413 | |
1414 | - if (! $joinColumn->getType()) { |
|
1414 | + if ( ! $joinColumn->getType()) { |
|
1415 | 1415 | $joinColumn->setType( |
1416 | 1416 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
1417 | 1417 | ); |
@@ -1445,7 +1445,7 @@ discard block |
||
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 |
||
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 | /** |
@@ -1561,7 +1561,7 @@ discard block |
||
1561 | 1561 | $columnName = $joinColumn->getColumnName(); |
1562 | 1562 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1563 | 1563 | |
1564 | - if (! $joinColumn->getType()) { |
|
1564 | + if ( ! $joinColumn->getType()) { |
|
1565 | 1565 | $joinColumn->setType( |
1566 | 1566 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
1567 | 1567 | ); |
@@ -1602,7 +1602,7 @@ discard block |
||
1602 | 1602 | |
1603 | 1603 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1604 | 1604 | |
1605 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1605 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1606 | 1606 | } |
1607 | 1607 | |
1608 | 1608 | /** |
@@ -1616,14 +1616,14 @@ discard block |
||
1616 | 1616 | protected function getSQLTableAlias($tableName, $assocName = '') |
1617 | 1617 | { |
1618 | 1618 | if ($tableName) { |
1619 | - $tableName .= '#' . $assocName; |
|
1619 | + $tableName .= '#'.$assocName; |
|
1620 | 1620 | } |
1621 | 1621 | |
1622 | 1622 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1623 | 1623 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1624 | 1624 | } |
1625 | 1625 | |
1626 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1626 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1627 | 1627 | |
1628 | 1628 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1629 | 1629 | |
@@ -1650,7 +1650,7 @@ discard block |
||
1650 | 1650 | } |
1651 | 1651 | |
1652 | 1652 | $lock = $this->getLockTablesSql($lockMode); |
1653 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1653 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1654 | 1654 | $sql = 'SELECT 1 ' |
1655 | 1655 | . $lock |
1656 | 1656 | . $where |
@@ -1673,7 +1673,7 @@ discard block |
||
1673 | 1673 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1674 | 1674 | |
1675 | 1675 | return $this->platform->appendLockHint( |
1676 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1676 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1677 | 1677 | $lockMode |
1678 | 1678 | ); |
1679 | 1679 | } |
@@ -1726,19 +1726,19 @@ discard block |
||
1726 | 1726 | |
1727 | 1727 | if (null !== $comparison) { |
1728 | 1728 | // special case null value handling |
1729 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1730 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1729 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1730 | + $selectedColumns[] = $column.' IS NULL'; |
|
1731 | 1731 | |
1732 | 1732 | continue; |
1733 | 1733 | } |
1734 | 1734 | |
1735 | 1735 | if ($comparison === Comparison::NEQ && null === $value) { |
1736 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1736 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1737 | 1737 | |
1738 | 1738 | continue; |
1739 | 1739 | } |
1740 | 1740 | |
1741 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1741 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1742 | 1742 | |
1743 | 1743 | continue; |
1744 | 1744 | } |
@@ -1787,7 +1787,7 @@ discard block |
||
1787 | 1787 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1788 | 1788 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1789 | 1789 | |
1790 | - return [$tableAlias . '.' . $columnName]; |
|
1790 | + return [$tableAlias.'.'.$columnName]; |
|
1791 | 1791 | } |
1792 | 1792 | |
1793 | 1793 | if ($property instanceof AssociationMetadata) { |
@@ -1796,7 +1796,7 @@ discard block |
||
1796 | 1796 | |
1797 | 1797 | // Many-To-Many requires join table check for joinColumn |
1798 | 1798 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1799 | - if (! $owningAssociation->isOwningSide()) { |
|
1799 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1800 | 1800 | $owningAssociation = $association; |
1801 | 1801 | } |
1802 | 1802 | |
@@ -1810,15 +1810,15 @@ discard block |
||
1810 | 1810 | foreach ($joinColumns as $joinColumn) { |
1811 | 1811 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1812 | 1812 | |
1813 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1813 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1814 | 1814 | } |
1815 | 1815 | |
1816 | 1816 | } else { |
1817 | - if (! $owningAssociation->isOwningSide()) { |
|
1817 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1818 | 1818 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field); |
1819 | 1819 | } |
1820 | 1820 | |
1821 | - $class = $this->class->isInheritedProperty($field) |
|
1821 | + $class = $this->class->isInheritedProperty($field) |
|
1822 | 1822 | ? $owningAssociation->getDeclaringClass() |
1823 | 1823 | : $this->class |
1824 | 1824 | ; |
@@ -1827,7 +1827,7 @@ discard block |
||
1827 | 1827 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1828 | 1828 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1829 | 1829 | |
1830 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1830 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1831 | 1831 | } |
1832 | 1832 | } |
1833 | 1833 | |
@@ -1940,7 +1940,7 @@ discard block |
||
1940 | 1940 | $value = $value[$targetClass->identifier[0]]; |
1941 | 1941 | } |
1942 | 1942 | |
1943 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
1943 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
1944 | 1944 | $parameters[] = [ |
1945 | 1945 | 'value' => $value, |
1946 | 1946 | 'field' => $fieldName, |
@@ -2027,7 +2027,7 @@ discard block |
||
2027 | 2027 | case ($property instanceof AssociationMetadata): |
2028 | 2028 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2029 | 2029 | |
2030 | - if (! $property->isOwningSide()) { |
|
2030 | + if ( ! $property->isOwningSide()) { |
|
2031 | 2031 | $property = $class->getProperty($property->getMappedBy()); |
2032 | 2032 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2033 | 2033 | } |
@@ -2038,7 +2038,7 @@ discard block |
||
2038 | 2038 | ; |
2039 | 2039 | |
2040 | 2040 | foreach ($joinColumns as $joinColumn) { |
2041 | - if (! $joinColumn->getType()) { |
|
2041 | + if ( ! $joinColumn->getType()) { |
|
2042 | 2042 | $joinColumn->setType( |
2043 | 2043 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $class, $this->em) |
2044 | 2044 | ); |
@@ -2055,7 +2055,7 @@ discard block |
||
2055 | 2055 | } |
2056 | 2056 | |
2057 | 2057 | if (is_array($value)) { |
2058 | - return array_map(function ($type) { |
|
2058 | + return array_map(function($type) { |
|
2059 | 2059 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2060 | 2060 | }, $types); |
2061 | 2061 | } |
@@ -2134,12 +2134,12 @@ discard block |
||
2134 | 2134 | |
2135 | 2135 | $sql = 'SELECT 1 ' |
2136 | 2136 | . $this->getLockTablesSql(null) |
2137 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2137 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2138 | 2138 | |
2139 | 2139 | list($params, $types) = $this->expandParameters($criteria); |
2140 | 2140 | |
2141 | 2141 | if (null !== $extraConditions) { |
2142 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2142 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2143 | 2143 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2144 | 2144 | |
2145 | 2145 | $params = array_merge($params, $criteriaParams); |
@@ -2147,7 +2147,7 @@ discard block |
||
2147 | 2147 | } |
2148 | 2148 | |
2149 | 2149 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2150 | - $sql .= ' AND ' . $filterSql; |
|
2150 | + $sql .= ' AND '.$filterSql; |
|
2151 | 2151 | } |
2152 | 2152 | |
2153 | 2153 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2162,13 +2162,13 @@ discard block |
||
2162 | 2162 | */ |
2163 | 2163 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2164 | 2164 | { |
2165 | - if (! $association->isOwningSide()) { |
|
2165 | + if ( ! $association->isOwningSide()) { |
|
2166 | 2166 | return 'LEFT JOIN'; |
2167 | 2167 | } |
2168 | 2168 | |
2169 | 2169 | // if one of the join columns is nullable, return left join |
2170 | 2170 | foreach ($association->getJoinColumns() as $joinColumn) { |
2171 | - if (! $joinColumn->isNullable()) { |
|
2171 | + if ( ! $joinColumn->isNullable()) { |
|
2172 | 2172 | continue; |
2173 | 2173 | } |
2174 | 2174 | |
@@ -2185,7 +2185,7 @@ discard block |
||
2185 | 2185 | */ |
2186 | 2186 | public function getSQLColumnAlias() |
2187 | 2187 | { |
2188 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2188 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2189 | 2189 | } |
2190 | 2190 | |
2191 | 2191 | /** |
@@ -2202,13 +2202,13 @@ discard block |
||
2202 | 2202 | |
2203 | 2203 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2204 | 2204 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2205 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2205 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2206 | 2206 | } |
2207 | 2207 | } |
2208 | 2208 | |
2209 | 2209 | $sql = implode(' AND ', $filterClauses); |
2210 | 2210 | |
2211 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2211 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2212 | 2212 | } |
2213 | 2213 | |
2214 | 2214 | /** |
@@ -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; |
@@ -1,6 +1,6 @@ discard block |
||
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 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | foreach ($data as $columnName => $value) { |
114 | - if (!is_array($id) || !isset($id[$columnName])) { |
|
114 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
115 | 115 | $type = $this->columns[$columnName]->getType(); |
116 | 116 | |
117 | 117 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | if ($filterSql = $this->generateFilterConditionSQL($rootClass, $tableAlias)) { |
237 | 237 | $conditionSql .= $conditionSql |
238 | - ? ' AND ' . $filterSql |
|
238 | + ? ' AND '.$filterSql |
|
239 | 239 | : $filterSql; |
240 | 240 | } |
241 | 241 | |
@@ -243,26 +243,26 @@ discard block |
||
243 | 243 | |
244 | 244 | switch ($lockMode) { |
245 | 245 | case LockMode::PESSIMISTIC_READ: |
246 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
246 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
247 | 247 | break; |
248 | 248 | |
249 | 249 | case LockMode::PESSIMISTIC_WRITE: |
250 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
250 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
251 | 251 | break; |
252 | 252 | } |
253 | 253 | |
254 | 254 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
255 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
256 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
255 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
256 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
257 | 257 | $lock = $this->platform->appendLockHint($from, $lockMode); |
258 | 258 | $columnList = $this->getSelectColumnsSQL(); |
259 | - $query = 'SELECT ' . $columnList |
|
259 | + $query = 'SELECT '.$columnList |
|
260 | 260 | . $lock |
261 | 261 | . $joinSql |
262 | 262 | . $where |
263 | 263 | . $orderBySql; |
264 | 264 | |
265 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
265 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | |
285 | 285 | if ('' !== $filterSql) { |
286 | 286 | $conditionSql = $conditionSql |
287 | - ? $conditionSql . ' AND ' . $filterSql |
|
287 | + ? $conditionSql.' AND '.$filterSql |
|
288 | 288 | : $filterSql; |
289 | 289 | } |
290 | 290 | |
291 | 291 | $sql = 'SELECT COUNT(*) ' |
292 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
292 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
293 | 293 | . $joinSql |
294 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
294 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
295 | 295 | |
296 | 296 | return $sql; |
297 | 297 | } |
@@ -311,18 +311,18 @@ discard block |
||
311 | 311 | $parentClass = $this->em->getClassMetadata($parentClassName); |
312 | 312 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
313 | 313 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
314 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
314 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
315 | 315 | |
316 | 316 | foreach ($identifierColumns as $idColumn) { |
317 | 317 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
318 | 318 | |
319 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
319 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | $joinSql .= implode(' AND ', $conditions); |
323 | 323 | } |
324 | 324 | |
325 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
325 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | /** |
@@ -349,14 +349,14 @@ discard block |
||
349 | 349 | continue; |
350 | 350 | } |
351 | 351 | |
352 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
352 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
353 | 353 | continue; |
354 | 354 | } |
355 | 355 | |
356 | 356 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
357 | 357 | |
358 | 358 | foreach ($property->getJoinColumns() as $joinColumn) { |
359 | - if (! $joinColumn->getType()) { |
|
359 | + if ( ! $joinColumn->getType()) { |
|
360 | 360 | $joinColumn->setType( |
361 | 361 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
362 | 362 | ); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
377 | 377 | |
378 | 378 | $columnList[] = $discrColumnType->convertToDatabaseValueSQL( |
379 | - $this->getSQLTableAlias($discrColumn->getTableName()) . '.' . $discrColumnName, |
|
379 | + $this->getSQLTableAlias($discrColumn->getTableName()).'.'.$discrColumnName, |
|
380 | 380 | $this->platform |
381 | 381 | ); |
382 | 382 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
404 | 404 | |
405 | 405 | foreach ($property->getJoinColumns() as $joinColumn) { |
406 | - if (! $joinColumn->getType()) { |
|
406 | + if ( ! $joinColumn->getType()) { |
|
407 | 407 | $joinColumn->setType( |
408 | 408 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
409 | 409 | ); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $columnName = $joinColumn->getColumnName(); |
452 | 452 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
453 | 453 | |
454 | - if (! $joinColumn->getType()) { |
|
454 | + if ( ! $joinColumn->getType()) { |
|
455 | 455 | $joinColumn->setType( |
456 | 456 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
457 | 457 | ); |
@@ -509,12 +509,12 @@ discard block |
||
509 | 509 | $parentClass = $this->em->getClassMetadata($parentClassName); |
510 | 510 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
511 | 511 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
512 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
512 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
513 | 513 | |
514 | 514 | foreach ($identifierColumns as $idColumn) { |
515 | 515 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
516 | 516 | |
517 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
517 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
518 | 518 | } |
519 | 519 | |
520 | 520 | $joinSql .= implode(' AND ', $conditions); |
@@ -526,12 +526,12 @@ discard block |
||
526 | 526 | $subClass = $this->em->getClassMetadata($subClassName); |
527 | 527 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
528 | 528 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
529 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
529 | + $joinSql .= ' LEFT 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); |