chore(legacy): set format rules based on version

This commit is contained in:
jo 2022-09-12 14:09:01 +02:00 committed by Jonas L
parent edab2a694d
commit da52f495b4
1 changed files with 19 additions and 7 deletions

View File

@ -6,12 +6,24 @@ $finder = PhpCsFixer\Finder::create()
->exclude('application/models/airtime/map')
->exclude('application/models/airtime/om');
$extra_rules = [
'phpdoc_order' => false,
];
if (version_compare(PhpCsFixer\Console\Application::VERSION, '3.11.0') >= 0) {
$extra_rules['phpdoc_order'] = ['order' => ['param', 'return', 'throws']];
}
$config = new PhpCsFixer\Config();
return $config->setRules([
return $config->setRules(array_merge(
[
'@PhpCsFixer' => true,
'concat_space' => ['spacing' => 'one'],
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
'ordered_class_elements' => false,
'yoda_style' => false,
])
],
$extra_rules
))
->setFinder($finder);