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/map')
|
||||||
->exclude('application/models/airtime/om');
|
->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();
|
$config = new PhpCsFixer\Config();
|
||||||
return $config->setRules([
|
return $config->setRules(array_merge(
|
||||||
|
[
|
||||||
'@PhpCsFixer' => true,
|
'@PhpCsFixer' => true,
|
||||||
'concat_space' => ['spacing' => 'one'],
|
'concat_space' => ['spacing' => 'one'],
|
||||||
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
|
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
|
||||||
'ordered_class_elements' => false,
|
'ordered_class_elements' => false,
|
||||||
'yoda_style' => false,
|
'yoda_style' => false,
|
||||||
])
|
],
|
||||||
|
$extra_rules
|
||||||
|
))
|
||||||
->setFinder($finder);
|
->setFinder($finder);
|
||||||
|
|
Loading…
Reference in New Issue