PhpStorm代碼註釋

1. 文檔頭部註釋

設置 > Editor > File and Code Templates > Includes選項卡 > PHP File Header
    
/**
* 
*
* @category   xxx
* @package    PSR
* @subpackage Documentation\API
* @author     xxx  <xxx@xxx.com>
* @license    GPL https://xxx.com
* @link       https://xxx.com
* @ctime:     ${DATE} ${TIME}
*/

2. 函數頭部設置

設置 > Editor > File and Code Templates > Includes選項卡 > PHP Function Doc Comment

/**
* ${NAME}
*
* @author xxx
*
${PARAM_DOC}
#if (${TYPE_HINT} == "void")
* @return void #else * @return ${TYPE_HINT} #end
*/

3. 設置註釋符縮進位置

設置 > Editor > Code Style > PHP > Other選項卡

取消勾選Line comment at first column 
勾選Add a space at comment start 可在 // 後自動添加一個空格

4. 將Tab製表符替換成4個空格

設置 > Editor > Code Style > PHP  > Tabs and indents選項卡

取消勾選Use tab character
相關文章
相關標籤/搜索