Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the default author in PhpStorm for PHPDoc

Tags:

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 ?

like image 350
Naelyth Avatar asked Jun 02 '15 13:06

Naelyth


People also ask

What is PHPDoc in PhpStorm?

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.

What is PHPDoc comment?

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.


1 Answers

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.

like image 130
Nick Pyett Avatar answered Sep 27 '22 23:09

Nick Pyett