-
-
Notifications
You must be signed in to change notification settings - Fork 433
Improve assert rule #7207
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
Improve assert rule #7207
Conversation
d37e687 to
3aabf58
Compare
|
|
||
| private function matchTypeToAssertMethod(Type $type): ?string | ||
| { | ||
| if ($type instanceof IntegerType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use $type->isInteger()->yes() so it works also with integer ranges ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to start with basic "strict" types first, test it in the wild and then we can iterate further.
rules/Assert/Rector/ClassMethod/AddAssertArrayFromClassMethodDocblockRector.php
Show resolved
Hide resolved
|
@TomasVotruba I think we need to have service like:
|
|
Agreed, this needs an improvement If this rule is enabled, it should throw error instead if package is missing. |
* add ASSERT set list * add fixture to cover float and bool types
|
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. |
Follow up to #7206