diff --git a/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php b/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php index 2ade6225..1e5ff413 100644 --- a/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php +++ b/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php @@ -17,6 +17,7 @@ use Rector\Core\Rector\AbstractRector; use Rector\Core\Reflection\ReflectionResolver; use Rector\Core\ValueObject\MethodName; +use Rector\StaticTypeMapper\StaticTypeMapper; use ReflectionMethod; use ReflectionNamedType; use ReflectionParameter; @@ -36,7 +37,8 @@ public function __construct( private readonly PhpDocTypeChanger $phpDocTypeChanger, private readonly ParamAnalyzer $paramAnalyzer, private readonly ReflectionResolver $reflectionResolver, - private readonly PhpDocInfoFactory $phpDocInfoFactory + private readonly PhpDocInfoFactory $phpDocInfoFactory, + private readonly StaticTypeMapper $staticTypeMapper ) { } diff --git a/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php b/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php index 6c8509a4..25065ee1 100644 --- a/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php +++ b/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php @@ -28,6 +28,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\PHPStanStaticTypeMapper\Enum\TypeKind; use Rector\PHPStanStaticTypeMapper\TypeAnalyzer\UnionTypeAnalyzer; +use Rector\StaticTypeMapper\StaticTypeMapper; use Rector\StaticTypeMapper\ValueObject\Type\ParentStaticType; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -47,6 +48,7 @@ public function __construct( private readonly UnionTypeAnalyzer $unionTypeAnalyzer, private readonly DocBlockUpdater $docBlockUpdater, private readonly PhpDocInfoFactory $phpDocInfoFactory, + private readonly StaticTypeMapper $staticTypeMapper, ) { }