Skip to content

Commit 39711d8

Browse files
committed
chore: config php-cs-fixer
1 parent 16c02eb commit 39711d8

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.php-cs-fixer.dist.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use CodeIgniter\CodingStandard\CodeIgniter4;
4+
use Nexus\CsConfig\Factory;
5+
use PhpCsFixer\Finder;
6+
7+
$finder = Finder::create()
8+
->files()
9+
->in([
10+
__DIR__ . '/src/',
11+
__DIR__ . '/tests/',
12+
])
13+
->exclude([
14+
'build',
15+
'Views',
16+
])
17+
->append([
18+
__FILE__,
19+
__DIR__ . '/rector.php',
20+
]);
21+
22+
$overrides = [
23+
// 'declare_strict_types' => true,
24+
// 'void_return' => true,
25+
];
26+
27+
$options = [
28+
'finder' => $finder,
29+
'cacheFile' => 'build/.php-cs-fixer.cache',
30+
];
31+
32+
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
}
3636
},
3737
"scripts": {
38+
"cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff",
39+
"cs-fix": "php-cs-fixer fix --ansi --verbose --diff",
3840
"test": "phpunit"
3941
},
4042
"minimum-stability": "dev",

0 commit comments

Comments
 (0)