wallabag/.php-cs-fixer.dist.php

67 lines
1.9 KiB
PHP
Raw Normal View History

2017-07-01 07:52:38 +00:00
<?php
$config = new PhpCsFixer\Config();
2024-01-01 18:11:01 +00:00
return $config
2017-07-01 07:52:38 +00:00
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => [
2024-01-01 18:11:01 +00:00
'syntax' => 'short',
2017-07-01 07:52:38 +00:00
],
'combine_consecutive_unsets' => true,
'heredoc_to_nowdoc' => true,
2022-08-01 18:15:15 +00:00
'no_extra_blank_lines' => [
'tokens' => [
'break',
'continue',
'extra',
'return',
'throw',
'use',
'parenthesis_brace_block',
'square_brace_block',
2024-01-01 18:11:01 +00:00
'curly_brace_block',
],
2017-07-01 07:52:38 +00:00
],
'no_unreachable_default_argument_value' => true,
2024-01-01 18:11:01 +00:00
'no_useless_concat_operator' => false,
2017-07-01 07:52:38 +00:00
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
2024-01-01 18:11:01 +00:00
'phpdoc_separation' => false,
2022-08-01 18:15:15 +00:00
// 'psr_autoloading' => true,
2017-07-01 07:52:38 +00:00
'strict_comparison' => true,
'strict_param' => true,
// We override next rule because of current @Symfony ruleSet
// 'parameters' element is breaking PHP 7.4
// https://cs.symfony.com/doc/rules/control_structure/trailing_comma_in_multiline.html
// TODO: remove this configuration after dropping support of PHP 7.4
'trailing_comma_in_multiline' => [
'elements' => [
'arrays',
'array_destructuring',
'match',
],
],
2017-07-01 07:52:38 +00:00
'concat_space' => [
2024-01-01 18:11:01 +00:00
'spacing' => 'one',
2017-07-01 07:52:38 +00:00
],
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude([
'node_modules',
2017-07-01 07:52:38 +00:00
'vendor',
'var',
2024-01-01 18:11:01 +00:00
'web',
2017-07-01 07:52:38 +00:00
])
->in(__DIR__)
)
->setCacheFile('.php-cs-fixer.cache')
2017-07-01 07:52:38 +00:00
;