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 @@ -797,7 +797,7 @@ public function walkSelectExpression($selectExpression): string
797797
798798 $ type = $ this ->resolveDoctrineType ($ typeName , $ enumType , $ nullable );
799799
800- $ this ->typeBuilder -> addScalar ($ resultAlias , $ type );
800+ $ this ->addScalar ($ resultAlias , $ type );
801801
802802 return '' ;
803803 }
@@ -857,7 +857,7 @@ public function walkSelectExpression($selectExpression): string
857857 });
858858 }
859859
860- $ this ->typeBuilder -> addScalar ($ resultAlias , $ type );
860+ $ this ->addScalar ($ resultAlias , $ type );
861861
862862 return '' ;
863863 }
@@ -1298,6 +1298,18 @@ public function walkResultVariable($resultVariable): string
12981298 return $ this ->marshalType (new MixedType ());
12991299 }
13001300
1301+ /**
1302+ * @param array-key $alias
1303+ */
1304+ private function addScalar ($ alias , Type $ type ): void
1305+ {
1306+ if ($ type instanceof UnionType) {
1307+ $ type = TypeUtils::toBenevolentUnion ($ type );
1308+ }
1309+
1310+ $ this ->typeBuilder ->addScalar ($ alias , $ type );
1311+ }
1312+
13011313 private function unmarshalType (string $ marshalledType ): Type
13021314 {
13031315 $ type = unserialize ($ marshalledType );
You can’t perform that action at this time.
0 commit comments