1818use PHPStan \Type \StaticType ;
1919use PHPStan \Type \ThisType ;
2020use PHPStan \Type \Type ;
21+ use PHPStan \Type \TypeCombinator ;
2122use Rector \BetterPhpDocParser \PhpDocInfo \PhpDocInfoFactory ;
2223use Rector \BetterPhpDocParser \PhpDocManipulator \PhpDocTypeChanger ;
2324use Rector \Comments \NodeDocBlock \DocBlockUpdater ;
2425use Rector \DeadCode \PhpDoc \TagRemover \ReturnTagRemover ;
2526use Rector \NodeTypeResolver \Node \AttributeKey ;
2627use Rector \PHPStanStaticTypeMapper \Enum \TypeKind ;
27- use Rector \PHPStanStaticTypeMapper \TypeAnalyzer \UnionTypeAnalyzer ;
2828use Rector \Rector \AbstractRector ;
2929use Rector \Reflection \ReflectionResolver ;
3030use Rector \StaticTypeMapper \StaticTypeMapper ;
@@ -45,7 +45,6 @@ public function __construct(
4545 private readonly ReturnTagRemover $ returnTagRemover ,
4646 private readonly ReflectionResolver $ reflectionResolver ,
4747 private readonly PrivatesAccessor $ privatesAccessor ,
48- private readonly UnionTypeAnalyzer $ unionTypeAnalyzer ,
4948 private readonly DocBlockUpdater $ docBlockUpdater ,
5049 private readonly PhpDocInfoFactory $ phpDocInfoFactory ,
5150 private readonly StaticTypeMapper $ staticTypeMapper ,
@@ -258,7 +257,7 @@ private function isNullable(Type $parentReturnType, Type $returnType): bool
258257 return false ;
259258 }
260259
261- if (! $ this -> unionTypeAnalyzer -> isNullable ($ parentReturnType )) {
260+ if (! TypeCombinator:: containsNull ($ parentReturnType )) {
262261 return false ;
263262 }
264263
0 commit comments