Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[cs] remove unused doc blocks#24931
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| /** | ||
| * Classes used for testing createResourceForClass | ||
| */ | ||
| class ClassForResource |
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.
These docs were incorrectly interpretted by PHP CS Fixer as single line, thus fixing them to Doc Blocks
javiereguiluz commentedNov 14, 2017
Even if I'd love to remove all PHPdocs from all files ... I find it strange to keep some |
TomasVotruba commentedNov 14, 2017
Some have added value, some don't and only duplicate information. |
javiereguiluz commentedNov 14, 2017
What you did is correct, but let me explain the problem I see (using as an example the first change you did): Original/** * Adds the stack logger for a connection. * * @param string $name * @param DebugStack $logger */publicfunction addLogger($name,DebugStack$logger) Proposed solution/** * Adds the stack logger for a connection. * * @param string $name */publicfunction addLogger($name,DebugStack$logger) Best solutionpublicfunction addLogger(string$name,DebugStack$logger) We can't make the best solution to avoid BC issues, but the problem I see with the proposed solution is that people will think we made a mistake and forgot to add the |
stof commentedNov 14, 2017
Yeah, I think partial phpdoc is confusing for users. We should keep an all-or-nothing approach for the parameter list IMO |
TomasVotruba commentedNov 14, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I see what you mean. Is there any reason to have it such way apart historical reasons? I realize there were not such tools in the past, but today thanks to coding standard tools this is now easy to configure and improve. It will make code mucheasier to read for users and easier modify in the future. Moving toBest solution as next step. Merged Use CaseSimilar PRswere merged to See especially these cases:https://github.com/php-ai/php-ml/pull/145/files#diff-1359851beb8da185b9d9adae86ab2ff7 |
nicolas-grekas commentedNov 27, 2017
This will not happen if fabbot generates the patch, because then, it will become an enforced policy. |
| * @param ObjectManager $manager | ||
| * @param mixed $queryBuilder | ||
| * @param string $class | ||
| * @param mixed $queryBuilder |
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.
mixed params could be removed as well asmixed does not give any useful information.
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.
I'd rather keep this, sincemixed type is comming to PHP and it would make easier transition to scalar type, as instring,int etc. before
fabpot commentedDec 11, 2017
@TomasVotruba Can you also change the base to 2.7? Thanks. Are you doing this by hand? Or with a tool? If you are using a tool/regexes/..., can you share it so that merging up to master will be easier? |
TomasVotruba commentedDec 19, 2017
@fabpot Here is all you asked for:https://www.tomasvotruba.cz/blog/2017/12/17/new-in-symplify-3-doc-block-cleaner-fixer/ Shall I run this rule on 2.7 with current setup then? |
fabpot commentedJan 19, 2018
@TomasVotruba Can you share you setup? Such PRs are complex to merge as merging it to newest branches is a mess. So, if you can share you setup, I will be able to run it on all branches, limiting the time it takes to merge the change up. Thanks. |
TomasVotruba commentedJan 19, 2018
@fabpot Sure, I use exactly this setup:https://www.tomasvotruba.cz/blog/2017/12/17/new-in-symplify-3-doc-block-cleaner-fixer/#challenge-your-code |
fabpot commentedJan 19, 2018
@TomasVotruba I've just tried by it fixes only 15 files. |
TomasVotruba commentedJan 19, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@fabpot I'm not aware of any major change that could cause this. And version? Last is 3.1 |
fabpot commentedJan 19, 2018
I've tried on master and v3.2.2, which looks like the last one (from a git clonehttps://github.com/Symplify/EasyCodingStandard) |
TomasVotruba commentedJan 19, 2018
@fabpot I meant 3.2, yes. |
TomasVotruba commentedJan 19, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I tried it like this: git clone github.com/symfony/symfonycd ../symplify# monorepo, with 3.2.3 version (I fixed one variadics bug and just released patch version)packages/EasyCodingStandard/bin/ecs check ../symfony/src/Symfony --clear-cache --config cleaning-symfony.neon Where # cleaning-symfony.neoncheckers: -Symplify\CodingStandard\Fixer\Commenting\RemoveUselessDocBlockFixer With this result: Then with |
fabpot commentedJan 20, 2018
I think I forgot to pass the config file. Now it looks much better, but I get this error: Note that I got the config from your blog post. |
fabpot commentedJan 20, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Also, I noticed that it removes the blank line between |
TomasVotruba commentedJan 20, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That's what I fixed. Do you have version 3.2.3?
Use the one provided here, just to be sure the main fixer works for you. The other 2 are just space fixers.
I thinks so. Will create issue for that. It uses |
fabpot commentedJan 20, 2018
Ok, I forgot to run |
fabpot commentedJan 20, 2018
See#25859 for the current state. |


Follow-up to#24930