sinSquare / phpdoc-formatter
一个自动修复phpDocumentor标签和注释的工具
0.1.3
2021-03-21 15:37 UTC
Requires
- php: ^5.6 || >=7.0
- symfony/finder: >=4.0
- symfony/polyfill-php70: >=1.0
- symfony/polyfill-php72: >=1.4
- symfony/stopwatch: >=4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: >=2.0
- phpunit/phpunit: >=6.0
README
一个简单的PHPDoc格式化工具
该工具目前可以修复
- 通过多行注释进行缩进
- 移除超过2个空行
- 修复PHPDoc格式
用法
phpdoc-formatter [--option value] [/path/to/project ...]
选项
--exclude (-e) Exclude path(s)
ex: --exclude vendor,library
--version (-v) Displays the version
--ident (-i) Sets the ident character(s)
ex: --ident " "
--newline (-n) Sets the newline character(s)
ex: --ident "\r\n"
--help (-h) Displays this message
示例
之前
/**
* @SWG\Info(
* title="API",
* version="1.0"
* )
*
* @SWG\Swagger(
* host=API_HOST,
* basePath=API_BASE_PATH
* )
*
* @SWG\SecurityScheme(
* securityDefinition="JWTTokenAuth",
* type="apiKey",
* in="header",
* name="Authorization",
* description=API_DEFAULT_TOKEN,
* )
*/
之后
/**
* @SWG\Info(
* title="API",
* version="1.0"
* )
*
* @SWG\Swagger(
* host=API_HOST,
* basePath=API_BASE_PATH
* )
*
* @SWG\SecurityScheme(
* securityDefinition="JWTTokenAuth",
* type="apiKey",
* in="header",
* name="Authorization",
* description=API_DEFAULT_TOKEN,
* )
*/