File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -794,7 +794,7 @@ public function walkSelectExpression($selectExpression)
794794
795795 $ type = $ this ->resolveDoctrineType ($ typeName , $ enumType , $ nullable );
796796
797- $ this ->typeBuilder -> addScalar ($ resultAlias , $ type );
797+ $ this ->addScalar ($ resultAlias , $ type );
798798
799799 return '' ;
800800 }
@@ -854,7 +854,7 @@ public function walkSelectExpression($selectExpression)
854854 });
855855 }
856856
857- $ this ->typeBuilder -> addScalar ($ resultAlias , $ type );
857+ $ this ->addScalar ($ resultAlias , $ type );
858858
859859 return '' ;
860860 }
@@ -1275,6 +1275,18 @@ public function walkResultVariable($resultVariable)
12751275 return $ this ->marshalType (new MixedType ());
12761276 }
12771277
1278+ /**
1279+ * @param array-key $alias
1280+ */
1281+ private function addScalar ($ alias , Type $ type ): void
1282+ {
1283+ if ($ type instanceof UnionType) {
1284+ $ type = TypeUtils::toBenevolentUnion ($ type );
1285+ }
1286+
1287+ $ this ->typeBuilder ->addScalar ($ alias , $ type );
1288+ }
1289+
12781290 private function unmarshalType (string $ marshalledType ): Type
12791291 {
12801292 $ type = unserialize ($ marshalledType );
You can’t perform that action at this time.
0 commit comments