Skip to content

Fix crash on PHPStan\Type\NonexistentParentClassType on AddArrowFunctionReturnTypeRector - #8568

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-crash-parent
Oct 9, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
fix-crash-parent

Conversation

@samsonasik

@samsonasik samsonasik commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Tested on use case when run on symfony codebase.

To fix crash reproduced with this fixture on AddArrowFunctionReturnTypeRector:

There was 1 error:

1) Rector\Tests\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector\AddArrowFunctionReturnTypeRectorTest::test@/Users/samsonasik/www/rector-src/rules-tests/TypeDeclaration/Rector/ArrowFunction/AddArrowFunctionReturnTypeRector/Fixture/return_new_parent_in_trait.php.inc with data ('/Users/samsonasik/www/rector-...hp.inc')
Rector\Exception\NotImplementedYetException: Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper::mapToPhpParserNode for PHPStan\Type\NonexistentParentClassType

/Users/samsonasik/www/rector-src/src/PHPStanStaticTypeMapper/PHPStanStaticTypeMapper.php:45
/Users/samsonasik/www/rector-src/src/StaticTypeMapper/StaticTypeMapper.php:52
/Users/samsonasik/www/rector-src/rules/TypeDeclaration/Rector/ArrowFunction/AddArrowFunctionReturnTypeRector.php:77

Fixes rectorphp/rector#9925

@samsonasik

Copy link
Copy Markdown
Member Author

@TomasVotruba ready 👍

@TomasVotruba
TomasVotruba merged commit 490295b into main Oct 9, 2026
50 checks passed
@TomasVotruba

Copy link
Copy Markdown
Member

Thanks

@TomasVotruba
TomasVotruba deleted the fix-crash-parent branch October 9, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add map for PHPStan\Type\NonexistentParentClassType to node

2 participants