CodeIgniter4/.php-cs-fixer.no-header.php

49 lines
1.3 KiB
PHP
Raw Normal View History

<?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.
*/
use CodeIgniter\CodingStandard\CodeIgniter4;
use Nexus\CsConfig\Factory;
2021-09-03 20:57:36 +08:00
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
use Nexus\CsConfig\FixerGenerator;
use PhpCsFixer\Finder;
$finder = Finder::create()
->files()
->in([
__DIR__ . '/admin',
__DIR__ . '/app',
__DIR__ . '/public',
])
2022-08-21 14:20:28 +08:00
->exclude(['Views/errors/html'])
2021-10-29 18:23:05 +08:00
->append([
__DIR__ . '/admin/starter/builds',
]);
2024-04-11 00:33:34 +08:00
$overrides = [
// for updating to coding-standard
2024-04-23 00:32:06 +08:00
'modernize_strpos' => true,
2024-05-08 00:05:19 +08:00
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
2024-04-23 00:32:06 +08:00
'php_unit_attributes' => true,
2024-04-11 00:33:34 +08:00
];
$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
2023-09-17 09:10:54 +09:00
NoCodeSeparatorCommentFixer::name() => true,
],
];
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();