Add @param node type to refactor() method based on getNodeTypes() of a Rector rule, to avoid instanceof checks and unknown types reported by PHPStan
public function getNodeTypes(): array
{
return [MethodCall::class];
}
+/**
+ * @param MethodCall $node
+ */
public function refactor(Node $node): ?Node
{
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclarationDocblocks\Rector\Class_\AddParamTypeToRefactorMethodRector;
return RectorConfig::configure()
->withRules([
AddParamTypeToRefactorMethodRector::class,
]);