Skip to content

fix: Attempt to assign property type on null error#979

Merged
samsonasik merged 4 commits intorectorphp:mainfrom
ishanvyas22:bug-6725
Oct 9, 2021
Merged

fix: Attempt to assign property type on null error#979
samsonasik merged 4 commits intorectorphp:mainfrom
ishanvyas22:bug-6725

Conversation

@ishanvyas22
Copy link
Copy Markdown
Contributor

@ishanvyas22 ishanvyas22 commented Oct 8, 2021

Fixes rectorphp/rector#6725

This error is raised when there's discrepancies between params and phpDocParams. That means, for example, if method accepts 2 params and phpDoc block is only added for any one of param, in that case this issue is raised.

The reason for the issue is depending on phpDoc $key variable. I tried to check it with param name but it added a duplicated @param tag in docBlock. So as a temporary fix I added isset check for now, so there's no notice/error is raised.

…ector/Fixture/overlapped_key_param.php.inc

Co-authored-by: Abdul Malik Ikhsan <[email protected]>
@samsonasik samsonasik enabled auto-merge (squash) October 9, 2021 05:07
@samsonasik
Copy link
Copy Markdown
Member

Thank you @ishanvyas22

@samsonasik samsonasik merged commit ff32aed into rectorphp:main Oct 9, 2021
@ishanvyas22 ishanvyas22 deleted the bug-6725 branch October 9, 2021 05:10
@ishanvyas22
Copy link
Copy Markdown
Contributor Author

Thanks. Would it be possible to add "hacktoberfest-accepted" label to this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NarrowUnionTypeDocRector - Attempt to assign property "type" on null

2 participants