-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
77 lines (70 loc) · 2.44 KB
/
.php-cs-fixer.dist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
declare(strict_types=1);
/**
* This file is part of the Nexus framework.
*
* (c) John Paul E. Balandan, CPA <paulbalandan@gmail.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
use Nexus\CsConfig\Factory;
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
use Nexus\CsConfig\FixerGenerator;
use Nexus\CsConfig\Ruleset\Nexus82;
use PhpCsFixer\Finder;
use PhpCsFixerCustomFixers\Fixer\MultilinePromotedPropertiesFixer;
use PhpCsFixerCustomFixers\Fixer\NoCommentedOutCodeFixer;
use PhpCsFixerCustomFixers\Fixer\NoUselessCommentFixer;
use PhpCsFixerCustomFixers\Fixer\NoUselessParenthesisFixer;
use PhpCsFixerCustomFixers\Fixer\PhpdocTypesCommaSpacesFixer;
use PhpCsFixerCustomFixers\Fixer\PhpUnitAssertArgumentsOrderFixer;
use PhpCsFixerCustomFixers\Fixer\PhpUnitNoUselessReturnFixer;
use PhpCsFixerCustomFixers\Fixer\PromotedConstructorPropertyFixer;
use PhpCsFixerCustomFixers\Fixers;
$finder = Finder::create()
->files()
->in([
__DIR__.'/.github',
__DIR__.'/bin',
__DIR__.'/src',
__DIR__.'/tests',
__DIR__.'/tools',
])
->notPath([
'#PHPStan/.+/data/.+#',
])
->append([
__FILE__,
'bin/build-infection',
'bin/parallel-phpunit',
'bin/prune-cache',
])
;
$overrides = [
'final_public_method_for_abstract_class' => false,
];
$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('tools/vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer')->mergeWith(new Fixers()),
'customRules' => [
MultilinePromotedPropertiesFixer::name() => [
'keep_blank_lines' => false,
'minimum_number_of_properties' => 1,
],
NoCodeSeparatorCommentFixer::name() => true,
NoCommentedOutCodeFixer::name() => true,
NoUselessCommentFixer::name() => true,
NoUselessParenthesisFixer::name() => true,
PhpUnitAssertArgumentsOrderFixer::name() => true,
PhpUnitNoUselessReturnFixer::name() => true,
PhpdocTypesCommaSpacesFixer::name() => true,
PromotedConstructorPropertyFixer::name() => ['promote_only_existing_properties' => false],
],
];
return Factory::create(new Nexus82(), $overrides, $options)->forLibrary(
'the Nexus framework',
'John Paul E. Balandan, CPA',
'paulbalandan@gmail.com',
);