Skip to content

[TypeDeclaration] Skip Valid type from return doc and typed param on AddMethodCallBasedStrictParamTypeRector#7172

Merged
samsonasik merged 2 commits intomainfrom
fix-non-empty-array
Aug 24, 2025
Merged

[TypeDeclaration] Skip Valid type from return doc and typed param on AddMethodCallBasedStrictParamTypeRector#7172
samsonasik merged 2 commits intomainfrom
fix-non-empty-array

Conversation

@samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @calebdw

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik enabled auto-merge (squash) August 24, 2025 14:19
@samsonasik samsonasik merged commit dd7d554 into main Aug 24, 2025
49 checks passed
@samsonasik samsonasik deleted the fix-non-empty-array branch August 24, 2025 14:20
@samsonasik
Copy link
Member Author

@calebdw After looking at answer at PHPStan issue

it seems original change expected, as method_exists() can pass string as well, that means passed original string|object is expected.

While it seems make sense enforced by doc vs instanceof check, I will look if it cause more harm on our projects, if no, this is a current win-win solution, otherwise, I am just going to revert ;)

@samsonasik
Copy link
Member Author

@calebdw I created new PR to skip when param already typed:

@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect behavior of AddMethodCallBasedStrictParamTypeRector

2 participants