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 @@ -795,7 +795,7 @@ public function walkSelectExpression($selectExpression)
795795
796796 $ type = $ this ->resolveDoctrineType ($ typeName , $ enumType , $ nullable );
797797
798- $ this ->typeBuilder -> addScalar ($ resultAlias , $ type );
798+ $ this ->addScalar ($ resultAlias , $ type );
799799
800800 return '' ;
801801 }
@@ -855,7 +855,7 @@ public function walkSelectExpression($selectExpression)
855855 });
856856 }
857857
858- $ this ->typeBuilder -> addScalar ($ resultAlias , $ type );
858+ $ this ->addScalar ($ resultAlias , $ type );
859859
860860 return '' ;
861861 }
@@ -1276,6 +1276,18 @@ public function walkResultVariable($resultVariable)
12761276 return $ this ->marshalType (new MixedType ());
12771277 }
12781278
1279+ /**
1280+ * @param array-key $alias
1281+ */
1282+ private function addScalar ($ alias , Type $ type ): void
1283+ {
1284+ if ($ type instanceof UnionType) {
1285+ $ type = TypeUtils::toBenevolentUnion ($ type );
1286+ }
1287+
1288+ $ this ->typeBuilder ->addScalar ($ alias , $ type );
1289+ }
1290+
12791291 private function unmarshalType (string $ marshalledType ): Type
12801292 {
12811293 $ type = unserialize ($ marshalledType );
You can’t perform that action at this time.
0 commit comments