Skip to content

[TypeDeclaration] Skip mixed condition string on TypedPropertyFromStrictConstructorRector#3482

Merged
TomasVotruba merged 2 commits intomainfrom
skip-mixed-condition-string
Mar 16, 2023
Merged

[TypeDeclaration] Skip mixed condition string on TypedPropertyFromStrictConstructorRector#3482
TomasVotruba merged 2 commits intomainfrom
skip-mixed-condition-string

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik
Copy link
Copy Markdown
Member Author

Fixed 🎉 /cc @aboyton

@TomasVotruba TomasVotruba merged commit 26c8819 into main Mar 16, 2023
@TomasVotruba
Copy link
Copy Markdown
Member

Thanks 👍

@TomasVotruba TomasVotruba deleted the skip-mixed-condition-string branch March 16, 2023 10:39
@aboyton
Copy link
Copy Markdown

aboyton commented Mar 16, 2023

Thanks for the quick fix. As someone unfamiliar with the Rector codebase, can you explain why this was buggy? Bugs like this always decrease one's confidence in a tool so it's helpful to understand what exactly the issue is.

I guess my question is how hardcoded is a fix like this, or is this the type of bug that can be present in any rule? It's a little hard to tell how much there's a type inference engine running which these rules take the result of, or if instead each rule is pattern matching on specific things.

@samsonasik
Copy link
Copy Markdown
Member Author

That was checking any assign var name, which should check property fetch and static property fetch only, you can read the doc for it https://github.com/rectorphp/php-parser-nodes-docs

samsonasik added a commit that referenced this pull request May 8, 2023
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.

Incorrect behavior of TypedPropertyFromStrictConstructorRector

3 participants