juliangut/php-cs-fixer-custom-fixers
最新稳定版本:1.1.1
Composer 安装命令:
composer require juliangut/php-cs-fixer-custom-fixers
包简介
Custom fixers for PHP CS Fixer
README 文档
README
php-cs-fixer-custom-fixers
Custom fixers for PHP-CS-Fixer
Installation
Composer
composer require --dev juliangut/php-cs-fixer-custom-fixers
Usage
Register custom fixers on PHP-CS-Fixer configuration
<?php use Jgut\PhpCsFixerCustomFixers\Fixers; use Jgut\PhpCsFixerCustomFixers\Fixer\Comment\LeadingUppercaseCommentFixer; use Jgut\PhpCsFixerCustomFixers\Fixer\Comment\PhpdocLeadingUppercaseSummaryFixer; use Jgut\PhpCsFixerCustomFixers\Fixer\LanguageConstruct\FloatLeadingZeroFixer; use PhpCsFixer\Config; return (new Config()) + ->registerCustomFixers(new Fixers()) ->setRules([ '@PSR2' => true, // ..., + LeadingUppercaseCommentFixer::name() => true, + PhpdocLeadingUppercaseSummaryFixer::name() => true, + FloatLeadingZeroFixer::name() => true, ]);
Fixers
LanguageConstruct
FloatLeadingZeroFixer
Float values should or should not have a leading zero
<?php
class Foo
{
- private float $value = .5;
+ private float $value = 0.5;
}
Configuration
leading_zero (string), should add or should remove a leading zero
Comment
LeadingUppercaseCommentFixer
Comments should start with a leading uppercase letter
<?php -// this is a comment +// This is a comment /* - * this is a block comment + * This is a block comment */
PhpdocLeadingUppercaseSummaryFixer
Docblock summary should start with a leading uppercase letter
<?php
class Foo
{
/**
- * this is a docblock summary.
+ * This is a docblock summary.
*/
public function bar()
{
}
}
Contributing
Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.
See file CONTRIBUTING.md
License
See file LICENSE included with the source code for a copy of the license terms.
统计信息
- 总下载量: 8.2k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-09-22