barryvdh / laravel-ide-helper

IDE Helper for Laravel
MIT License
14.1k stars 1.16k forks source link

Two blank docblock lines in model #1548

Open nalatreb opened 3 months ago

nalatreb commented 3 months ago

Versions:

Question:

Hello!

In the latest version the class name was removed from the model generation with this commit https://github.com/barryvdh/laravel-ide-helper/commit/02af2a278a9d3186e431022f46e10c87598eeec9. I know it was not providing any useful information, but now the serializer generates two blank comment lines with extra space, which generate a phpcs warning in our project. image

It is possible to change the serializer logic, if there are no short or long description in the docblock the serializer won't put an extra space? Here is the corresponding code: https://github.com/barryvdh/ReflectionDocBlock/blob/2.0.0/src/Barryvdh/Reflection/DocBlock/Serializer.php#L179 Maybe bring back the classname generation with an extra command option?

Or do you have any other suggestion? Or we just format the files after every ide helper generate?

Thanks for your help!

mfn commented 3 months ago

Or we just format the files after every ide helper generate?

This is general the recommended way, to have something like rector/php-cs-fixer run after tools like ide-helper, etc.

I remember I looked into this particular one but due to the entanglement of the code, it wasn't as easy as I hoped, so I just stopped looking into it.