Refresh PHPStan types on each applied rules
Feature Request
When a single rule is applied, the virtual printed new content needs to be applied to a File object so can be continued in another rule as refreshed new nodes as noted at todo at:
https://github.com/rectorphp/rector-src/blob/347b5938475e5b0e846be6ef631d5939a47fc1a0/src/Application/FileProcessor.php#L32
@TomasVotruba I tried to apply on PHPStanNodeScopeResolver:
https://github.com/rectorphp/rector-src/blob/e9e2877d959f24ee91e5f76a6cf626499011c4bb/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php#L136
and it seems the $nodes still uses old statements, even on FileProcessor:
https://github.com/rectorphp/rector-src/blob/347b5938475e5b0e846be6ef631d5939a47fc1a0/src/Application/FileProcessor.php#L33
It seems we need to get the new statement changed, possibly need to be in PostFileProcessor::traverse()
https://github.com/rectorphp/rector-src/blob/e9e2877d959f24ee91e5f76a6cf626499011c4bb/packages/PostRector/Application/PostFileProcessor.php#L39
The scope refresh on changed nodes is not implemented yet, re-opening.
This might help with detecting such case on runtime: https://github.com/rectorphp/rector-src/pull/2227
Closing as feature is now implemented :+1: