adamwojs / php-cs-fixer-one-line-var-phpdoc
dev-master / 1.0.x-dev
2019-06-29 12:50 UTC
Requires
- php: ^7.1
- friendsofphp/php-cs-fixer: ^2.7
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is not auto-updated.
Last update: 2024-09-23 15:25:47 UTC
README
php-cs-fixer 规则,如果未提供额外描述,则强制使用单行 @var phpdoc。
用法
在你的 .php_cs 文件中
<?php // PHP-CS-Fixer 2.x syntax return PhpCsFixer\Config::create() // (1) Register \AdamWojs\PhpCsFixerSingleLineVarPhpdoc\Fixer\Phpdoc\SingleLineVarPhpDocFixer fixer ->registerCustomFixers([ new \AdamWojs\PhpCsFixerSingleLineVarPhpdoc\Fixer\Phpdoc\SingleLineVarPhpDocFixer(), ]) ->setRules([ // ... // (2) Enable AdamWojs/phpdoc_force_single_line_var rule 'AdamWojs/phpdoc_force_single_line_var' => true, ]) // ... ;