@@ -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 | |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | // Entity deletions come last and need to be in reverse commit order |
391 | 391 | if ($this->entityDeletions) { |
392 | 392 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
393 | - if (! $this->entityDeletions) { |
|
393 | + if ( ! $this->entityDeletions) { |
|
394 | 394 | break; // just a performance optimisation |
395 | 395 | } |
396 | 396 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | $oid = spl_object_id($entity); |
476 | 476 | $data = []; |
477 | 477 | |
478 | - if (!isset($this->entityChangeSets[$oid])) { |
|
478 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
479 | 479 | return $data; |
480 | 480 | } |
481 | 481 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | || ! $class->getProperty($name) instanceof FieldMetadata |
559 | 559 | || ! $class->getProperty($name)->hasValueGenerator() |
560 | 560 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
561 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
561 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
562 | 562 | $actualData[$name] = $value; |
563 | 563 | } |
564 | 564 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | if ($owner === null) { // cloned |
613 | 613 | $actualValue->setOwner($entity, $property); |
614 | 614 | } elseif ($owner !== $entity) { // no clone, we have to fix |
615 | - if (! $actualValue->isInitialized()) { |
|
615 | + if ( ! $actualValue->isInitialized()) { |
|
616 | 616 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
617 | 617 | } |
618 | 618 | |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | // Check if original value exists |
651 | 651 | if ($orgValue instanceof PersistentCollection) { |
652 | 652 | // A PersistentCollection was de-referenced, so delete it. |
653 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
653 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
654 | 654 | $this->scheduleCollectionDeletion($orgValue); |
655 | 655 | |
656 | 656 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | |
674 | 674 | // Look for changes in associations of the entity |
675 | 675 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
676 | - if (! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) { |
|
676 | + if ( ! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) { |
|
677 | 677 | continue; |
678 | 678 | } |
679 | 679 | |
@@ -777,13 +777,13 @@ discard block |
||
777 | 777 | $targetClass = $this->em->getClassMetadata($targetEntity); |
778 | 778 | |
779 | 779 | foreach ($unwrappedValue as $key => $entry) { |
780 | - if (! ($entry instanceof $targetEntity)) { |
|
780 | + if ( ! ($entry instanceof $targetEntity)) { |
|
781 | 781 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
782 | 782 | } |
783 | 783 | |
784 | 784 | $state = $this->getEntityState($entry, self::STATE_NEW); |
785 | 785 | |
786 | - if (! ($entry instanceof $targetEntity)) { |
|
786 | + if ( ! ($entry instanceof $targetEntity)) { |
|
787 | 787 | throw ORMException::unexpectedAssociationValue( |
788 | 788 | $association->getSourceEntity(), |
789 | 789 | $association->getName(), |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $persister = $this->getEntityPersister($class->getClassName()); |
846 | 846 | $generationPlan->executeImmediate($this->em, $entity); |
847 | 847 | |
848 | - if (! $generationPlan->containsDeferred()) { |
|
848 | + if ( ! $generationPlan->containsDeferred()) { |
|
849 | 849 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
850 | 850 | $this->entityIdentifiers[$oid] = $id; |
851 | 851 | } |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | { |
879 | 879 | $oid = spl_object_id($entity); |
880 | 880 | |
881 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
881 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
882 | 882 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
883 | 883 | } |
884 | 884 | |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | break; |
901 | 901 | |
902 | 902 | case ($property instanceof FieldMetadata): |
903 | - if (! $property->isPrimaryKey() |
|
903 | + if ( ! $property->isPrimaryKey() |
|
904 | 904 | || ! $property->getValueGenerator() |
905 | 905 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
906 | 906 | $actualData[$name] = $property->getValue($entity); |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
1054 | 1054 | // is obtained by a new entity because the old one went out of scope. |
1055 | 1055 | //$this->entityStates[$oid] = self::STATE_NEW; |
1056 | - if (! $class->isIdentifierComposite()) { |
|
1056 | + if ( ! $class->isIdentifierComposite()) { |
|
1057 | 1057 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
1058 | 1058 | |
1059 | 1059 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | // Calculate dependencies for new nodes |
1101 | 1101 | while ($class = array_pop($newNodes)) { |
1102 | 1102 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
1103 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1103 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1104 | 1104 | continue; |
1105 | 1105 | } |
1106 | 1106 | |
@@ -1114,7 +1114,7 @@ discard block |
||
1114 | 1114 | |
1115 | 1115 | $weight = ! array_filter( |
1116 | 1116 | $property->getJoinColumns(), |
1117 | - function (JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
1117 | + function(JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
1118 | 1118 | ); |
1119 | 1119 | |
1120 | 1120 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | $persister = $this->getEntityPersister($class->getClassName()); |
1409 | 1409 | $id = $persister->getIdentifier($entity); |
1410 | 1410 | |
1411 | - if (! $id) { |
|
1411 | + if ( ! $id) { |
|
1412 | 1412 | return self::STATE_NEW; |
1413 | 1413 | } |
1414 | 1414 | |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
1641 | 1641 | |
1642 | 1642 | default: |
1643 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1643 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1644 | 1644 | } |
1645 | 1645 | |
1646 | 1646 | $this->cascadePersist($entity, $visited); |
@@ -1710,7 +1710,7 @@ discard block |
||
1710 | 1710 | case self::STATE_DETACHED: |
1711 | 1711 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
1712 | 1712 | default: |
1713 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1713 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1714 | 1714 | } |
1715 | 1715 | } |
1716 | 1716 | |
@@ -1778,7 +1778,7 @@ discard block |
||
1778 | 1778 | $class = $this->em->getClassMetadata(get_class($entity)); |
1779 | 1779 | |
1780 | 1780 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1781 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
1781 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
1782 | 1782 | continue; |
1783 | 1783 | } |
1784 | 1784 | |
@@ -1827,7 +1827,7 @@ discard block |
||
1827 | 1827 | } |
1828 | 1828 | |
1829 | 1829 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1830 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
1830 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
1831 | 1831 | continue; |
1832 | 1832 | } |
1833 | 1833 | |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | |
1844 | 1844 | case ($relatedEntities instanceof Collection): |
1845 | 1845 | case (is_array($relatedEntities)): |
1846 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
1846 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
1847 | 1847 | throw ORMInvalidArgumentException::invalidAssociation( |
1848 | 1848 | $this->em->getClassMetadata($targetEntity), |
1849 | 1849 | $association, |
@@ -1858,7 +1858,7 @@ discard block |
||
1858 | 1858 | break; |
1859 | 1859 | |
1860 | 1860 | case ($relatedEntities !== null): |
1861 | - if (! $relatedEntities instanceof $targetEntity) { |
|
1861 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
1862 | 1862 | throw ORMInvalidArgumentException::invalidAssociation( |
1863 | 1863 | $this->em->getClassMetadata($targetEntity), |
1864 | 1864 | $association, |
@@ -1889,7 +1889,7 @@ discard block |
||
1889 | 1889 | $class = $this->em->getClassMetadata(get_class($entity)); |
1890 | 1890 | |
1891 | 1891 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1892 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
1892 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
1893 | 1893 | continue; |
1894 | 1894 | } |
1895 | 1895 | |
@@ -1973,7 +1973,7 @@ discard block |
||
1973 | 1973 | case LockMode::NONE === $lockMode: |
1974 | 1974 | case LockMode::PESSIMISTIC_READ === $lockMode: |
1975 | 1975 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
1976 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
1976 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
1977 | 1977 | throw TransactionRequiredException::transactionRequired(); |
1978 | 1978 | } |
1979 | 1979 | |
@@ -2193,7 +2193,7 @@ discard block |
||
2193 | 2193 | } |
2194 | 2194 | |
2195 | 2195 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
2196 | - if (! ($association instanceof AssociationMetadata)) { |
|
2196 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
2197 | 2197 | continue; |
2198 | 2198 | } |
2199 | 2199 | |
@@ -2242,7 +2242,7 @@ discard block |
||
2242 | 2242 | continue; |
2243 | 2243 | } |
2244 | 2244 | |
2245 | - if (! $association->isOwningSide()) { |
|
2245 | + if ( ! $association->isOwningSide()) { |
|
2246 | 2246 | // use the given entity association |
2247 | 2247 | if (isset($data[$field]) && is_object($data[$field]) && |
2248 | 2248 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2292,7 +2292,7 @@ discard block |
||
2292 | 2292 | $associatedId[$targetField] = $joinColumnValue; |
2293 | 2293 | } |
2294 | 2294 | |
2295 | - if (! $associatedId) { |
|
2295 | + if ( ! $associatedId) { |
|
2296 | 2296 | // Foreign key is NULL |
2297 | 2297 | $association->setValue($entity, null); |
2298 | 2298 | $this->originalEntityData[$oid][$field] = null; |
@@ -2301,7 +2301,7 @@ discard block |
||
2301 | 2301 | } |
2302 | 2302 | |
2303 | 2303 | // @todo guilhermeblanco Can we remove the need of this somehow? |
2304 | - if (!isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2304 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2305 | 2305 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
2306 | 2306 | } |
2307 | 2307 | |
@@ -2318,7 +2318,7 @@ discard block |
||
2318 | 2318 | // If this is an uninitialized proxy, we are deferring eager loads, |
2319 | 2319 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
2320 | 2320 | // then we can append this entity for eager loading! |
2321 | - if (!$targetClass->isIdentifierComposite() && |
|
2321 | + if ( ! $targetClass->isIdentifierComposite() && |
|
2322 | 2322 | $newValue instanceof GhostObjectInterface && |
2323 | 2323 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2324 | 2324 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2355,7 +2355,7 @@ discard block |
||
2355 | 2355 | break; |
2356 | 2356 | |
2357 | 2357 | // Deferred eager load only works for single identifier classes |
2358 | - case (isset($hints[self::HINT_DEFEREAGERLOAD]) && !$targetClass->isIdentifierComposite()): |
|
2358 | + case (isset($hints[self::HINT_DEFEREAGERLOAD]) && ! $targetClass->isIdentifierComposite()): |
|
2359 | 2359 | // TODO: Is there a faster approach? |
2360 | 2360 | $this->eagerLoadingEntities[$targetClass->getRootClassName()][$relatedIdHash] = current($normalizedAssociatedId); |
2361 | 2361 | |
@@ -2762,7 +2762,7 @@ discard block |
||
2762 | 2762 | { |
2763 | 2763 | $class = $this->em->getClassMetadata(get_class($entity)); |
2764 | 2764 | |
2765 | - if (! $class->getProperty($propertyName)) { |
|
2765 | + if ( ! $class->getProperty($propertyName)) { |
|
2766 | 2766 | return; // ignore non-persistent fields |
2767 | 2767 | } |
2768 | 2768 | |
@@ -2902,7 +2902,7 @@ discard block |
||
2902 | 2902 | */ |
2903 | 2903 | private function afterTransactionComplete() |
2904 | 2904 | { |
2905 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
2905 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
2906 | 2906 | $persister->afterTransactionComplete(); |
2907 | 2907 | }); |
2908 | 2908 | } |
@@ -2912,7 +2912,7 @@ discard block |
||
2912 | 2912 | */ |
2913 | 2913 | private function afterTransactionRolledBack() |
2914 | 2914 | { |
2915 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
2915 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
2916 | 2916 | $persister->afterTransactionRolledBack(); |
2917 | 2917 | }); |
2918 | 2918 | } |
@@ -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\Tools; |
6 | 6 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $ce = []; |
82 | 82 | |
83 | 83 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $association) { |
84 | - if (! ($association instanceof AssociationMetadata)) { |
|
84 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
85 | 85 | continue; |
86 | 86 | } |
87 | 87 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | foreach ($class->getSubClasses() as $subClass) { |
92 | - if (!in_array($class->getClassName(), class_parents($subClass), true)) { |
|
92 | + if ( ! in_array($class->getClassName(), class_parents($subClass), true)) { |
|
93 | 93 | $message = "According to the discriminator map class, '%s' has to be a child of '%s', but these entities are not related through inheritance."; |
94 | 94 | |
95 | 95 | $ce[] = sprintf($message, $subClass, $class->getClassName()); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $fieldName = $association->getName(); |
112 | 112 | $targetEntity = $association->getTargetEntity(); |
113 | 113 | |
114 | - if (!class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) { |
|
114 | + if ( ! class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) { |
|
115 | 115 | $message = "The target entity '%s' specified on %s#%s is unknown or not an entity."; |
116 | 116 | |
117 | 117 | return [ |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | /** @var ClassMetadata $targetMetadata */ |
134 | 134 | $targetMetadata = $metadataFactory->getMetadataFor($targetEntity); |
135 | - $containsForeignId = array_filter($targetMetadata->identifier, function ($identifier) use ($targetMetadata) { |
|
135 | + $containsForeignId = array_filter($targetMetadata->identifier, function($identifier) use ($targetMetadata) { |
|
136 | 136 | $targetProperty = $targetMetadata->getProperty($identifier); |
137 | 137 | |
138 | 138 | return $targetProperty instanceof AssociationMetadata; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | /** @var AssociationMetadata $targetAssociation */ |
149 | 149 | $targetAssociation = $targetMetadata->getProperty($mappedBy); |
150 | 150 | |
151 | - if (! $targetAssociation) { |
|
151 | + if ( ! $targetAssociation) { |
|
152 | 152 | $message = "The association %s#%s refers to the owning side property %s#%s which does not exist."; |
153 | 153 | |
154 | 154 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $mappedBy); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | /** @var AssociationMetadata $targetAssociation */ |
173 | 173 | $targetAssociation = $targetMetadata->getProperty($inversedBy); |
174 | 174 | |
175 | - if (! $targetAssociation) { |
|
175 | + if ( ! $targetAssociation) { |
|
176 | 176 | $message = "The association %s#%s refers to the inverse side property %s#%s which does not exist."; |
177 | 177 | |
178 | 178 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $inversedBy); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $joinTable = $association->getJoinTable(); |
217 | 217 | |
218 | 218 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
219 | - if (! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) { |
|
219 | + if ( ! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) { |
|
220 | 220 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
221 | 221 | |
222 | 222 | $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $class->getClassName()); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | |
227 | 227 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
228 | - if (! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) { |
|
228 | + if ( ! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) { |
|
229 | 229 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
230 | 230 | |
231 | 231 | $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $targetMetadata->getClassName()); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | if (count($targetIdentifierColumns) !== count($joinTable->getInverseJoinColumns())) { |
237 | 237 | $columnNames = array_map( |
238 | - function (JoinColumnMetadata $joinColumn) { |
|
238 | + function(JoinColumnMetadata $joinColumn) { |
|
239 | 239 | return $joinColumn->getReferencedColumnName(); |
240 | 240 | }, |
241 | 241 | $joinTable->getInverseJoinColumns() |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | if (count($classIdentifierColumns) !== count($joinTable->getJoinColumns())) { |
252 | 252 | $columnNames = array_map( |
253 | - function (JoinColumnMetadata $joinColumn) { |
|
253 | + function(JoinColumnMetadata $joinColumn) { |
|
254 | 254 | return $joinColumn->getReferencedColumnName(); |
255 | 255 | }, |
256 | 256 | $joinTable->getJoinColumns() |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $joinColumns = $association->getJoinColumns(); |
268 | 268 | |
269 | 269 | foreach ($joinColumns as $joinColumn) { |
270 | - if (!in_array($joinColumn->getReferencedColumnName(), $identifierColumns, true)) { |
|
270 | + if ( ! in_array($joinColumn->getReferencedColumnName(), $identifierColumns, true)) { |
|
271 | 271 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
272 | 272 | |
273 | 273 | $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $targetMetadata->getClassName()); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | continue; |
299 | 299 | } |
300 | 300 | |
301 | - if (! ($targetProperty instanceof AssociationMetadata)) { |
|
301 | + if ( ! ($targetProperty instanceof AssociationMetadata)) { |
|
302 | 302 | $message = "The association %s#%s is ordered by a property '%s' that is non-existing field on the target entity '%s'."; |
303 | 303 | |
304 | 304 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $orderField, $targetMetadata->getClassName()); |
@@ -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\Tools\Pagination; |
6 | 6 | |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | |
195 | 195 | $innerSql = $this->getInnerSQL($AST); |
196 | 196 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
197 | - $sqlAliasIdentifier = array_map(function ($info) { return $info['alias']; }, $sqlIdentifier); |
|
197 | + $sqlAliasIdentifier = array_map(function($info) { return $info['alias']; }, $sqlIdentifier); |
|
198 | 198 | |
199 | 199 | if ($hasOrderBy) { |
200 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlAliasIdentifier); |
|
201 | - $sqlPiece = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
200 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlAliasIdentifier); |
|
201 | + $sqlPiece = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
202 | 202 | |
203 | 203 | $sqlAliasIdentifier[] = $sqlPiece; |
204 | 204 | $sqlIdentifier[] = [ |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql); |
212 | 212 | |
213 | 213 | if ($hasOrderBy) { |
214 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
214 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | // Apply the limit and offset. |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | $innerSql = $this->getInnerSQL($AST); |
258 | 258 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
259 | - $sqlAliasIdentifier = array_map(function ($info) { return $info['alias']; }, $sqlIdentifier); |
|
259 | + $sqlAliasIdentifier = array_map(function($info) { return $info['alias']; }, $sqlIdentifier); |
|
260 | 260 | |
261 | 261 | // Build the counter query |
262 | 262 | $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql); |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | ?OrderByClause $orderByClause |
365 | 365 | ) : string { |
366 | 366 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement |
367 | - if (! $orderByClause) { |
|
367 | + if ( ! $orderByClause) { |
|
368 | 368 | return $sql; |
369 | 369 | } |
370 | 370 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $orderByItems[] = $orderByItemString; |
407 | 407 | $identifier = \substr($orderByItemString, 0, \strrpos($orderByItemString, ' ')); |
408 | 408 | |
409 | - if (! \in_array($identifier, $identifiers, true)) { |
|
409 | + if ( ! \in_array($identifier, $identifiers, true)) { |
|
410 | 410 | $identifiers[] = $identifier; |
411 | 411 | } |
412 | 412 | } |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | */ |
563 | 563 | public function walkPathExpression($pathExpr) |
564 | 564 | { |
565 | - if (!$this->inSubSelect && !$this->platformSupportsRowNumber() && !in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
565 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
566 | 566 | $this->orderByPathExpressions[] = $pathExpr; |
567 | 567 | } |
568 | 568 |
@@ -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\Tools; |
6 | 6 | |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | $pkColumns = []; |
181 | 181 | |
182 | 182 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
183 | - if (! ($property instanceof FieldMetadata)) { |
|
183 | + if ( ! ($property instanceof FieldMetadata)) { |
|
184 | 184 | continue; |
185 | 185 | } |
186 | 186 | |
187 | - if (! $class->isInheritedProperty($fieldName)) { |
|
187 | + if ( ! $class->isInheritedProperty($fieldName)) { |
|
188 | 188 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
189 | 189 | |
190 | 190 | $this->gatherColumn($class, $property, $table); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $processedClasses[$class->getClassName()] = true; |
325 | 325 | |
326 | 326 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
327 | - if (! $property instanceof FieldMetadata |
|
327 | + if ( ! $property instanceof FieldMetadata |
|
328 | 328 | || ! $property->hasValueGenerator() |
329 | 329 | || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE |
330 | 330 | || $class->getClassName() !== $class->getRootClassName()) { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | $quotedName = $this->platform->quoteIdentifier($property->getValueGenerator()->getDefinition()['sequenceName']); |
335 | 335 | |
336 | - if (! $schema->hasSequence($quotedName)) { |
|
336 | + if ( ! $schema->hasSequence($quotedName)) { |
|
337 | 337 | $schema->createSequence($quotedName, $property->getValueGenerator()->getDefinition()['allocationSize']); |
338 | 338 | } |
339 | 339 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | break; |
389 | 389 | } |
390 | 390 | |
391 | - if (!empty($discrColumn->getColumnDefinition())) { |
|
391 | + if ( ! empty($discrColumn->getColumnDefinition())) { |
|
392 | 392 | $options['columnDefinition'] = $discrColumn->getColumnDefinition(); |
393 | 393 | } |
394 | 394 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | $pkColumns = []; |
410 | 410 | |
411 | 411 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
412 | - if (! ($property instanceof FieldMetadata)) { |
|
412 | + if ( ! ($property instanceof FieldMetadata)) { |
|
413 | 413 | continue; |
414 | 414 | } |
415 | 415 | |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks) |
528 | 528 | { |
529 | 529 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
530 | - if (! ($property instanceof AssociationMetadata)) { |
|
530 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
531 | 531 | continue; |
532 | 532 | } |
533 | 533 | |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | continue; |
536 | 536 | } |
537 | 537 | |
538 | - if (! $property->isOwningSide()) { |
|
538 | + if ( ! $property->isOwningSide()) { |
|
539 | 539 | continue; |
540 | 540 | } |
541 | 541 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | $idColumns = $class->getIdentifierColumns($this->em); |
626 | 626 | $idColumnNameList = array_keys($idColumns); |
627 | 627 | |
628 | - if (! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
628 | + if ( ! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
629 | 629 | return null; |
630 | 630 | } |
631 | 631 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | foreach ($class->getIdentifierFieldNames() as $fieldName) { |
634 | 634 | $property = $class->getProperty($fieldName); |
635 | 635 | |
636 | - if (! ($property instanceof AssociationMetadata)) { |
|
636 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
637 | 637 | continue; |
638 | 638 | } |
639 | 639 | |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | $property = $definingClass->getProperty($referencedFieldName); |
716 | 716 | $columnDef = null; |
717 | 717 | |
718 | - if (!empty($joinColumn->getColumnDefinition())) { |
|
718 | + if ( ! empty($joinColumn->getColumnDefinition())) { |
|
719 | 719 | $columnDef = $joinColumn->getColumnDefinition(); |
720 | 720 | } elseif ($property->getColumnDefinition()) { |
721 | 721 | $columnDef = $property->getColumnDefinition(); |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | $uniqueConstraints[] = ['columns' => [$quotedColumnName]]; |
750 | 750 | } |
751 | 751 | |
752 | - if (!empty($joinColumn->getOnDelete())) { |
|
752 | + if ( ! empty($joinColumn->getOnDelete())) { |
|
753 | 753 | $fkOptions['onDelete'] = $joinColumn->getOnDelete(); |
754 | 754 | } |
755 | 755 | } |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | if ($table->hasPrimaryKey()) { |
889 | 889 | $columns = $table->getPrimaryKey()->getColumns(); |
890 | 890 | if (count($columns) == 1) { |
891 | - $checkSequence = $table->getName() . '_' . $columns[0] . '_seq'; |
|
891 | + $checkSequence = $table->getName().'_'.$columns[0].'_seq'; |
|
892 | 892 | if ($fullSchema->hasSequence($checkSequence)) { |
893 | 893 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
894 | 894 | } |
@@ -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 | |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | public function getParameter($key) |
588 | 588 | { |
589 | 589 | $filteredParameters = $this->parameters->filter( |
590 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
590 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
591 | 591 | $parameterName = $parameter->getName(); |
592 | 592 | |
593 | 593 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | } |
670 | 670 | |
671 | 671 | $isMultiple = is_array($this->dqlParts[$dqlPartName]) |
672 | - && !($dqlPartName == 'join' && !$append); |
|
672 | + && ! ($dqlPartName == 'join' && ! $append); |
|
673 | 673 | |
674 | 674 | // Allow adding any part retrieved from self::getDQLParts(). |
675 | 675 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | { |
887 | 887 | $rootAliases = $this->getRootAliases(); |
888 | 888 | |
889 | - if (!in_array($alias, $rootAliases, true)) { |
|
889 | + if ( ! in_array($alias, $rootAliases, true)) { |
|
890 | 890 | throw new Query\QueryException( |
891 | 891 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
892 | 892 | ); |
@@ -1286,14 +1286,14 @@ discard block |
||
1286 | 1286 | foreach ($criteria->getOrderings() as $sort => $order) { |
1287 | 1287 | $hasValidAlias = false; |
1288 | 1288 | foreach ($allAliases as $alias) { |
1289 | - if (strpos($sort . '.', $alias . '.') === 0) { |
|
1289 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1290 | 1290 | $hasValidAlias = true; |
1291 | 1291 | break; |
1292 | 1292 | } |
1293 | 1293 | } |
1294 | 1294 | |
1295 | - if (!$hasValidAlias) { |
|
1296 | - $sort = $allAliases[0] . '.' . $sort; |
|
1295 | + if ( ! $hasValidAlias) { |
|
1296 | + $sort = $allAliases[0].'.'.$sort; |
|
1297 | 1297 | } |
1298 | 1298 | |
1299 | 1299 | $this->addOrderBy($sort, $order); |
@@ -1366,7 +1366,7 @@ discard block |
||
1366 | 1366 | private function getDQLForSelect() |
1367 | 1367 | { |
1368 | 1368 | $dql = 'SELECT' |
1369 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1369 | + . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1370 | 1370 | . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
1371 | 1371 | |
1372 | 1372 | $fromParts = $this->getDQLPart('from'); |
@@ -1382,7 +1382,7 @@ discard block |
||
1382 | 1382 | |
1383 | 1383 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1384 | 1384 | foreach ($joinParts[$from->getAlias()] as $join) { |
1385 | - $fromClause .= ' ' . ((string) $join); |
|
1385 | + $fromClause .= ' '.((string) $join); |
|
1386 | 1386 | } |
1387 | 1387 | } |
1388 | 1388 |
@@ -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\Query; |
6 | 6 | |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $tokenStr = substr($dql, (int) $token['position'], $length); |
471 | 471 | |
472 | 472 | // Building informative message |
473 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
473 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
474 | 474 | |
475 | 475 | throw QueryException::semanticalError( |
476 | 476 | $message, |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | // If the namespace is not given then assumes the first FROM entity namespace |
619 | 619 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
620 | 620 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
621 | - $fqcn = $namespace . '\\' . $className; |
|
621 | + $fqcn = $namespace.'\\'.$className; |
|
622 | 622 | |
623 | 623 | if (class_exists($fqcn)) { |
624 | 624 | $expression->className = $fqcn; |
@@ -667,13 +667,13 @@ discard block |
||
667 | 667 | } |
668 | 668 | |
669 | 669 | $this->semanticalError( |
670 | - "There is no mapped field named '$field' on class " . $class->getClassName() . ".", $deferredItem['token'] |
|
670 | + "There is no mapped field named '$field' on class ".$class->getClassName().".", $deferredItem['token'] |
|
671 | 671 | ); |
672 | 672 | } |
673 | 673 | |
674 | 674 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
675 | 675 | $this->semanticalError( |
676 | - "The partial field selection of class " . $class->getClassName() . " must contain the identifier.", |
|
676 | + "The partial field selection of class ".$class->getClassName()." must contain the identifier.", |
|
677 | 677 | $deferredItem['token'] |
678 | 678 | ); |
679 | 679 | } |
@@ -742,9 +742,9 @@ discard block |
||
742 | 742 | $property = $class->getProperty($field); |
743 | 743 | |
744 | 744 | // Check if field or association exists |
745 | - if (! $property) { |
|
745 | + if ( ! $property) { |
|
746 | 746 | $this->semanticalError( |
747 | - 'Class ' . $class->getClassName() . ' has no field or association named ' . $field, |
|
747 | + 'Class '.$class->getClassName().' has no field or association named '.$field, |
|
748 | 748 | $deferredItem['token'] |
749 | 749 | ); |
750 | 750 | } |
@@ -783,8 +783,8 @@ discard block |
||
783 | 783 | // Build the error message |
784 | 784 | $semanticalError = 'Invalid PathExpression. '; |
785 | 785 | $semanticalError .= \count($expectedStringTypes) === 1 |
786 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
787 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
786 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
787 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
788 | 788 | |
789 | 789 | $this->semanticalError($semanticalError, $deferredItem['token']); |
790 | 790 | } |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | |
956 | 956 | list($namespaceAlias, $simpleClassName) = explode(':', $this->lexer->token['value']); |
957 | 957 | |
958 | - $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
958 | + $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
959 | 959 | } |
960 | 960 | |
961 | 961 | return $schemaName; |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | |
1040 | 1040 | if ( ! isset($this->queryComponents[$identVariable])) { |
1041 | 1041 | $this->semanticalError( |
1042 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
1042 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
1043 | 1043 | ); |
1044 | 1044 | } |
1045 | 1045 | |
@@ -1052,8 +1052,8 @@ discard block |
||
1052 | 1052 | $qComp = $this->queryComponents[$identVariable]; |
1053 | 1053 | $class = $qComp['metadata']; |
1054 | 1054 | |
1055 | - if (! (($property = $class->getProperty($field)) !== null && $property instanceof AssociationMetadata)) { |
|
1056 | - $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field); |
|
1055 | + if ( ! (($property = $class->getProperty($field)) !== null && $property instanceof AssociationMetadata)) { |
|
1056 | + $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field); |
|
1057 | 1057 | } |
1058 | 1058 | |
1059 | 1059 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -2475,7 +2475,7 @@ discard block |
||
2475 | 2475 | // Peek beyond the matching closing parenthesis ')' |
2476 | 2476 | $peek = $this->peekBeyondClosingParenthesis(); |
2477 | 2477 | |
2478 | - if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="], true) || |
|
2478 | + if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="], true) || |
|
2479 | 2479 | in_array($peek['type'], [Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS], true) || |
2480 | 2480 | $this->isMathOperator($peek)) { |
2481 | 2481 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
@@ -2580,7 +2580,7 @@ discard block |
||
2580 | 2580 | return $this->NullComparisonExpression(); |
2581 | 2581 | } |
2582 | 2582 | |
2583 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2583 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
2584 | 2584 | return $this->EmptyCollectionComparisonExpression(); |
2585 | 2585 | } |
2586 | 2586 |
@@ -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\Query; |
6 | 6 | |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
274 | 274 | { |
275 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
275 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
276 | 276 | |
277 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
278 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
277 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
278 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | return $this->tableAliasMap[$tableName]; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | */ |
294 | 294 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
295 | 295 | { |
296 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
296 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
297 | 297 | |
298 | 298 | $this->tableAliasMap[$tableName] = $alias; |
299 | 299 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function getSQLColumnAlias() |
309 | 309 | { |
310 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
310 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -334,14 +334,14 @@ discard block |
||
334 | 334 | |
335 | 335 | // If this is a joined association we must use left joins to preserve the correct result. |
336 | 336 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
337 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
337 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
338 | 338 | |
339 | 339 | $sqlParts = []; |
340 | 340 | |
341 | 341 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
342 | 342 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
343 | 343 | |
344 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
344 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | // Add filters on the root class |
@@ -363,14 +363,14 @@ discard block |
||
363 | 363 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
364 | 364 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
365 | 365 | |
366 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
366 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
367 | 367 | |
368 | 368 | $sqlParts = []; |
369 | 369 | |
370 | 370 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
371 | 371 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
372 | 372 | |
373 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
373 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | $sql .= implode(' AND ', $sqlParts); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $qComp = $this->queryComponents[$dqlAlias]; |
392 | 392 | $association = $qComp['relation']; |
393 | 393 | |
394 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
394 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
395 | 395 | continue; |
396 | 396 | } |
397 | 397 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $property = $qComp['metadata']->getProperty($fieldName); |
400 | 400 | $tableName = $property->getTableName(); |
401 | 401 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
402 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
402 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
403 | 403 | |
404 | 404 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
405 | 405 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
410 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
410 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
411 | 411 | } |
412 | 412 | } |
413 | 413 | |
@@ -447,19 +447,19 @@ discard block |
||
447 | 447 | $discrColumnType = $discrColumn->getType(); |
448 | 448 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
449 | 449 | $sqlTableAlias = ($this->useSqlTableAliases) |
450 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
450 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
451 | 451 | : ''; |
452 | 452 | |
453 | 453 | $sqlParts[] = sprintf( |
454 | 454 | '%s IN (%s)', |
455 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
455 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
456 | 456 | implode(', ', $values) |
457 | 457 | ); |
458 | 458 | } |
459 | 459 | |
460 | 460 | $sql = implode(' AND ', $sqlParts); |
461 | 461 | |
462 | - return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql; |
|
462 | + return isset($sqlParts[1]) ? '('.$sql.')' : $sql; |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | /** |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | */ |
473 | 473 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
474 | 474 | { |
475 | - if (! $this->em->hasFilters()) { |
|
475 | + if ( ! $this->em->hasFilters()) { |
|
476 | 476 | return ''; |
477 | 477 | } |
478 | 478 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | |
504 | 504 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
505 | 505 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
506 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
506 | + $filterClauses[] = '('.$filterExpr.')'; |
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | } |
536 | 536 | |
537 | 537 | if ( ! $AST->orderByClause && ($orderBySql = $this->generateOrderedCollectionOrderByItems())) { |
538 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
538 | + $sql .= ' ORDER BY '.$orderBySql; |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | if ($limit !== null || $offset !== null) { |
@@ -547,11 +547,11 @@ discard block |
||
547 | 547 | } |
548 | 548 | |
549 | 549 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
550 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
550 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
554 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
554 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
555 | 555 | } |
556 | 556 | |
557 | 557 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
609 | 609 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
610 | 610 | |
611 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
611 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | return implode(', ', $sqlParts); |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | { |
627 | 627 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
628 | 628 | |
629 | - if (!$fieldName) { |
|
629 | + if ( ! $fieldName) { |
|
630 | 630 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
631 | 631 | } |
632 | 632 | |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | $property = $class->getProperty($fieldName); |
656 | 656 | |
657 | 657 | if ($this->useSqlTableAliases) { |
658 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
658 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
659 | 659 | } |
660 | 660 | |
661 | 661 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
670 | 670 | $association = $class->getProperty($fieldName); |
671 | 671 | |
672 | - if (! $association->isOwningSide()) { |
|
672 | + if ( ! $association->isOwningSide()) { |
|
673 | 673 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
674 | 674 | } |
675 | 675 | |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | $joinColumn = reset($joinColumns); |
684 | 684 | |
685 | 685 | if ($this->useSqlTableAliases) { |
686 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
686 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
687 | 687 | } |
688 | 688 | |
689 | 689 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | */ |
702 | 702 | public function walkSelectClause($selectClause) |
703 | 703 | { |
704 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
704 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
705 | 705 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
706 | 706 | |
707 | 707 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | |
745 | 745 | $sqlSelectExpressions[] = sprintf( |
746 | 746 | '%s AS %s', |
747 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
747 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
748 | 748 | $sqlColumnAlias |
749 | 749 | ); |
750 | 750 | |
@@ -754,12 +754,12 @@ discard block |
||
754 | 754 | |
755 | 755 | // Add foreign key columns of class and also parent classes |
756 | 756 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
757 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
757 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
758 | 758 | || ( ! $addMetaColumns && ! $association->isPrimaryKey())) { |
759 | 759 | continue; |
760 | 760 | } |
761 | 761 | |
762 | - $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
762 | + $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
763 | 763 | |
764 | 764 | foreach ($association->getJoinColumns() as $joinColumn) { |
765 | 765 | /** @var JoinColumnMetadata $joinColumn */ |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | $columnAlias = $this->getSQLColumnAlias(); |
770 | 770 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
771 | 771 | |
772 | - if (! $joinColumn->getType()) { |
|
772 | + if ( ! $joinColumn->getType()) { |
|
773 | 773 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
774 | 774 | } |
775 | 775 | |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | continue; |
800 | 800 | } |
801 | 801 | |
802 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
802 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
803 | 803 | continue; |
804 | 804 | } |
805 | 805 | |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $columnAlias = $this->getSQLColumnAlias(); |
814 | 814 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
815 | 815 | |
816 | - if (! $joinColumn->getType()) { |
|
816 | + if ( ! $joinColumn->getType()) { |
|
817 | 817 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
818 | 818 | } |
819 | 819 | |
@@ -847,7 +847,7 @@ discard block |
||
847 | 847 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
848 | 848 | } |
849 | 849 | |
850 | - return ' FROM ' . implode(', ', $sqlParts); |
|
850 | + return ' FROM '.implode(', ', $sqlParts); |
|
851 | 851 | } |
852 | 852 | |
853 | 853 | /** |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
928 | 928 | |
929 | 929 | $sql = $this->platform->appendLockHint( |
930 | - $tableName . ' ' . $tableAlias, |
|
930 | + $tableName.' '.$tableAlias, |
|
931 | 931 | $this->query->getHint(Query::HINT_LOCK_MODE) |
932 | 932 | ); |
933 | 933 | |
@@ -938,10 +938,10 @@ discard block |
||
938 | 938 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
939 | 939 | |
940 | 940 | if ( ! $buildNestedJoins) { |
941 | - return $sql . $classTableInheritanceJoins; |
|
941 | + return $sql.$classTableInheritanceJoins; |
|
942 | 942 | } |
943 | 943 | |
944 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
944 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | /** |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | ; |
979 | 979 | |
980 | 980 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && |
981 | - (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
981 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
982 | 982 | if ($association instanceof ToManyAssociationMetadata) { |
983 | 983 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
984 | 984 | } |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | $targetTableJoin = [ |
1035 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1035 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1036 | 1036 | 'condition' => implode(' AND ', $conditions), |
1037 | 1037 | ]; |
1038 | 1038 | } elseif ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | ); |
1061 | 1061 | } |
1062 | 1062 | |
1063 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1063 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1064 | 1064 | |
1065 | 1065 | // Join target table |
1066 | 1066 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | $targetTableJoin = [ |
1102 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1102 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1103 | 1103 | 'condition' => implode(' AND ', $conditions), |
1104 | 1104 | ]; |
1105 | 1105 | } else { |
@@ -1107,23 +1107,23 @@ discard block |
||
1107 | 1107 | } |
1108 | 1108 | |
1109 | 1109 | // Handle WITH clause |
1110 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1110 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1111 | 1111 | |
1112 | 1112 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
1113 | 1113 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1114 | 1114 | |
1115 | 1115 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1116 | 1116 | if ($withCondition) { |
1117 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1117 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1118 | 1118 | } else { |
1119 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1119 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1120 | 1120 | } |
1121 | 1121 | } else { |
1122 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1122 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | if ($withCondition) { |
1126 | - $sql .= ' AND ' . $withCondition; |
|
1126 | + $sql .= ' AND '.$withCondition; |
|
1127 | 1127 | } |
1128 | 1128 | |
1129 | 1129 | // Apply the indexes |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1157 | 1157 | } |
1158 | 1158 | |
1159 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1159 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1160 | 1160 | } |
1161 | 1161 | |
1162 | 1162 | /** |
@@ -1173,10 +1173,10 @@ discard block |
||
1173 | 1173 | $this->orderedColumnsMap[$sql] = $type; |
1174 | 1174 | |
1175 | 1175 | if ($expr instanceof AST\Subselect) { |
1176 | - return '(' . $sql . ') ' . $type; |
|
1176 | + return '('.$sql.') '.$type; |
|
1177 | 1177 | } |
1178 | 1178 | |
1179 | - return $sql . ' ' . $type; |
|
1179 | + return $sql.' '.$type; |
|
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | /** |
@@ -1184,7 +1184,7 @@ discard block |
||
1184 | 1184 | */ |
1185 | 1185 | public function walkHavingClause($havingClause) |
1186 | 1186 | { |
1187 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1187 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1188 | 1188 | } |
1189 | 1189 | |
1190 | 1190 | /** |
@@ -1207,7 +1207,7 @@ discard block |
||
1207 | 1207 | $conditions = []; |
1208 | 1208 | |
1209 | 1209 | if ($join->conditionalExpression) { |
1210 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1210 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1211 | 1211 | } |
1212 | 1212 | |
1213 | 1213 | $isUnconditionalJoin = empty($conditions); |
@@ -1215,7 +1215,7 @@ discard block |
||
1215 | 1215 | ? ' AND ' |
1216 | 1216 | : ' ON '; |
1217 | 1217 | |
1218 | - $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, !$isUnconditionalJoin); |
|
1218 | + $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, ! $isUnconditionalJoin); |
|
1219 | 1219 | |
1220 | 1220 | // Apply remaining inheritance restrictions |
1221 | 1221 | $discrSql = $this->generateDiscriminatorColumnConditionSQL([$dqlAlias]); |
@@ -1232,7 +1232,7 @@ discard block |
||
1232 | 1232 | } |
1233 | 1233 | |
1234 | 1234 | if ($conditions) { |
1235 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1235 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1236 | 1236 | } |
1237 | 1237 | |
1238 | 1238 | break; |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1263 | 1263 | } |
1264 | 1264 | |
1265 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1265 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1266 | 1266 | |
1267 | 1267 | return $sql; |
1268 | 1268 | } |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1285 | 1285 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1286 | 1286 | |
1287 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1287 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1288 | 1288 | } |
1289 | 1289 | |
1290 | 1290 | /** |
@@ -1299,11 +1299,11 @@ discard block |
||
1299 | 1299 | $sql = 'CASE'; |
1300 | 1300 | |
1301 | 1301 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1302 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1303 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1302 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1303 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1304 | 1304 | } |
1305 | 1305 | |
1306 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1306 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1307 | 1307 | |
1308 | 1308 | return $sql; |
1309 | 1309 | } |
@@ -1317,14 +1317,14 @@ discard block |
||
1317 | 1317 | */ |
1318 | 1318 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1319 | 1319 | { |
1320 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1320 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1321 | 1321 | |
1322 | 1322 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1323 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1324 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1323 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1324 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1325 | 1325 | } |
1326 | 1326 | |
1327 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1327 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1328 | 1328 | |
1329 | 1329 | return $sql; |
1330 | 1330 | } |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | $columnAlias = $this->getSQLColumnAlias(); |
1387 | 1387 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1388 | 1388 | |
1389 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1389 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1390 | 1390 | |
1391 | 1391 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1392 | 1392 | |
@@ -1401,7 +1401,7 @@ discard block |
||
1401 | 1401 | $columnAlias = $this->getSQLColumnAlias(); |
1402 | 1402 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1403 | 1403 | |
1404 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1404 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1405 | 1405 | |
1406 | 1406 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1407 | 1407 | |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | |
1442 | 1442 | // Select all fields from the queried class |
1443 | 1443 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1444 | - if (! ($property instanceof FieldMetadata)) { |
|
1444 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1445 | 1445 | continue; |
1446 | 1446 | } |
1447 | 1447 | |
@@ -1476,11 +1476,11 @@ discard block |
||
1476 | 1476 | $subClass = $this->em->getClassMetadata($subClassName); |
1477 | 1477 | |
1478 | 1478 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1479 | - if (! ($property instanceof FieldMetadata)) { |
|
1479 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1480 | 1480 | continue; |
1481 | 1481 | } |
1482 | 1482 | |
1483 | - if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet, true))) { |
|
1483 | + if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet, true))) { |
|
1484 | 1484 | continue; |
1485 | 1485 | } |
1486 | 1486 | |
@@ -1515,7 +1515,7 @@ discard block |
||
1515 | 1515 | */ |
1516 | 1516 | public function walkQuantifiedExpression($qExpr) |
1517 | 1517 | { |
1518 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1518 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1519 | 1519 | } |
1520 | 1520 | |
1521 | 1521 | /** |
@@ -1555,7 +1555,7 @@ discard block |
||
1555 | 1555 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1556 | 1556 | } |
1557 | 1557 | |
1558 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1558 | + return ' FROM '.implode(', ', $sqlParts); |
|
1559 | 1559 | } |
1560 | 1560 | |
1561 | 1561 | /** |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | */ |
1564 | 1564 | public function walkSimpleSelectClause($simpleSelectClause) |
1565 | 1565 | { |
1566 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1566 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1567 | 1567 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1568 | 1568 | } |
1569 | 1569 | |
@@ -1582,7 +1582,7 @@ discard block |
||
1582 | 1582 | * @param null|string $newObjectResultAlias |
1583 | 1583 | * @return string The SQL. |
1584 | 1584 | */ |
1585 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1585 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1586 | 1586 | { |
1587 | 1587 | $sqlSelectExpressions = []; |
1588 | 1588 | $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
@@ -1598,7 +1598,7 @@ discard block |
||
1598 | 1598 | break; |
1599 | 1599 | |
1600 | 1600 | case ($e instanceof AST\Subselect): |
1601 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1601 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1602 | 1602 | break; |
1603 | 1603 | |
1604 | 1604 | case ($e instanceof AST\PathExpression): |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | $class = $qComp['metadata']; |
1608 | 1608 | $fieldType = $class->getProperty($e->field)->getType(); |
1609 | 1609 | |
1610 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1610 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1611 | 1611 | break; |
1612 | 1612 | |
1613 | 1613 | case ($e instanceof AST\Literal): |
@@ -1621,11 +1621,11 @@ discard block |
||
1621 | 1621 | break; |
1622 | 1622 | } |
1623 | 1623 | |
1624 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1624 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1625 | 1625 | break; |
1626 | 1626 | |
1627 | 1627 | default: |
1628 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1628 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1629 | 1629 | break; |
1630 | 1630 | } |
1631 | 1631 | |
@@ -1658,10 +1658,10 @@ discard block |
||
1658 | 1658 | case ($expr instanceof AST\Subselect): |
1659 | 1659 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1660 | 1660 | |
1661 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1661 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1662 | 1662 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1663 | 1663 | |
1664 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1664 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1665 | 1665 | break; |
1666 | 1666 | |
1667 | 1667 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | $columnAlias = $this->getSQLColumnAlias(); |
1679 | 1679 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1680 | 1680 | |
1681 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1681 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1682 | 1682 | break; |
1683 | 1683 | |
1684 | 1684 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1698,8 +1698,8 @@ discard block |
||
1698 | 1698 | */ |
1699 | 1699 | public function walkAggregateExpression($aggExpression) |
1700 | 1700 | { |
1701 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1702 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1701 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1702 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1703 | 1703 | } |
1704 | 1704 | |
1705 | 1705 | /** |
@@ -1713,7 +1713,7 @@ discard block |
||
1713 | 1713 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1714 | 1714 | } |
1715 | 1715 | |
1716 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1716 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1717 | 1717 | } |
1718 | 1718 | |
1719 | 1719 | /** |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | { |
1777 | 1777 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1778 | 1778 | $tableName = $class->getTableName(); |
1779 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1779 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
1780 | 1780 | |
1781 | 1781 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1782 | 1782 | |
@@ -1792,12 +1792,12 @@ discard block |
||
1792 | 1792 | { |
1793 | 1793 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1794 | 1794 | $tableName = $class->getTableName(); |
1795 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1795 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
1796 | 1796 | |
1797 | 1797 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1798 | 1798 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1799 | 1799 | |
1800 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1800 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1801 | 1801 | |
1802 | 1802 | return $sql; |
1803 | 1803 | } |
@@ -1810,7 +1810,7 @@ discard block |
||
1810 | 1810 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1811 | 1811 | $this->useSqlTableAliases = false; |
1812 | 1812 | |
1813 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1813 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1814 | 1814 | $newValue = $updateItem->newValue; |
1815 | 1815 | |
1816 | 1816 | switch (true) { |
@@ -1853,7 +1853,7 @@ discard block |
||
1853 | 1853 | |
1854 | 1854 | if ($filterClauses) { |
1855 | 1855 | if ($condSql) { |
1856 | - $condSql = '(' . $condSql . ') AND '; |
|
1856 | + $condSql = '('.$condSql.') AND '; |
|
1857 | 1857 | } |
1858 | 1858 | |
1859 | 1859 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1861,11 +1861,11 @@ discard block |
||
1861 | 1861 | } |
1862 | 1862 | |
1863 | 1863 | if ($condSql) { |
1864 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1864 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1865 | 1865 | } |
1866 | 1866 | |
1867 | 1867 | if ($discrSql) { |
1868 | - return ' WHERE ' . $discrSql; |
|
1868 | + return ' WHERE '.$discrSql; |
|
1869 | 1869 | } |
1870 | 1870 | |
1871 | 1871 | return ''; |
@@ -1908,7 +1908,7 @@ discard block |
||
1908 | 1908 | // if only one ConditionalPrimary is defined |
1909 | 1909 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1910 | 1910 | ? $this->walkConditionalPrimary($factor) |
1911 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1911 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1912 | 1912 | } |
1913 | 1913 | |
1914 | 1914 | /** |
@@ -1923,7 +1923,7 @@ discard block |
||
1923 | 1923 | if ($primary->isConditionalExpression()) { |
1924 | 1924 | $condExpr = $primary->conditionalExpression; |
1925 | 1925 | |
1926 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1926 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1927 | 1927 | } |
1928 | 1928 | } |
1929 | 1929 | |
@@ -1934,7 +1934,7 @@ discard block |
||
1934 | 1934 | { |
1935 | 1935 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1936 | 1936 | |
1937 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1937 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1938 | 1938 | |
1939 | 1939 | return $sql; |
1940 | 1940 | } |
@@ -1983,7 +1983,7 @@ discard block |
||
1983 | 1983 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1984 | 1984 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1985 | 1985 | |
1986 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
1986 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
1987 | 1987 | |
1988 | 1988 | $sqlParts = []; |
1989 | 1989 | |
@@ -2004,7 +2004,7 @@ discard block |
||
2004 | 2004 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2005 | 2005 | } |
2006 | 2006 | |
2007 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2007 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2008 | 2008 | } |
2009 | 2009 | |
2010 | 2010 | $sql .= implode(' AND ', $sqlParts); |
@@ -2018,7 +2018,7 @@ discard block |
||
2018 | 2018 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
2019 | 2019 | |
2020 | 2020 | // join to target table |
2021 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
2021 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
2022 | 2022 | |
2023 | 2023 | // join conditions |
2024 | 2024 | $joinSqlParts = []; |
@@ -2069,13 +2069,13 @@ discard block |
||
2069 | 2069 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2070 | 2070 | } |
2071 | 2071 | |
2072 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2072 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2073 | 2073 | } |
2074 | 2074 | |
2075 | 2075 | $sql .= implode(' AND ', $sqlParts); |
2076 | 2076 | } |
2077 | 2077 | |
2078 | - return $sql . ')'; |
|
2078 | + return $sql.')'; |
|
2079 | 2079 | } |
2080 | 2080 | |
2081 | 2081 | /** |
@@ -2086,7 +2086,7 @@ discard block |
||
2086 | 2086 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2087 | 2087 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2088 | 2088 | |
2089 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2089 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2090 | 2090 | } |
2091 | 2091 | |
2092 | 2092 | /** |
@@ -2095,19 +2095,19 @@ discard block |
||
2095 | 2095 | public function walkNullComparisonExpression($nullCompExpr) |
2096 | 2096 | { |
2097 | 2097 | $expression = $nullCompExpr->expression; |
2098 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2098 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2099 | 2099 | |
2100 | 2100 | // Handle ResultVariable |
2101 | 2101 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2102 | - return $this->walkResultVariable($expression) . $comparison; |
|
2102 | + return $this->walkResultVariable($expression).$comparison; |
|
2103 | 2103 | } |
2104 | 2104 | |
2105 | 2105 | // Handle InputParameter mapping inclusion to ParserResult |
2106 | 2106 | if ($expression instanceof AST\InputParameter) { |
2107 | - return $this->walkInputParameter($expression) . $comparison; |
|
2107 | + return $this->walkInputParameter($expression).$comparison; |
|
2108 | 2108 | } |
2109 | 2109 | |
2110 | - return $expression->dispatch($this) . $comparison; |
|
2110 | + return $expression->dispatch($this).$comparison; |
|
2111 | 2111 | } |
2112 | 2112 | |
2113 | 2113 | /** |
@@ -2115,7 +2115,7 @@ discard block |
||
2115 | 2115 | */ |
2116 | 2116 | public function walkInExpression($inExpr) |
2117 | 2117 | { |
2118 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2118 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2119 | 2119 | |
2120 | 2120 | $sql .= ($inExpr->subselect) |
2121 | 2121 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2139,12 +2139,12 @@ discard block |
||
2139 | 2139 | $discrColumnType = $discrColumn->getType(); |
2140 | 2140 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
2141 | 2141 | $sqlTableAlias = $this->useSqlTableAliases |
2142 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
2142 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
2143 | 2143 | : ''; |
2144 | 2144 | |
2145 | 2145 | return sprintf( |
2146 | 2146 | '%s %sIN %s', |
2147 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
2147 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
2148 | 2148 | ($instanceOfExpr->not ? 'NOT ' : ''), |
2149 | 2149 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
2150 | 2150 | ); |
@@ -2191,8 +2191,8 @@ discard block |
||
2191 | 2191 | $sql .= ' NOT'; |
2192 | 2192 | } |
2193 | 2193 | |
2194 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2195 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2194 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2195 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2196 | 2196 | |
2197 | 2197 | return $sql; |
2198 | 2198 | } |
@@ -2207,7 +2207,7 @@ discard block |
||
2207 | 2207 | ? $this->walkResultVariable($stringExpr) |
2208 | 2208 | : $stringExpr->dispatch($this); |
2209 | 2209 | |
2210 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2210 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2211 | 2211 | |
2212 | 2212 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2213 | 2213 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2220,7 +2220,7 @@ discard block |
||
2220 | 2220 | } |
2221 | 2221 | |
2222 | 2222 | if ($likeExpr->escapeChar) { |
2223 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2223 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2224 | 2224 | } |
2225 | 2225 | |
2226 | 2226 | return $sql; |
@@ -2247,7 +2247,7 @@ discard block |
||
2247 | 2247 | ? $leftExpr->dispatch($this) |
2248 | 2248 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2249 | 2249 | |
2250 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2250 | + $sql .= ' '.$compExpr->operator.' '; |
|
2251 | 2251 | |
2252 | 2252 | $sql .= ($rightExpr instanceof AST\Node) |
2253 | 2253 | ? $rightExpr->dispatch($this) |
@@ -2279,7 +2279,7 @@ discard block |
||
2279 | 2279 | { |
2280 | 2280 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2281 | 2281 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2282 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2282 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2283 | 2283 | } |
2284 | 2284 | |
2285 | 2285 | /** |
@@ -2333,7 +2333,7 @@ discard block |
||
2333 | 2333 | |
2334 | 2334 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2335 | 2335 | |
2336 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2336 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2337 | 2337 | } |
2338 | 2338 | |
2339 | 2339 | /** |
@@ -2346,7 +2346,7 @@ discard block |
||
2346 | 2346 | public function walkArithmeticPrimary($primary) |
2347 | 2347 | { |
2348 | 2348 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2349 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2349 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2350 | 2350 | } |
2351 | 2351 | |
2352 | 2352 | if ($primary instanceof AST\Node) { |
@@ -2407,7 +2407,7 @@ discard block |
||
2407 | 2407 | $entityClassName = $entityClass->getClassName(); |
2408 | 2408 | |
2409 | 2409 | if ($entityClassName !== $rootClass->getClassName()) { |
2410 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2410 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2411 | 2411 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
2412 | 2412 | } |
2413 | 2413 | } |
@@ -2419,6 +2419,6 @@ discard block |
||
2419 | 2419 | $sqlParameterList[] = $this->conn->quote($discriminator); |
2420 | 2420 | } |
2421 | 2421 | |
2422 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
2422 | + return '('.implode(', ', $sqlParameterList).')'; |
|
2423 | 2423 | } |
2424 | 2424 | } |
@@ -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 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
407 | 407 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
408 | 408 | |
409 | - if (! $joinColumn->getType()) { |
|
409 | + if ( ! $joinColumn->getType()) { |
|
410 | 410 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
411 | 411 | } |
412 | 412 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
475 | 475 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
476 | 476 | |
477 | - if (! $joinColumn->getType()) { |
|
477 | + if ( ! $joinColumn->getType()) { |
|
478 | 478 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
479 | 479 | } |
480 | 480 | |
@@ -501,18 +501,18 @@ discard block |
||
501 | 501 | case Type::SMALLINT: |
502 | 502 | case Type::INTEGER: |
503 | 503 | case Type::BIGINT: |
504 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
504 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
505 | 505 | break; |
506 | 506 | |
507 | 507 | case Type::DATETIME: |
508 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
508 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
509 | 509 | break; |
510 | 510 | } |
511 | 511 | } |
512 | 512 | |
513 | - $sql = 'UPDATE ' . $quotedTableName |
|
514 | - . ' SET ' . implode(', ', $set) |
|
515 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
513 | + $sql = 'UPDATE '.$quotedTableName |
|
514 | + . ' SET '.implode(', ', $set) |
|
515 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
516 | 516 | |
517 | 517 | $result = $this->conn->executeUpdate($sql, $params, $types); |
518 | 518 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | protected function deleteJoinTableRecords($identifier) |
532 | 532 | { |
533 | 533 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
534 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
534 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
535 | 535 | continue; |
536 | 536 | } |
537 | 537 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | $keys = []; |
545 | 545 | |
546 | 546 | if ( ! $owningAssociation->isOwningSide()) { |
547 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
547 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
548 | 548 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
549 | 549 | } |
550 | 550 | |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | } |
657 | 657 | |
658 | 658 | // Only owning side of x-1 associations can have a FK column. |
659 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
659 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
660 | 660 | continue; |
661 | 661 | } |
662 | 662 | |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | /** @var JoinColumnMetadata $joinColumn */ |
677 | 677 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
678 | 678 | |
679 | - if (! $joinColumn->getType()) { |
|
679 | + if ( ! $joinColumn->getType()) { |
|
680 | 680 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
681 | 681 | } |
682 | 682 | |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | $propertyName = $this->class->fieldNames[$columnName]; |
706 | 706 | $property = $this->class->getProperty($propertyName); |
707 | 707 | |
708 | - if (! $property) { |
|
708 | + if ( ! $property) { |
|
709 | 709 | return null; |
710 | 710 | } |
711 | 711 | |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | /** @var JoinColumnMetadata $joinColumn */ |
725 | 725 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
726 | 726 | |
727 | - if (! $joinColumn->getType()) { |
|
727 | + if ( ! $joinColumn->getType()) { |
|
728 | 728 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
729 | 729 | } |
730 | 730 | |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | $criteria = []; |
1062 | 1062 | $parameters = []; |
1063 | 1063 | |
1064 | - if (! $association->isOwningSide()) { |
|
1064 | + if ( ! $association->isOwningSide()) { |
|
1065 | 1065 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1066 | 1066 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1067 | 1067 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | $value = $value[$targetClass->identifier[0]]; |
1090 | 1090 | } |
1091 | 1091 | |
1092 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1092 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1093 | 1093 | $parameters[] = [ |
1094 | 1094 | 'value' => $value, |
1095 | 1095 | 'field' => $fieldName, |
@@ -1140,11 +1140,11 @@ discard block |
||
1140 | 1140 | |
1141 | 1141 | switch ($lockMode) { |
1142 | 1142 | case LockMode::PESSIMISTIC_READ: |
1143 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1143 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1144 | 1144 | break; |
1145 | 1145 | |
1146 | 1146 | case LockMode::PESSIMISTIC_WRITE: |
1147 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1147 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1148 | 1148 | break; |
1149 | 1149 | } |
1150 | 1150 | |
@@ -1155,14 +1155,14 @@ discard block |
||
1155 | 1155 | |
1156 | 1156 | if ('' !== $filterSql) { |
1157 | 1157 | $conditionSql = $conditionSql |
1158 | - ? $conditionSql . ' AND ' . $filterSql |
|
1158 | + ? $conditionSql.' AND '.$filterSql |
|
1159 | 1159 | : $filterSql; |
1160 | 1160 | } |
1161 | 1161 | |
1162 | - $select = 'SELECT ' . $columnList; |
|
1163 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1164 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1165 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1162 | + $select = 'SELECT '.$columnList; |
|
1163 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1164 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1165 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1166 | 1166 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1167 | 1167 | $query = $select |
1168 | 1168 | . $lock |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | . $where |
1171 | 1171 | . $orderBySql; |
1172 | 1172 | |
1173 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1173 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1174 | 1174 | } |
1175 | 1175 | |
1176 | 1176 | /** |
@@ -1189,13 +1189,13 @@ discard block |
||
1189 | 1189 | |
1190 | 1190 | if ('' !== $filterSql) { |
1191 | 1191 | $conditionSql = $conditionSql |
1192 | - ? $conditionSql . ' AND ' . $filterSql |
|
1192 | + ? $conditionSql.' AND '.$filterSql |
|
1193 | 1193 | : $filterSql; |
1194 | 1194 | } |
1195 | 1195 | |
1196 | 1196 | $sql = 'SELECT COUNT(*) ' |
1197 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1198 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1197 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1198 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1199 | 1199 | |
1200 | 1200 | return $sql; |
1201 | 1201 | } |
@@ -1212,7 +1212,7 @@ discard block |
||
1212 | 1212 | */ |
1213 | 1213 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
1214 | 1214 | { |
1215 | - if (! $orderBy) { |
|
1215 | + if ( ! $orderBy) { |
|
1216 | 1216 | return ''; |
1217 | 1217 | } |
1218 | 1218 | |
@@ -1221,7 +1221,7 @@ discard block |
||
1221 | 1221 | foreach ($orderBy as $fieldName => $orientation) { |
1222 | 1222 | $orientation = strtoupper(trim($orientation)); |
1223 | 1223 | |
1224 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1224 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1225 | 1225 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
1226 | 1226 | } |
1227 | 1227 | |
@@ -1231,11 +1231,11 @@ discard block |
||
1231 | 1231 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1232 | 1232 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1233 | 1233 | |
1234 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1234 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1235 | 1235 | |
1236 | 1236 | continue; |
1237 | 1237 | } elseif ($property instanceof AssociationMetadata) { |
1238 | - if (! $property->isOwningSide()) { |
|
1238 | + if ( ! $property->isOwningSide()) { |
|
1239 | 1239 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName); |
1240 | 1240 | } |
1241 | 1241 | |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | /* @var JoinColumnMetadata $joinColumn */ |
1249 | 1249 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1250 | 1250 | |
1251 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1251 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | continue; |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | throw ORMException::unrecognizedField($fieldName); |
1258 | 1258 | } |
1259 | 1259 | |
1260 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1260 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1261 | 1261 | } |
1262 | 1262 | |
1263 | 1263 | /** |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | |
1280 | 1280 | |
1281 | 1281 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
1282 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1282 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1283 | 1283 | |
1284 | 1284 | $eagerAliasCounter = 0; |
1285 | 1285 | $columnList = []; |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | break; // now this is why you shouldn't use inheritance |
1316 | 1316 | } |
1317 | 1317 | |
1318 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1318 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1319 | 1319 | |
1320 | 1320 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1321 | 1321 | |
@@ -1340,14 +1340,14 @@ discard block |
||
1340 | 1340 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1341 | 1341 | } |
1342 | 1342 | |
1343 | - if (! $property->isOwningSide()) { |
|
1343 | + if ( ! $property->isOwningSide()) { |
|
1344 | 1344 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1345 | 1345 | } |
1346 | 1346 | |
1347 | 1347 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1348 | 1348 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1349 | 1349 | |
1350 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1350 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1351 | 1351 | |
1352 | 1352 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1353 | 1353 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1369,7 +1369,7 @@ discard block |
||
1369 | 1369 | $joinCondition[] = $filterSql; |
1370 | 1370 | } |
1371 | 1371 | |
1372 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1372 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1373 | 1373 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1374 | 1374 | |
1375 | 1375 | break; |
@@ -1393,7 +1393,7 @@ discard block |
||
1393 | 1393 | */ |
1394 | 1394 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1395 | 1395 | { |
1396 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1396 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1397 | 1397 | return ''; |
1398 | 1398 | } |
1399 | 1399 | |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1409 | 1409 | $resultColumnName = $this->getSQLColumnAlias(); |
1410 | 1410 | |
1411 | - if (! $joinColumn->getType()) { |
|
1411 | + if ( ! $joinColumn->getType()) { |
|
1412 | 1412 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1413 | 1413 | } |
1414 | 1414 | |
@@ -1440,7 +1440,7 @@ discard block |
||
1440 | 1440 | $owningAssociation = $association; |
1441 | 1441 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1442 | 1442 | |
1443 | - if (! $association->isOwningSide()) { |
|
1443 | + if ( ! $association->isOwningSide()) { |
|
1444 | 1444 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1445 | 1445 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1446 | 1446 | } |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | ); |
1463 | 1463 | } |
1464 | 1464 | |
1465 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1465 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1466 | 1466 | } |
1467 | 1467 | |
1468 | 1468 | /** |
@@ -1557,7 +1557,7 @@ discard block |
||
1557 | 1557 | $columnName = $joinColumn->getColumnName(); |
1558 | 1558 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1559 | 1559 | |
1560 | - if (! $joinColumn->getType()) { |
|
1560 | + if ( ! $joinColumn->getType()) { |
|
1561 | 1561 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1562 | 1562 | } |
1563 | 1563 | |
@@ -1596,7 +1596,7 @@ discard block |
||
1596 | 1596 | |
1597 | 1597 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1598 | 1598 | |
1599 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1599 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1600 | 1600 | } |
1601 | 1601 | |
1602 | 1602 | /** |
@@ -1610,14 +1610,14 @@ discard block |
||
1610 | 1610 | protected function getSQLTableAlias($tableName, $assocName = '') |
1611 | 1611 | { |
1612 | 1612 | if ($tableName) { |
1613 | - $tableName .= '#' . $assocName; |
|
1613 | + $tableName .= '#'.$assocName; |
|
1614 | 1614 | } |
1615 | 1615 | |
1616 | 1616 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1617 | 1617 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1618 | 1618 | } |
1619 | 1619 | |
1620 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1620 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1621 | 1621 | |
1622 | 1622 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1623 | 1623 | |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | } |
1645 | 1645 | |
1646 | 1646 | $lock = $this->getLockTablesSql($lockMode); |
1647 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1647 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1648 | 1648 | $sql = 'SELECT 1 ' |
1649 | 1649 | . $lock |
1650 | 1650 | . $where |
@@ -1667,7 +1667,7 @@ discard block |
||
1667 | 1667 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1668 | 1668 | |
1669 | 1669 | return $this->platform->appendLockHint( |
1670 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1670 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1671 | 1671 | $lockMode |
1672 | 1672 | ); |
1673 | 1673 | } |
@@ -1720,19 +1720,19 @@ discard block |
||
1720 | 1720 | |
1721 | 1721 | if (null !== $comparison) { |
1722 | 1722 | // special case null value handling |
1723 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1724 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1723 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1724 | + $selectedColumns[] = $column.' IS NULL'; |
|
1725 | 1725 | |
1726 | 1726 | continue; |
1727 | 1727 | } |
1728 | 1728 | |
1729 | 1729 | if ($comparison === Comparison::NEQ && null === $value) { |
1730 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1730 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1731 | 1731 | |
1732 | 1732 | continue; |
1733 | 1733 | } |
1734 | 1734 | |
1735 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1735 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1736 | 1736 | |
1737 | 1737 | continue; |
1738 | 1738 | } |
@@ -1781,7 +1781,7 @@ discard block |
||
1781 | 1781 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1782 | 1782 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1783 | 1783 | |
1784 | - return [$tableAlias . '.' . $columnName]; |
|
1784 | + return [$tableAlias.'.'.$columnName]; |
|
1785 | 1785 | } |
1786 | 1786 | |
1787 | 1787 | if ($property instanceof AssociationMetadata) { |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | |
1791 | 1791 | // Many-To-Many requires join table check for joinColumn |
1792 | 1792 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1793 | - if (! $owningAssociation->isOwningSide()) { |
|
1793 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1794 | 1794 | $owningAssociation = $association; |
1795 | 1795 | } |
1796 | 1796 | |
@@ -1804,14 +1804,14 @@ discard block |
||
1804 | 1804 | foreach ($joinColumns as $joinColumn) { |
1805 | 1805 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1806 | 1806 | |
1807 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1807 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1808 | 1808 | } |
1809 | 1809 | } else { |
1810 | - if (! $owningAssociation->isOwningSide()) { |
|
1810 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1811 | 1811 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field); |
1812 | 1812 | } |
1813 | 1813 | |
1814 | - $class = $this->class->isInheritedProperty($field) |
|
1814 | + $class = $this->class->isInheritedProperty($field) |
|
1815 | 1815 | ? $owningAssociation->getDeclaringClass() |
1816 | 1816 | : $this->class |
1817 | 1817 | ; |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1821 | 1821 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1822 | 1822 | |
1823 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1823 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1824 | 1824 | } |
1825 | 1825 | } |
1826 | 1826 | |
@@ -1933,7 +1933,7 @@ discard block |
||
1933 | 1933 | $value = $value[$targetClass->identifier[0]]; |
1934 | 1934 | } |
1935 | 1935 | |
1936 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
1936 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
1937 | 1937 | $parameters[] = [ |
1938 | 1938 | 'value' => $value, |
1939 | 1939 | 'field' => $fieldName, |
@@ -2020,7 +2020,7 @@ discard block |
||
2020 | 2020 | case ($property instanceof AssociationMetadata): |
2021 | 2021 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2022 | 2022 | |
2023 | - if (! $property->isOwningSide()) { |
|
2023 | + if ( ! $property->isOwningSide()) { |
|
2024 | 2024 | $property = $class->getProperty($property->getMappedBy()); |
2025 | 2025 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2026 | 2026 | } |
@@ -2034,7 +2034,7 @@ discard block |
||
2034 | 2034 | /** @var JoinColumnMetadata $joinColumn */ |
2035 | 2035 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2036 | 2036 | |
2037 | - if (! $joinColumn->getType()) { |
|
2037 | + if ( ! $joinColumn->getType()) { |
|
2038 | 2038 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2039 | 2039 | } |
2040 | 2040 | |
@@ -2049,7 +2049,7 @@ discard block |
||
2049 | 2049 | } |
2050 | 2050 | |
2051 | 2051 | if (is_array($value)) { |
2052 | - return array_map(function ($type) { |
|
2052 | + return array_map(function($type) { |
|
2053 | 2053 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2054 | 2054 | }, $types); |
2055 | 2055 | } |
@@ -2128,12 +2128,12 @@ discard block |
||
2128 | 2128 | |
2129 | 2129 | $sql = 'SELECT 1 ' |
2130 | 2130 | . $this->getLockTablesSql(null) |
2131 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2131 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2132 | 2132 | |
2133 | 2133 | list($params, $types) = $this->expandParameters($criteria); |
2134 | 2134 | |
2135 | 2135 | if (null !== $extraConditions) { |
2136 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2136 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2137 | 2137 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2138 | 2138 | |
2139 | 2139 | $params = array_merge($params, $criteriaParams); |
@@ -2141,7 +2141,7 @@ discard block |
||
2141 | 2141 | } |
2142 | 2142 | |
2143 | 2143 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2144 | - $sql .= ' AND ' . $filterSql; |
|
2144 | + $sql .= ' AND '.$filterSql; |
|
2145 | 2145 | } |
2146 | 2146 | |
2147 | 2147 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2156,13 +2156,13 @@ discard block |
||
2156 | 2156 | */ |
2157 | 2157 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2158 | 2158 | { |
2159 | - if (! $association->isOwningSide()) { |
|
2159 | + if ( ! $association->isOwningSide()) { |
|
2160 | 2160 | return 'LEFT JOIN'; |
2161 | 2161 | } |
2162 | 2162 | |
2163 | 2163 | // if one of the join columns is nullable, return left join |
2164 | 2164 | foreach ($association->getJoinColumns() as $joinColumn) { |
2165 | - if (! $joinColumn->isNullable()) { |
|
2165 | + if ( ! $joinColumn->isNullable()) { |
|
2166 | 2166 | continue; |
2167 | 2167 | } |
2168 | 2168 | |
@@ -2179,7 +2179,7 @@ discard block |
||
2179 | 2179 | */ |
2180 | 2180 | public function getSQLColumnAlias() |
2181 | 2181 | { |
2182 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2182 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2183 | 2183 | } |
2184 | 2184 | |
2185 | 2185 | /** |
@@ -2196,13 +2196,13 @@ discard block |
||
2196 | 2196 | |
2197 | 2197 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2198 | 2198 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2199 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2199 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2200 | 2200 | } |
2201 | 2201 | } |
2202 | 2202 | |
2203 | 2203 | $sql = implode(' AND ', $filterClauses); |
2204 | 2204 | |
2205 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2205 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2206 | 2206 | } |
2207 | 2207 | |
2208 | 2208 | /** |
@@ -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 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | */ |
309 | 309 | public function __toString() |
310 | 310 | { |
311 | - return __CLASS__ . '@' . spl_object_id($this); |
|
311 | + return __CLASS__.'@'.spl_object_id($this); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | // Restore ReflectionClass and properties |
412 | 412 | $this->reflectionClass = $reflectionService->getClass($this->className); |
413 | 413 | |
414 | - if (! $this->reflectionClass) { |
|
414 | + if ( ! $this->reflectionClass) { |
|
415 | 415 | return; |
416 | 416 | } |
417 | 417 | |
@@ -437,11 +437,11 @@ discard block |
||
437 | 437 | } |
438 | 438 | |
439 | 439 | // Verify & complete identifier mapping |
440 | - if (! $this->identifier) { |
|
440 | + if ( ! $this->identifier) { |
|
441 | 441 | throw MappingException::identifierRequired($this->className); |
442 | 442 | } |
443 | 443 | |
444 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
444 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
445 | 445 | return $property instanceof FieldMetadata |
446 | 446 | && $property->isPrimaryKey() |
447 | 447 | && $property->hasValueGenerator(); |
@@ -462,14 +462,14 @@ discard block |
||
462 | 462 | public function validateAssociations() : void |
463 | 463 | { |
464 | 464 | array_map( |
465 | - function (Property $property) { |
|
466 | - if (! ($property instanceof AssociationMetadata)) { |
|
465 | + function(Property $property) { |
|
466 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
467 | 467 | return; |
468 | 468 | } |
469 | 469 | |
470 | 470 | $targetEntity = $property->getTargetEntity(); |
471 | 471 | |
472 | - if (! class_exists($targetEntity)) { |
|
472 | + if ( ! class_exists($targetEntity)) { |
|
473 | 473 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
474 | 474 | } |
475 | 475 | }, |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | foreach ($this->lifecycleCallbacks as $callbacks) { |
492 | 492 | /** @var array $callbacks */ |
493 | 493 | foreach ($callbacks as $callbackFuncName) { |
494 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
494 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
495 | 495 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
496 | 496 | } |
497 | 497 | } |
@@ -519,11 +519,11 @@ discard block |
||
519 | 519 | */ |
520 | 520 | public function isIdentifier(string $fieldName) : bool |
521 | 521 | { |
522 | - if (! $this->identifier) { |
|
522 | + if ( ! $this->identifier) { |
|
523 | 523 | return false; |
524 | 524 | } |
525 | 525 | |
526 | - if (! $this->isIdentifierComposite()) { |
|
526 | + if ( ! $this->isIdentifierComposite()) { |
|
527 | 527 | return $fieldName === $this->identifier[0]; |
528 | 528 | } |
529 | 529 | |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | */ |
552 | 552 | public function getNamedQuery($queryName) : string |
553 | 553 | { |
554 | - if (! isset($this->namedQueries[$queryName])) { |
|
554 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
555 | 555 | throw MappingException::queryNotFound($this->className, $queryName); |
556 | 556 | } |
557 | 557 | |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | */ |
612 | 612 | public function getSqlResultSetMapping($name) |
613 | 613 | { |
614 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
614 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
615 | 615 | throw MappingException::resultMappingNotFound($this->className, $name); |
616 | 616 | } |
617 | 617 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | $property->setColumnName($columnName); |
647 | 647 | } |
648 | 648 | |
649 | - if (! $this->isMappedSuperclass) { |
|
649 | + if ( ! $this->isMappedSuperclass) { |
|
650 | 650 | $property->setTableName($this->getTableName()); |
651 | 651 | } |
652 | 652 | |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
667 | 667 | } |
668 | 668 | |
669 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
669 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
670 | 670 | $this->identifier[] = $fieldName; |
671 | 671 | } |
672 | 672 | } |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | $fieldName = $property->getName(); |
721 | 721 | $targetEntity = $property->getTargetEntity(); |
722 | 722 | |
723 | - if (! $targetEntity) { |
|
723 | + if ( ! $targetEntity) { |
|
724 | 724 | throw MappingException::missingTargetEntity($fieldName); |
725 | 725 | } |
726 | 726 | |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | $this->identifier[] = $property->getName(); |
747 | 747 | } |
748 | 748 | |
749 | - if ($this->cache && !$property->getCache()) { |
|
749 | + if ($this->cache && ! $property->getCache()) { |
|
750 | 750 | throw CacheException::nonCacheableEntityAssociation($this->className, $fieldName); |
751 | 751 | } |
752 | 752 | |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | /** @var JoinColumnMetadata $joinColumn */ |
801 | 801 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
802 | 802 | if (1 === count($property->getJoinColumns())) { |
803 | - if (! $property->isPrimaryKey()) { |
|
803 | + if ( ! $property->isPrimaryKey()) { |
|
804 | 804 | $joinColumn->setUnique(true); |
805 | 805 | } |
806 | 806 | } else { |
@@ -808,13 +808,13 @@ discard block |
||
808 | 808 | } |
809 | 809 | } |
810 | 810 | |
811 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
811 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
812 | 812 | |
813 | - if (! $joinColumn->getColumnName()) { |
|
813 | + if ( ! $joinColumn->getColumnName()) { |
|
814 | 814 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
815 | 815 | } |
816 | 816 | |
817 | - if (! $joinColumn->getReferencedColumnName()) { |
|
817 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
818 | 818 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
819 | 819 | } |
820 | 820 | |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | if ($property->isOrphanRemoval()) { |
843 | 843 | $cascades = $property->getCascade(); |
844 | 844 | |
845 | - if (! in_array('remove', $cascades, true)) { |
|
845 | + if ( ! in_array('remove', $cascades, true)) { |
|
846 | 846 | $cascades[] = 'remove'; |
847 | 847 | |
848 | 848 | $property->setCascade($cascades); |
@@ -908,14 +908,14 @@ discard block |
||
908 | 908 | $property->setOwningSide(false); |
909 | 909 | |
910 | 910 | // OneToMany MUST have mappedBy |
911 | - if (! $property->getMappedBy()) { |
|
911 | + if ( ! $property->getMappedBy()) { |
|
912 | 912 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
913 | 913 | } |
914 | 914 | |
915 | 915 | if ($property->isOrphanRemoval()) { |
916 | 916 | $cascades = $property->getCascade(); |
917 | 917 | |
918 | - if (! in_array('remove', $cascades, true)) { |
|
918 | + if ( ! in_array('remove', $cascades, true)) { |
|
919 | 919 | $cascades[] = 'remove'; |
920 | 920 | |
921 | 921 | $property->setCascade($cascades); |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | |
939 | 939 | $property->setJoinTable($joinTable); |
940 | 940 | |
941 | - if (! $joinTable->getName()) { |
|
941 | + if ( ! $joinTable->getName()) { |
|
942 | 942 | $joinTableName = $this->namingStrategy->joinTableName( |
943 | 943 | $property->getSourceEntity(), |
944 | 944 | $property->getTargetEntity(), |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | |
951 | 951 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
952 | 952 | |
953 | - if (! $joinTable->getJoinColumns()) { |
|
953 | + if ( ! $joinTable->getJoinColumns()) { |
|
954 | 954 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
955 | 955 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
956 | 956 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | $joinTable->addJoinColumn($joinColumn); |
964 | 964 | } |
965 | 965 | |
966 | - if (! $joinTable->getInverseJoinColumns()) { |
|
966 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
967 | 967 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
968 | 968 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
969 | 969 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -978,13 +978,13 @@ discard block |
||
978 | 978 | |
979 | 979 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
980 | 980 | /** @var JoinColumnMetadata $joinColumn */ |
981 | - if (! $joinColumn->getReferencedColumnName()) { |
|
981 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
982 | 982 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
983 | 983 | } |
984 | 984 | |
985 | 985 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
986 | 986 | |
987 | - if (! $joinColumn->getColumnName()) { |
|
987 | + if ( ! $joinColumn->getColumnName()) { |
|
988 | 988 | $columnName = $this->namingStrategy->joinKeyColumnName( |
989 | 989 | $property->getSourceEntity(), |
990 | 990 | $referencedColumnName |
@@ -996,13 +996,13 @@ discard block |
||
996 | 996 | |
997 | 997 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
998 | 998 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
999 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
999 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
1000 | 1000 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
1001 | 1001 | } |
1002 | 1002 | |
1003 | 1003 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
1004 | 1004 | |
1005 | - if (! $inverseJoinColumn->getColumnName()) { |
|
1005 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
1006 | 1006 | $columnName = $this->namingStrategy->joinKeyColumnName( |
1007 | 1007 | $property->getTargetEntity(), |
1008 | 1008 | $referencedColumnName |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | // Association defined as Id field |
1100 | 1100 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1101 | 1101 | |
1102 | - if (! $property->isOwningSide()) { |
|
1102 | + if ( ! $property->isOwningSide()) { |
|
1103 | 1103 | $property = $targetClass->getProperty($property->getMappedBy()); |
1104 | 1104 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
1105 | 1105 | } |
@@ -1114,7 +1114,7 @@ discard block |
||
1114 | 1114 | $columnName = $joinColumn->getColumnName(); |
1115 | 1115 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1116 | 1116 | |
1117 | - if (! $joinColumn->getType()) { |
|
1117 | + if ( ! $joinColumn->getType()) { |
|
1118 | 1118 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
1119 | 1119 | } |
1120 | 1120 | |
@@ -1154,11 +1154,11 @@ discard block |
||
1154 | 1154 | { |
1155 | 1155 | $schema = null === $this->getSchemaName() |
1156 | 1156 | ? '' |
1157 | - : $this->getSchemaName() . '_' |
|
1157 | + : $this->getSchemaName().'_' |
|
1158 | 1158 | ; |
1159 | 1159 | |
1160 | 1160 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
1161 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
1161 | + return $schema.$this->getTableName().'_id_tmp'; |
|
1162 | 1162 | } |
1163 | 1163 | |
1164 | 1164 | /** |
@@ -1218,7 +1218,7 @@ discard block |
||
1218 | 1218 | { |
1219 | 1219 | $fieldName = $property->getName(); |
1220 | 1220 | |
1221 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1221 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1222 | 1222 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1223 | 1223 | } |
1224 | 1224 | |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | $declaringClass = $property->getDeclaringClass(); |
1427 | 1427 | |
1428 | 1428 | if ($inheritedProperty instanceof FieldMetadata) { |
1429 | - if (! $declaringClass->isMappedSuperclass) { |
|
1429 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1430 | 1430 | $inheritedProperty->setTableName($property->getTableName()); |
1431 | 1431 | } |
1432 | 1432 | |
@@ -1494,7 +1494,7 @@ discard block |
||
1494 | 1494 | throw MappingException::duplicateQueryMapping($this->className, $name); |
1495 | 1495 | } |
1496 | 1496 | |
1497 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1497 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
1498 | 1498 | throw MappingException::missingQueryMapping($this->className, $name); |
1499 | 1499 | } |
1500 | 1500 | |
@@ -1513,7 +1513,7 @@ discard block |
||
1513 | 1513 | */ |
1514 | 1514 | public function addSqlResultSetMapping(array $resultMapping) |
1515 | 1515 | { |
1516 | - if (!isset($resultMapping['name'])) { |
|
1516 | + if ( ! isset($resultMapping['name'])) { |
|
1517 | 1517 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
1518 | 1518 | } |
1519 | 1519 | |
@@ -1523,7 +1523,7 @@ discard block |
||
1523 | 1523 | |
1524 | 1524 | if (isset($resultMapping['entities'])) { |
1525 | 1525 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
1526 | - if (! isset($entityResult['entityClass'])) { |
|
1526 | + if ( ! isset($entityResult['entityClass'])) { |
|
1527 | 1527 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
1528 | 1528 | } |
1529 | 1529 | |
@@ -1532,11 +1532,11 @@ discard block |
||
1532 | 1532 | |
1533 | 1533 | if (isset($entityResult['fields'])) { |
1534 | 1534 | foreach ($entityResult['fields'] as $k => $field) { |
1535 | - if (! isset($field['name'])) { |
|
1535 | + if ( ! isset($field['name'])) { |
|
1536 | 1536 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
1537 | 1537 | } |
1538 | 1538 | |
1539 | - if (! isset($field['column'])) { |
|
1539 | + if ( ! isset($field['column'])) { |
|
1540 | 1540 | $fieldName = $field['name']; |
1541 | 1541 | |
1542 | 1542 | if (strpos($fieldName, '.')) { |
@@ -1645,11 +1645,11 @@ discard block |
||
1645 | 1645 | 'method' => $method, |
1646 | 1646 | ]; |
1647 | 1647 | |
1648 | - if (! class_exists($class)) { |
|
1648 | + if ( ! class_exists($class)) { |
|
1649 | 1649 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1650 | 1650 | } |
1651 | 1651 | |
1652 | - if (! method_exists($class, $method)) { |
|
1652 | + if ( ! method_exists($class, $method)) { |
|
1653 | 1653 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1654 | 1654 | } |
1655 | 1655 | |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | return; |
1726 | 1726 | } |
1727 | 1727 | |
1728 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1728 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1729 | 1729 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1730 | 1730 | } |
1731 | 1731 |