Skip to content

Commit bf700d5

Browse files
Simplify
1 parent 42c4b04 commit bf700d5

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

Diff for: src/Type/Doctrine/Query/QueryResultTypeWalker.php

-12
Original file line numberDiff line numberDiff line change
@@ -940,18 +940,6 @@ public function walkAggregateExpression($aggExpression): string
940940
return $this->marshalType(TypeCombinator::addNull($type));
941941

942942
case 'AVG':
943-
$type = $this->unmarshalType(
944-
$this->walkSimpleArithmeticExpression($aggExpression->pathExpression)
945-
);
946-
947-
if (count($type->getConstantScalarValues()) !== 1) {
948-
$type = TypeUtils::generalizeType($type, GeneralizePrecision::lessSpecific());
949-
}
950-
951-
$type = TypeCombinator::union($type, $type->toFloat(), $type->toFloat()->toString());
952-
953-
return $this->marshalType(TypeCombinator::addNull($type));
954-
955943
case 'SUM':
956944
$type = $this->unmarshalType(
957945
$this->walkSimpleArithmeticExpression($aggExpression->pathExpression)

Diff for: tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,8 @@ public function getTestData(): iterable
723723
[
724724
new ConstantIntegerType(5),
725725
TypeCombinator::union(
726-
new ConstantStringType('1'),
727-
new ConstantIntegerType(1),
728-
new ConstantStringType('1.0'),
729-
new ConstantFloatType(1.0),
726+
$this->intStringified(),
727+
new FloatType(),
730728
new NullType()
731729
),
732730
],

0 commit comments

Comments
 (0)