Closed SebSept closed 3 weeks ago
This is documented on the code
Sure, but what does that mean concretely? That Rector will modify code according to some phpstan rules ? ( Do you have an example ? ) That Rector uses phpstan notations to parse the code ?
For example, you have phpstan config to activate parent
attribute from a Node, you need to enable nodeConnectingVisitorCompatibility
, which default is disabled on rector.
so you can enable it by setting it to true:
parameters:
featureToggles:
- nodeConnectingVisitorCompatibility: false
+ nodeConnectingVisitorCompatibility: true
Then, you should can get:
$parentNode = $node->getAttribute('parent');
var_dump($parentNode instanceof \PhpParser\Node);
Question
I can't find any documentation for this configuration,
withPHPStanConfigs
.RectorConfig::configure()->withPHPStanConfigs([__DIR__.'/phpstan.neon'])
What does it do/provides ?