-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Improve ExtractorInterface phpdoc #40604
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
Conversation
Thank you for these PRs. We are happy to improve minor things like this, but only if they are broken. What I can see, there is no bug this PR is fixing. |
Hi @Nyholm . I'm not sure to understand, do you want that I do this PR on another branch or does these PR are not welcomed ? User of static analysis like phpstan/psalm can encounter an issue. If this kind of situation, psalm is returning an error
For this reason, some stubs are created to override/be more precise about the phpdoc of symfony (see https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs). Instead of creating a new stub in the psalm plugin symfony, I thought the phpdoc improvement would be accepted by symfony. |
Im saying that we are happy to fix bugs. This is not a bug. This is a change to please a third party tool. Note that we do run psalm on all PRs to make sure we don't introduce more of these issues. We are also fixing issues found by psalm (see #40603). But again, it has to be real issues that affects the code. Changing from |
I looked at the psalm errors for 4.4 and I did find a few that actually matters. #40610 |
Sure, it's not a bug. But still an improvement. I still don't get why you're talking like these PR would be forbidden. For the method,
You could believe that an array of So changing the param typehint from |
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.
The change is correct and it improves the documentation of the interface. It would be in favor of merging this PR.
#39170 added missing documentation. This is changing a valid type to a slightly better valid type. I undertand that this may seam arbitrary. But I stand to the fact that this PR is not helping anybody. I don't want to allow this kind of PRs because that opens the door for more PRs like it. Instead I want to focus the effort in making changes that benefit the users in a more obvious way. I vote 👎 for this PR. Since you clearly disagree, I'll leave this open for a second opinion. |
So, it's an improvement that helps @VincentLanglet at least and does not hurt anyone. What is your alternative? Patch this on 5.x because it's not a bugfix? Leave an imprecise type declaration from 2015 as it is for eternity? While introducing a stricter static code analysis to my Symfony projects, I keep finding issues like this one more and more myself. I understand that you don't see value in such changes, but they actually do help. |
👍 as a minor improvement on 5.x (no bug here) |
@derrabus Should I change the target branch ? |
Yes please. It seams like there are a few more people that disagree with me. I'll be happy yo merge this in 5.x as a minor improvement. |
Thank you! |
I suggest adding the change form #40601 in this PR too. |
Done |
Could you please rebase your PR on 5.x so the tests are green? It looks like you forked it a long long time ago. |
acde223
to
9504bc3
Compare
I just pulled 5.x and rebased, but tests are still failing... |
Cool. Thank you. This test failure is fine. It is not related to this PR. (Before we were testing on PHP 7.1 which was dropped a long time ago) |
I think this phpdoc can be improved