-
Notifications
You must be signed in to change notification settings - Fork 2k
refactor: Improve types for phpstan #9685
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
refactor: Improve types for phpstan #9685
Conversation
I'm not a fan either of duplicating code comments and PHPDocs. If those are already defined by the base class or interface, then child classes can remove them since, as you said, IDEs will show you the inherited code comments (unless you are not using an IDE?). It is also a maintenance burden to keep similar comments in sync. |
If I'm not mistaken, @samsonasik is against deletion. |
can |
Why? Inheritance works fine without it. Maybe the tag is needed when generating documentation? I don't see the need for it during development. Look at |
If I remember correctly, |
Tags should be updated if the type changes or becomes more precise ( |
Yes, they should be updated. |
If phpDocumentor requires |
Okay. Can we fix the style in the Markdown guidelines or user guide? I would like to have an exact strategy for further refactoring (example Commands, Request, Model,..). It may be necessary to remove all "bad" files from the comments. Alternatively, you can add This may reduce the size of the installation ZIP archive. |
👋 Hi, @neznaika0! |
I guess the strategy would be:
That's what I can think of for now. And I don't know what bad files you mean. |
Bad files are those that already duplicate comments. |
ca2ae9e
to
ec47048
Compare
I tested phpDocumentor.
It follows that there is no 100% need for duplicate comments. Will it be possible to clean it up in future PR? Sorry for my perfectionism). Results:
|
I know this was approved, but since then, we have had some additional discussion and commits here. Is this good to merge? |
Yes, this is good to merge. |
I would clean up the duplicates before merging, if you agree. |
Are these duplicates related to phpstan? |
Yes. Is this PHPDoc for child properties: |
Okay, it's fine by me. |
ec47048
to
be462ec
Compare
Thank you @neznaika0 |
Description
Improved typing.
What is done:
CIUnitTestCase
, the dependent code has been updatedOFFTOP: I'll ask again: Do we really need repeated code descriptions? (You answered Yes.)
Because of this, it needs to be fixed in several places. See, example
$namespace
property. Modern IDEs fully support type highlighting and you can switch to declarations. If not, then is it worth adding missing comments everywhere? I would leave it as it is now, but this contradicts the desire to duplicate the code: Everywhere without repeating, or always duplicate typing.Checklist: