|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +/** |
| 6 | + * This file is part of CodeIgniter 4 framework. |
| 7 | + * |
| 8 | + * (c) CodeIgniter Foundation <admin@codeigniter.com> |
| 9 | + * |
| 10 | + * For the full copyright and license information, please view |
| 11 | + * the LICENSE file that was distributed with this source code. |
| 12 | + */ |
| 13 | + |
| 14 | +use CodeIgniter\CodingStandard\CodeIgniter4; |
| 15 | +use Nexus\CsConfig\Factory; |
| 16 | +use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer; |
| 17 | +use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer; |
| 18 | +use Nexus\CsConfig\FixerGenerator; |
| 19 | +use PhpCsFixer\Finder; |
| 20 | + |
| 21 | +$finder = Finder::create() |
| 22 | + ->files() |
| 23 | + ->in([ |
| 24 | + __DIR__ . '/user_guide_src/source', |
| 25 | + ]) |
| 26 | + ->notPath([ |
| 27 | + 'ci3sample/', |
| 28 | + 'libraries/sessions/017.php', |
| 29 | + ]); |
| 30 | + |
| 31 | +$overrides = [ |
| 32 | + 'echo_tag_syntax' => false, |
| 33 | + 'php_unit_internal_class' => false, |
| 34 | + 'no_unused_imports' => false, |
| 35 | + 'class_attributes_separation' => false, |
| 36 | +]; |
| 37 | + |
| 38 | +$options = [ |
| 39 | + 'cacheFile' => 'build/.user-guide.php-cs-fixer.cache', |
| 40 | + 'finder' => $finder, |
| 41 | + 'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'), |
| 42 | + 'customRules' => [ |
| 43 | + NoCodeSeparatorCommentFixer::name() => true, |
| 44 | + SpaceAfterCommentStartFixer::name() => true, |
| 45 | + ], |
| 46 | +]; |
| 47 | + |
| 48 | +return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects(); |
0 commit comments