如何通过fix
命令创建自定义规则集并使用选项[email protected]
?如何为php-cs-fixer创建自定义规则集?
像@PSR1
,@PSR2
,@Symfony
,@PHP56Migration
,@PHP70Migration
,@PHP71Migration
制成。
PHP-CS-固定器版本:2.2.3
只有插入供应商代码 - vendor/friendsofphp/php-cs-fixer/src/RuleSet.php
:
private $setDefinitions = array(
'@custom' => [
'some_custom_fixer` => true,
]
)
作品如我所料,但RuleSet
是final class
。当使用自定义配置.php_cs
时,有没有办法覆盖或扩展setDefinitions
?
为什么不简化列表中选择特定固定器?你的目标是什么? –
像这样:https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/2884 –
我明白了。感谢分享。 –