-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
PHPStan Level 2 #6161
PHPStan Level 2 #6161
Conversation
this is ready for review/discussion |
In a general way, I think it would be better to avoid writing
And rely instead on
Or
Because if $foo HAVE TO be a FOO instance, it's better to check for it when the param could be an more generic Interface instead. |
df97170
to
1ad9203
Compare
Okay. Most of it is fixed. BUT I have those
what should be done with them? I can simply add them to |
Have no idea why
any idea? It was phpstan-symfony plugin.
and breaks CI build |
bd0b591
to
feb83c7
Compare
I would change
to
And deprecate the getQuestionHelper method. I don't know how it could currently work. |
85525d9
to
d97cf14
Compare
Can't deprecate it, since we need to |
0364ca9
to
d837b12
Compare
can someone help with question
upd: note to self use something like this php -d zend.assertions=1 -d assert.exception=0 vendor/bin/simple-phpunit -c phpunit.xml.dist |
da5a930
to
88cc4a4
Compare
@VincentLanglet now it's finished |
I noticed there are some new exceptions. Is yet "pedantic" the right label? Don't we need a changelog for these exceptions? Are they respecting BC? |
If you now pass by these exception the code wasn't working before. This situation is always similar to this
|
I understand, although I guess a border case could be reached if the previous exception has a different type than the new one and the user is relying on these types. |
Indeed. Previously this was an |
Agree. I'm just saying that an upgrade note should help to cover such edge scenarios in case they are met. |
3927dce
2b47ad5
to
3927dce
Compare
3927dce
to
8bbc4ff
Compare
added some tests (due to changes that where made because of PHPStan)
8bbc4ff
to
914dd50
Compare
@phansys any chance to get this merged? |
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.
IMO, since there are new exceptions thrown, an upgrade note should be required.
Regardless that, I think the PR is RTM.
Thanks @vladyslavstartsev |
Subject
I've bumped PHPStan to level 2. But since we can't break things most of the changes are baseline file and commented code in interfaces.
I am targeting this branch, because this is not BC break.
To do
src/Controller/CRUDController.php
; (no error, justisset
check)CRUDController
and*Mapper
classes for examples). I think no, but this way PHPStan is thowing errors because base interface (BuilderInterface
) doesn't have some methods that are required here (ShowBuilderInterface
and it'saddField
method)