gigadrive / php-coding-standard
该包已被废弃,不再维护。没有建议的替代包。
Gigadrive项目的PHP编码标准 - 集成PHP CS Fixer
1.0.3
2022-02-03 20:21 UTC
Requires (Dev)
This package is auto-updated.
Last update: 2022-05-31 00:30:24 UTC
README
此存储库包含用于Gigadrive PHP项目的编码标准。它是公开的,并按照MIT许可证授权。
编码标准是为了与PHP CS Fixer工具一起使用,以便轻松集成IDE和CI流水线。
安装
您需要使用composer安装PHP CS Fixer和Gigadrive编码标准。
composer require --dev friendsofphp/php-cs-fixer composer require --dev gigadrive/php-coding-standard
使用方法
接下来,在项目根目录下创建一个.php-cs-fixer.dist.php
文件
<?php $config = require_once "vendor/gigadrive/php-coding-standard/php-cs-fixer-config.php"; // Define what project files you want to pass to PHP CS Fixer. $finder = (new PhpCsFixer\Finder()) ->in(__DIR__) ->exclude("var") ->exclude("vendor"); return $config ->setFinder($finder);
您的项目现在将默认使用Gigadrive PHP编码标准。
重要:此编码标准包含PHP CS Fixer认为的具有风险的规则。请在自己的风险下使用它们。为了防止意外的损害,默认禁用了风险标志。您可以调整配置文件以启用它,或将--allow-risky=yes
选项传递给命令行。
$config
是一个您可以根据PHP CS Fixer文档使用的PHP CS Fixer配置对象。您可以使用它来调整编码标准规则,以满足您的需求。
版权和许可证
此程序由Mehdi Baaboura开发并由Gigadrive UG发布,根据MIT许可证授权。有关更多信息,请点击此处。