xenforo-ltd / xf-cs-fixer
针对XenForo的PHP编码规范修复器配置
v1.0.1
2024-07-12 22:04 UTC
Requires
- php: ^7.4 || ^8.0
- friendsofphp/php-cs-fixer: ^3.0
Requires (Dev)
- phpstan/phpstan: ^1.0
- phpstan/phpstan-strict-rules: ^1.0
README
为PHP编码规范修复器提供的XenForo配置。
此库提供了一个配置辅助工具和一些额外的规则,这些规则补充了内置的PER-CS规则集,以自动根据XenForo代码风格格式化代码。
安装
要使用我们的配置或规则,请使用Composer安装它们
composer require --dev xenforo-ltd/xf-cs-fixer
用法
在项目目录中创建一个.php-cs-fixer.dist.php
配置文件
<?php declare(strict_types=1); use PhpCsFixer\Finder; use XFCsFixer\ConfigHelper; $finder = Finder::create() ->in(__DIR__) ->ignoreVCSIgnored(true) ->notPath([ // you may set paths or path patterns to exclude here ]); $helper = new ConfigHelper($finder); // you may customize the rules or configuration further here return $helper->getConfig();
有关更多信息,请参阅PHP编码规范修复器文档。