mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2025-02-09 22:23:50 +01:00

[TASK] Improve readability of php-cs-fixer configuration (#1553)

We now use `addRules()` method instead of fiddling around with an
array of rules.
It allows us to overwrite existing rules, or even disable existing rules
by setting them to `false`.
This commit is contained in:
Daniel Siepmann (Codappix) 2025-01-16 09:03:43 +01:00 committed by GitHub
parent 8b10a0becf
commit 0dcc435942
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,11 +5,11 @@ use TYPO3\CodingStandards\CsFixerConfig;
$config = CsFixerConfig::create();
// This is required as long as we are on PHPUnit 9.x. It can be removed after the switch to PHPUnit 10.x.
// @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8337
$rules = $config->getRules();
$rules['php_unit_test_case_static_method_calls'] = ['call_type' => 'self', 'methods' => ['createStub' => 'this']];
$config->setRules($rules);
$config->addRules([
// This is required as long as we are on PHPUnit 9.x. It can be removed after the switch to PHPUnit 10.x.
// @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8337
'php_unit_test_case_static_method_calls' => ['call_type' => 'self', 'methods' => ['createStub' => 'this']],
]);
// @TODO 4.0 no need to call this manually
$config->setParallelConfig(ParallelConfigFactory::detect());