如何通過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 –
我明白了。感謝分享。 –