Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle reflection error in retrieving default values #700

Merged
merged 7 commits into from
Feb 11, 2023

Conversation

DanielBadura
Copy link
Contributor

fix #698

This is the first PoC of handling the two errors mentioned in the linked issue. I added a TestCase for both errors. I'm not sure what exactly we should compare from the AST of the two parameters so for now only checking if the type is the same which already resolved the error case.

@DanielBadura
Copy link
Contributor Author

Psalm seems for now not fixable since it complaining about undefined vars after the foreach but there is no possible case imho.

PHPcs will be fixed in the next commit round and infection as soon as we are finished polishing the behaviour.

@DanielBadura DanielBadura marked this pull request as ready for review February 10, 2023 09:23
@DanielBadura
Copy link
Contributor Author

@Ocramius could you have a look again on this PR? Psalm errors were not fixable for me without defining the variables with null. Also moving the code chunk into a private method made the readabillity harder due to the mix of continue and throw in there.

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most excellent from my Pov, thanks @DanielBadura!

@Ocramius Ocramius self-assigned this Feb 10, 2023
@Ocramius Ocramius added this to the 8.3.0 milestone Feb 10, 2023
@Ocramius Ocramius changed the base branch from 8.2.x to 8.3.x February 10, 2023 11:50
@Ocramius
Copy link
Member

Ah, one last thing: we'll need to rebase due to the composer.json and composer.lock changes. Will merge after that 👍

@DanielBadura
Copy link
Contributor Author

@Ocramius PR is now rebased 👍

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DanielBadura!

@Ocramius Ocramius merged commit 40956d5 into Roave:8.3.x Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle new initializer and enum intiliazing as default value more gracefully
2 participants