tpay-com / coding-standards
Tpay.com 编码规范库
1.0.1
2023-08-22 10:49 UTC
Requires
- php: ^7.4 || ^8.0
- kubawerlos/php-cs-fixer-custom-fixers: ^3.16.2
- php-cs-fixer/shim: ^3.22
Requires (Dev)
- phpunit/phpunit: ^9.6.11
- vimeo/psalm: ^5.15.0
README
安装
运行命令
composer require --dev tpay-com/coding-standards
用法
创建 .php-cs-fixer.php
文件并使用 Tpay\CodingStandards\PhpCsFixerConfigFactory
<?php require __DIR__ . '/vendor/tpay-com/coding-standards/bootstrap.php'; return Tpay\CodingStandards\PhpCsFixerConfigFactory::createWithAllRules() ->setFinder( PhpCsFixer\Finder::create() ->ignoreDotFiles(false) ->in(__DIR__) );
您可以使用方法 createWithNonRiskyRules
来仅使用非风险修复器,而不是使用 createWithAllRules
。
使用方法 createWithLegacyRules
来仅使用对 PHP 5.6 及以下版本安全的修复器集合。