<?php
use PhpParser\Node;
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
final class SkipMoreDetailType
{
/**
* @param Name $node
*/
public function run(Node $node)
{
if ($node instanceof FullyQualified) {
return;
}
$this->execute($node);
}
private function execute(Name $node)
{
}
}
Responsible rules
AddMethodCallBasedStrictParamTypeRector
Expected Behavior
This should be skipped as Name is more detailed type then Node, and it cause phpstan notice:
------------------------------------------------------------------------
- '#Parameter 1 should use "PhpParser\\Node\\Name" type as the only type passed to this method#'
------------------------------------------------------------------------
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/dfcfecf6-f9bf-4c36-98ac-5fa5704e5f4d
Responsible rules
AddMethodCallBasedStrictParamTypeRector
Expected Behavior
This should be skipped as
Name
is more detailed type thenNode
, and it cause phpstan notice: