-
Notifications
You must be signed in to change notification settings - Fork 326
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
Better doc typing #7049
Better doc typing #7049
Conversation
*/ | ||
public function testFindPortalInformationByUrlWithInvalidSuffix($url, $shouldFind): void | ||
public function testFindPortalInformationByUrlWithInvalidSuffix(string $url, $shouldFind): void |
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.
This is not a bc break because the function where those variables are used already have a return type of array. So the only thing is we fail the code faster on broken types.
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.
yeah normally parameters types are bc breaks when class is not final but in tests we don't need to take care about bc and can set them.
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.
So in tests "BC breaking behavior" (like adding parameters and return types) is okay in test methods?
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.
@mamazu yes totally in tests we don't need to take care of the bc breaks, only the Testing
namespace of the SuluTestBundle is the only one which part of the public namespace.
We already added and fixed some types in tests via rector here:
- Fix ObjectProphecy types to reduce phpstan baseline #6845
- Add void return types to Test methods to reduce phpstan baseline errors #6839
If we do that kind of massive manipulation I would prefer todo it on 2.4 branch or for PHP 8.0 changes on 2.5 avoids that we have problems in backmerge a bugfix with a test.
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.
Okay, I will keep that in mind for further type changes.
PHP 8.2 is unrelated not sure yet whats wrong with gedmo |
PHP 8.1 should not fail there seems to be something wrong. |
Fixed and asked a question on the last remaining thread. |
9bd1a6d
to
3d320a8
Compare
3d320a8
to
7e51118
Compare
Then this MR is ready for review |
@mamazu Thank you! ~400 less lines in phpstan baseline 💪 |
What's in this PR?
Why?
As preparation for 3.0 we want the doc types to be as correct as possible for tools to rely on them when refactoring.