前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >PhpStorm 一些配置

PhpStorm 一些配置

作者头像
老高的技术博客
发布2022-12-28 12:20:18
2250
发布2022-12-28 12:20:18
举报
文章被收录于专栏:老高的技术博客

代码写时间长了难免有重装的时候,然后之前一些自定义的东西就没了,主要是一些格式化,模板等一些规范化的东西,之前看好像有配置导出功能,但是用了一次,貌似没什么卵用,所以还是记下来吧。

APIdoc

Settings (Preferences on Mac) | Editor | File and Code Templates | PHP Function Doc Comment

默认:

代码语言:javascript
复制
/**
${PARAM_DOC}
#if (${TYPE_HINT} != "void") * @return ${TYPE_HINT}
#end
${THROWS_DOC}
*/

下面是一些说明

代码语言:javascript
复制
A built-in template for PHP function doc comment. 
Predefined variables will take the following values:
${NAME}
 
Function name.
${TYPE_HINT}
 
A type hint of the function's return value. If no return types can be found from function static analysis, evaluates to "void".
${PARAM_DOC}
 
Parameters' doc comment.
Generated as a number of lines '* @param type name". If there are no parameters, evaluates to an empty content.
${THROWS_DOC}
 
Exceptions' doc comment.
Generated as a number of lines '* @throws type". If there are no thrown exceptions, evaluates to an empty content.
${STATIC}
 
Takes a value of "static" if the function (method) is static or an empty string otherwise. For example: 
      #if (${STATIC} == "static") * @static      #end    
${DS}
 
Dollar sign, evaluates to a plain '$' character.
${CARET}
 
Marks a position where the caret must be moved after the comment is added.

ARRAY对齐

Settings (Preferences on Mac) | Editor | Code Style | PHP | Other | Array declaration style -> Align key-value pairs

代码语言:javascript
复制
$arr = [
   "foo" => "bar",
   "barr" => "foo",
   "bar_____r" => "foo",
]


$arr = [
   "foo"       => "bar",
   "barr"      => "foo",
   "bar_____r" => "foo",
]

赋值对齐

Settings (Preferences on Mac) | Editor | Code Style | PHP | Wrapping and Braces -> Assignment Statement

代码语言:javascript
复制
$sExample = 'Example !';
$sAnotherOneHere = 'Again ?';
$sAndTheLast = 'ENOUGH !';

$sExample        = 'Example !';
$sAnotherOneHere = 'Again ?';
$sAndTheLast     = 'ENOUGH !';

参数类型提示

关闭以提高性能

Settings->Editor->General->Appearance->"Show parameter name hints"

待补充

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017-10-11,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • APIdoc
  • ARRAY对齐
  • 赋值对齐
  • 参数类型提示
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档