Clean up rule set.

This commit is contained in:
James Cole
2024-02-20 19:59:55 +01:00
parent aa2afd162e
commit 8f14979717

View File

@@ -35,28 +35,32 @@ $finder = PhpCsFixer\Finder::create()
$config = new PhpCsFixer\Config(); $config = new PhpCsFixer\Config();
return $config->setRules([ return $config->setRules(
'no_unused_imports' => true, [
'@PhpCsFixer' => true, // rule sets
'@PHP83Migration' => true, '@PHP83Migration' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true, '@PhpCsFixer:risky' => true,
'@PSR12' => true,
'@PSR12:risky' => true, '@PSR12:risky' => true,
'declare_strict_types' => true, 'declare_strict_types' => true,
'strict_param' => true, 'strict_param' => true,
'comment_to_phpdoc' => false, // breaks phpstan lines in combination with PHPStorm. 'no_unused_imports' => true,
'array_syntax' => ['syntax' => 'short'], 'single_space_around_construct' => true,
'statement_indentation' => true,
'void_return' => true,
// disabled rules
'native_function_invocation' => false, // annoying 'native_function_invocation' => false, // annoying
'php_unit_data_provider_name' => false, // bloody annoying long test names 'php_unit_data_provider_name' => false, // bloody annoying long test names
'static_lambda' => false, // breaks the Response macro for API's. 'static_lambda' => false, // breaks the Response macro for API's.
'phpdoc_summary' => false, // annoying. 'phpdoc_summary' => false, // annoying.
'single_space_around_construct' => [ 'comment_to_phpdoc' => false, // breaks phpstan lines in combination with PHPStorm.
'constructs_followed_by_a_single_space' => [
'protected',
],
],
'statement_indentation' => true,
'type_declaration_spaces' => false, 'type_declaration_spaces' => false,
'cast_spaces' => false, 'cast_spaces' => false,
// complex rules
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [ 'binary_operator_spaces' => [
'default' => 'at_least_single_space', 'default' => 'at_least_single_space',
'operators' => [ 'operators' => [
@@ -65,6 +69,5 @@ return $config->setRules([
'??=' => 'align_single_space_minimal_by_scope', '??=' => 'align_single_space_minimal_by_scope',
], ],
], ],
'void_return' => true,
]) ])
->setFinder($finder); ->setFinder($finder);