chore(legacy): set format rules based on version
This commit is contained in:
parent
edab2a694d
commit
da52f495b4
|
@ -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([
|
||||
'@PhpCsFixer' => true,
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
|
||||
'ordered_class_elements' => false,
|
||||
'yoda_style' => false,
|
||||
])
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue