I search for a moment a way to change the name and mail used by PHPDoc in PhpStorm when you use the "autocomplete" by pressing Enter after typing /**
just before a class or a function.
Example :
/** * Class DepartmentType * * @author Foo Bar <[email protected]> */ class Foo {
Because, this name and this mail is not the name and mail configure for the git I use in my project. I don't find any place to change this defaults values...
Anyone have an idea ?
Using PHPDoc code inspections PhpStorm provides a set of predefined code inspections targeted at PHPDoc blocks. These inspections check whether classes, methods, functions, variables, and constants are supplied with a PHPDoc comment and whether the tags in the comment match the documented item.
phpDoc blocks are descriptive comments that are part of the application code. They are used to describe the PHP element in the exact location in the code where the element appears. The block consists of a short description, long description, and phpDoc tags.
Preferences > Editor > File and Code Templates > Includes tab > PHP Class Doc Comment
/** * Class ${NAME} #if (${NAMESPACE}) * @package ${NAMESPACE} #end * @author Foo Bar <[email protected]> */
I edited @Mahmoud Zalt's answer, which is basically right, but the edit was rejected, so here you go. @Mahmoud Zalt's answer will only work if you have a namespace in the class, which is what the if/end logic is looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With