PhpStorm header comments, and annotations based annotation functions provided (point a little improvement)

First, PhpStorm annotation files, classes, functions, etc. provided: setting the setting- "Editor-" FIle and Code Template- "Includes can, wherein the default method is such that:

/**
${PARAM_DOC}
#if (${TYPE_HINT} != "void") * @return ${TYPE_HINT}
#end
${THROWS_DOC}
*/

But I found the default annotation file is this:

1 /**
2 * Created by ${PRODUCT_NAME}.
3 * User: ${USER}
4 * Date: ${DATE}
5 * Time: ${TIME}
6 */

When I put in the code above this row 3,4,5 copied directly into the PHP Function Doc Comment below, something found in the placeholder {} has not been replaced, but played out as a string a.

method:

1, we PhpStorm the setting- "Editor-" Live Template, that is, find the template option, the template set will see a variety of languages;

2. Find the right there is a + sign, create a custom template: Select Live Template, and then set the order configured in the following figure:

 

 

 

3, after save, back FIle and Code Template- "Includes, set in PHP Function Doc Comment here:

/**
 * @Notes:
 * @Interface ${NAME}
${PARAM_DOC}
#if (${TYPE_HINT} != "void") * @return ${TYPE_HINT}
#end
${THROWS_DOC}
 * @author: Chenrui
 * @Time: ${DATE}   ${TIME}
*/

4、点击Apply,点击OK,然后在方法前面,输入 /**后回车:

/**
* @Notes:
* @Interface put_token
* @param $data
* @return string
* @author: Chenrui
* @Time: 2018/5/9 18:05
*/

我自己设置

/**
${PARAM_DOC}
#if (${TYPE_HINT} != "void") * @return ${TYPE_HINT}
#end
${THROWS_DOC}
User: lxw
Date: ${DATE} ${TIME}
*/

  

 

 

OK,完成。
---------------------
版权声明:本文为CSDN博主「chenrui310」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/chenrui310/article/details/80257433

Guess you like

Origin www.cnblogs.com/lxwphp/p/11350911.html