Replies: 3 comments 7 replies
-
Fine by me. I have no arguments against removing this rule. I merely wish for contributors to adhere to whichever standards the community prefers. |
Beta Was this translation helpful? Give feedback.
-
I opened #680 |
Beta Was this translation helpful? Give feedback.
-
Hi @SvenRtbg, I understand your arguments and can also understand your point of view. However, I think that we should either:
And do not mix and then describe only some, but not necessarily all parameters. For the two cases you mentioned:
Maybe there is a rule for the php cs fixer that we don't have enabled, or there might be a check for it in phpstan soon. My IDE (phpstorm) checks this and warns me. But you are right: We need to prevent this, and we can't do without a check of phpstan or php cs fixer running in the ci tests. To take the discussion a bit further:
|
Beta Was this translation helpful? Give feedback.
-
Hallo everyone!
I would like to contribute to this repository by improving the code quality in order to increase the level of PHPStan validation.
To do this, I need to add many doc blocks to functions used in the src and in the tests.
I started by adding doc blocks to test functions and used the automatic generation of doc blocks in the PHPStorm IDE.
For example, I added the doc block to
testGetRequired
in PackageSelectionTest and changed it from:to
After running the php cs fixer checks, it wanted me to remove three of the parameters because the no_superfluous_phpdoc_tags rule told me that they do not provide any useful information.
That's true because:
@param Link[] $expected
Provides the information thatarray $expected
(typed parameter) is actuallyLink[] $expected
@param Package $package
Information is already typed in the parameters (so in the function signature)@param bool $requireDependencies
Information is already typed in the parameters (so in the function signature)@param bool $requireDevDependencies
Information is already typed in the parameters (so in the function signature)But in my opinion, it is not the best idea to describe a function by mentioning only one of the four parameters in its doc block.
This is how it looks in the short doc of PhpStorm:
Therefore, I would like to suggest that we remove the rule from the php cs fixer rulebook.
What do you think about this?
Beta Was this translation helpful? Give feedback.
All reactions