|
11 | 11 | * the LICENSE file that was distributed with this source code.
|
12 | 12 | */
|
13 | 13 |
|
14 |
| -use CodeIgniter\CodingStandard\CodeIgniter4; |
15 |
| -use Nexus\CsConfig\Factory; |
16 |
| -use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer; |
17 |
| -use Nexus\CsConfig\FixerGenerator; |
| 14 | +use PhpCsFixer\ConfigInterface; |
18 | 15 | use PhpCsFixer\Finder;
|
19 | 16 |
|
| 17 | +/** @var ConfigInterface $config */ |
| 18 | +$config = require __DIR__ . '/.php-cs-fixer.dist.php'; |
| 19 | + |
20 | 20 | $finder = Finder::create()
|
21 | 21 | ->files()
|
22 | 22 | ->in([
|
|
32 | 32 |
|
33 | 33 | $overrides = [
|
34 | 34 | 'echo_tag_syntax' => false,
|
| 35 | + 'header_comment' => false, |
35 | 36 | 'php_unit_internal_class' => false,
|
36 | 37 | 'no_unused_imports' => false,
|
37 | 38 | 'class_attributes_separation' => false,
|
38 | 39 | 'fully_qualified_strict_types' => [
|
39 | 40 | 'import_symbols' => false,
|
40 | 41 | 'leading_backslash_in_global_namespace' => true,
|
41 | 42 | ],
|
42 |
| - // for updating to coding-standard |
43 |
| - 'modernize_strpos' => true, |
44 |
| - 'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'], |
45 |
| - 'php_unit_attributes' => true, |
46 |
| -]; |
47 |
| - |
48 |
| -$options = [ |
49 |
| - 'cacheFile' => 'build/.php-cs-fixer.user-guide.cache', |
50 |
| - 'finder' => $finder, |
51 |
| - 'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'), |
52 |
| - 'customRules' => [ |
53 |
| - NoCodeSeparatorCommentFixer::name() => true, |
54 |
| - ], |
55 | 43 | ];
|
56 | 44 |
|
57 |
| -return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects(); |
| 45 | +return $config |
| 46 | + ->setFinder($finder) |
| 47 | + ->setCacheFile('build/.php-cs-fixer.user-guide.cache') |
| 48 | + ->setRules(array_merge($config->getRules(), $overrides)); |
0 commit comments