Repository navigation
Bump PHPStan to 2.3.4 and phpdoc-parser to 2.4 - #8883
Conversation
Type::toPhpDocNode() now returns FullyQualifiedNameNode for class names, and GenericTypeNode::$type can be a NameNode: - import and rename FullyQualifiedNameNode in docblocks like a written \Foo\Bar - keep Rector's shortened, aliased and non-existing object types printed as written - check for IdentifierTypeNode before reading the generic type name Amp-Thread-ID: https://ampcode.com/threads/T-01a179f2-995f-7745-8d8c-4c174ba5c0ce
|
This bump should be merged and released soon. Rector 2.8.2 does not work with PHPStan 2.3.4.
This PR ships phpdoc-parser 2.4 in the Rector build and requires PHPStan ^2.3.4. The |
|
rector-doctrine gets fixed here rectorphp/rector-doctrine#544 |
|
Same root cause, different symptom, for anyone searching: It only shows up with a cold cache ( |
|
Users can lock to PHPStan 2.3.3 before this PR is released. |
samsonasik
left a comment
There was a problem hiding this comment.
Please run:
composer preloadto regenerate preload files.
|
Done |
|
Thank you @ondrejmirtes |
|
@TomasVotruba let's create new immediate release for it to fix reported bug rectorphp/rector#9947 |
|
@TomasVotruba I've released rector 2.8.3 for it 👍 |
Bumps
phpstan/phpstanto^2.3.4andphpstan/phpdoc-parserto^2.4, with the minimal fixes to keep everything green.phpdoc-parser 2.4 adds
NameNode(FullyQualifiedNameNode,RelativeNameNode), and PHPStan 2.3.4'sType::toPhpDocNode()now returnsFullyQualifiedNameNodefor class names. Because of this:NameImportingPhpDocNodeVisitorandClassRenamePhpDocNodeVisitorhandleFullyQualifiedNameNodethe same way as a written\Foo\Bar, so auto-import and class renaming in docblocks keep working.ShortenedObjectType,ShortenedGenericObjectType,AliasedObjectTypeandNonExistingObjectTypeoverridetoPhpDocNode()to returnRelativeNameNode, so they keep printing as written.GenericTypeNode::$typecan now be aNameNode, so three places check forIdentifierTypeNodebefore reading->name.A follow-up PR will replace the
PHPStanStaticTypeMappermappers withType::toPhpDocNode()andType::toNativePhpTypeNode().