How to change the default author in PhpStorm for PHPDoc

Naelyth picture Naelyth · Jun 2, 2015 · Viewed 19.9k times · Source

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 ?

Answer

Nick Pyett picture Nick Pyett · Jun 23, 2015

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.