2021-06-04 22:10:54 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-07-19 21:32:33 +08:00
|
|
|
/**
|
|
|
|
* This file is part of CodeIgniter 4 framework.
|
|
|
|
*
|
|
|
|
* (c) CodeIgniter Foundation <admin@codeigniter.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view
|
|
|
|
* the LICENSE file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2021-09-02 12:32:07 +08:00
|
|
|
use CodeIgniter\CodingStandard\CodeIgniter4;
|
2021-06-04 22:10:54 +08:00
|
|
|
use Nexus\CsConfig\Factory;
|
2021-09-03 20:57:36 +08:00
|
|
|
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
|
2021-09-02 12:32:07 +08:00
|
|
|
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
|
|
|
|
use Nexus\CsConfig\FixerGenerator;
|
2021-06-04 22:10:54 +08:00
|
|
|
use PhpCsFixer\Finder;
|
|
|
|
|
|
|
|
$finder = Finder::create()
|
2021-06-04 22:51:52 +08:00
|
|
|
->files()
|
|
|
|
->in([
|
|
|
|
__DIR__ . '/system',
|
|
|
|
__DIR__ . '/tests',
|
|
|
|
__DIR__ . '/utils',
|
|
|
|
])
|
|
|
|
->exclude(['ThirdParty'])
|
|
|
|
->notName('#Foobar.php$#')
|
|
|
|
->append([
|
|
|
|
__FILE__,
|
2021-07-19 21:21:30 +08:00
|
|
|
__DIR__ . '/.no-header.php-cs-fixer.dist.php',
|
2022-03-03 15:58:41 +09:00
|
|
|
__DIR__ . '/.user-guide.php-cs-fixer.dist.php',
|
2021-06-04 22:51:52 +08:00
|
|
|
__DIR__ . '/rector.php',
|
|
|
|
__DIR__ . '/spark',
|
2022-02-20 09:04:22 +01:00
|
|
|
__DIR__ . '/user_guide_src/renumerate.php',
|
2021-06-04 22:51:52 +08:00
|
|
|
]);
|
2021-06-04 22:10:54 +08:00
|
|
|
|
2022-02-09 22:20:04 +08:00
|
|
|
$overrides = [];
|
2021-06-04 22:10:54 +08:00
|
|
|
|
|
|
|
$options = [
|
2021-08-13 16:48:41 +08:00
|
|
|
'cacheFile' => 'build/.php-cs-fixer.cache',
|
|
|
|
'finder' => $finder,
|
2021-09-02 12:32:07 +08:00
|
|
|
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
|
|
|
|
'customRules' => [
|
2021-09-03 20:57:36 +08:00
|
|
|
NoCodeSeparatorCommentFixer::name() => true,
|
2021-09-02 12:32:07 +08:00
|
|
|
SpaceAfterCommentStartFixer::name() => true,
|
2021-08-13 16:48:41 +08:00
|
|
|
],
|
2021-06-04 22:10:54 +08:00
|
|
|
];
|
|
|
|
|
2021-07-19 21:21:30 +08:00
|
|
|
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
|
|
|
|
'CodeIgniter 4 framework',
|
|
|
|
'CodeIgniter Foundation',
|
|
|
|
'admin@codeigniter.com'
|
|
|
|
);
|