@@ -2082,6 +2082,43 @@ public function dataUnion(): iterable
20822082 MixedType::class,
20832083 'mixed~int<17, 18>=implicit ' ,
20842084 ];
2085+
2086+ $ reflectionProvider = $ this ->createReflectionProvider ();
2087+ yield [
2088+ [
2089+ new StaticType ($ reflectionProvider ->getClass (stdClass::class)),
2090+ new ThisType ($ reflectionProvider ->getClass (stdClass::class)),
2091+ ],
2092+ StaticType::class,
2093+ 'static(stdClass) ' ,
2094+ ];
2095+
2096+ yield [
2097+ [
2098+ new StaticType ($ reflectionProvider ->getClass (stdClass::class)),
2099+ new ObjectType (stdClass::class),
2100+ ],
2101+ ObjectType::class,
2102+ 'stdClass ' ,
2103+ ];
2104+
2105+ yield [
2106+ [
2107+ new StaticType ($ reflectionProvider ->getClass (stdClass::class)),
2108+ new EnumCaseObjectType (stdClass::class, 'foo ' ),
2109+ ],
2110+ UnionType::class,
2111+ 'static(stdClass)|stdClass::foo ' ,
2112+ ];
2113+
2114+ yield [
2115+ [
2116+ new ThisType ($ reflectionProvider ->getClass (stdClass::class)),
2117+ new EnumCaseObjectType (stdClass::class, 'foo ' ),
2118+ ],
2119+ UnionType::class,
2120+ '$this(stdClass)|stdClass::foo ' ,
2121+ ];
20852122 }
20862123
20872124 /**
@@ -3411,6 +3448,41 @@ public function dataIntersect(): iterable
34113448 MixedType::class,
34123449 'mixed~int<17, max>=implicit ' ,
34133450 ];
3451+ yield [
3452+ [
3453+ new StaticType ($ reflectionProvider ->getClass (stdClass::class)),
3454+ new ThisType ($ reflectionProvider ->getClass (stdClass::class)),
3455+ ],
3456+ ThisType::class,
3457+ '$this(stdClass) ' ,
3458+ ];
3459+
3460+ yield [
3461+ [
3462+ new StaticType ($ reflectionProvider ->getClass (stdClass::class)),
3463+ new ObjectType (stdClass::class),
3464+ ],
3465+ StaticType::class,
3466+ 'static(stdClass) ' ,
3467+ ];
3468+
3469+ yield [
3470+ [
3471+ new StaticType ($ reflectionProvider ->getClass (stdClass::class)),
3472+ new EnumCaseObjectType (stdClass::class, 'foo ' ),
3473+ ],
3474+ IntersectionType::class,
3475+ 'static(stdClass)&stdClass::foo ' ,
3476+ ];
3477+
3478+ yield [
3479+ [
3480+ new ThisType ($ reflectionProvider ->getClass (stdClass::class)),
3481+ new EnumCaseObjectType (stdClass::class, 'foo ' ),
3482+ ],
3483+ IntersectionType::class,
3484+ '$this(stdClass)&stdClass::foo ' ,
3485+ ];
34143486 }
34153487
34163488 /**
0 commit comments