| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
$additionalRules = [ |
| 9 |
'@PHP74Migration' => true, |
| 10 |
'@PHP74Migration:risky' => true, |
| 11 |
'visibility_required' => true, |
| 12 |
'heredoc_indentation' => true, |
| 13 |
'heredoc_to_nowdoc' => true, |
| 14 |
'no_null_property_initialization' => true, |
| 15 |
'no_useless_else' => true, |
| 16 |
'no_useless_return' => true, |
| 17 |
'global_namespace_import' => [ |
| 18 |
'import_classes' => true, |
| 19 |
'import_constants' => true, |
| 20 |
'import_functions' => true, |
| 21 |
], |
| 22 |
'constant_case' => true, |
| 23 |
'declare_strict_types' => true, |
| 24 |
'indentation_type' => true, |
| 25 |
'no_superfluous_phpdoc_tags' => [ |
| 26 |
'allow_mixed' => true, |
| 27 |
], |
| 28 |
'phpdoc_line_span' => [ |
| 29 |
'const' => 'single', |
| 30 |
'method' => 'multi', |
| 31 |
'property' => 'single', |
| 32 |
], |
| 33 |
'phpdoc_trim_consecutive_blank_line_separation' => true, |
| 34 |
|
| 35 |
'fopen_flag_order' => true, |
| 36 |
'fopen_flags' => true, |
| 37 |
'ereg_to_preg' => true, |
| 38 |
'implode_call' => true, |
| 39 |
'no_unset_on_property' => true, |
| 40 |
|
| 41 |
'comment_to_phpdoc' => true, |
| 42 |
'phpdoc_to_comment' => false, |
| 43 |
]; |
| 44 |
$rulesProvider = new Facile\CodingStandards\Rules\CompositeRulesProvider([ |
| 45 |
new Facile\CodingStandards\Rules\DefaultRulesProvider(), |
| 46 |
new Facile\CodingStandards\Rules\ArrayRulesProvider($additionalRules), |
| 47 |
]); |
| 48 |
|
| 49 |
$config = new PhpCsFixer\Config(); |
| 50 |
$config->setRules($rulesProvider->getRules()); |
| 51 |
$config->setRiskyAllowed(true); |
| 52 |
|
| 53 |
$finder = new PhpCsFixer\Finder(); |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
$autoloadPathProvider = new Facile\CodingStandards\AutoloadPathProvider(); |
| 59 |
$finder->in($autoloadPathProvider->getPaths()); |
| 60 |
|
| 61 |
$config->setFinder($finder); |
| 62 |
|
| 63 |
return $config; |