File tree Expand file tree Collapse file tree 3 files changed +42
-21
lines changed Expand file tree Collapse file tree 3 files changed +42
-21
lines changed Original file line number Diff line number Diff line change 46
46
$ overrides = [];
47
47
48
48
$ options = [
49
- 'cacheFile ' => 'build/.php-cs-fixer.cache ' ,
50
- 'finder ' => $ finder ,
51
- 'customFixers ' => FixerGenerator::create ('vendor/nexusphp/cs-config/src/Fixer ' , 'Nexus \\CsConfig \\Fixer ' ),
52
- 'customRules ' => [
53
- NoCodeSeparatorCommentFixer::name () => true ,
54
- ],
49
+ 'cacheFile ' => 'build/.php-cs-fixer.cache ' ,
50
+ 'finder ' => $ finder ,
55
51
];
56
52
57
- return Factory::create (new CodeIgniter4 (), $ overrides , $ options )->forLibrary (
53
+ $ config = Factory::create (new CodeIgniter4 (), $ overrides , $ options )->forLibrary (
58
54
'CodeIgniter 4 framework ' ,
59
55
'CodeIgniter Foundation ' ,
60
56
61
57
);
58
+
59
+ // @TODO: remove this check when support for PHP 7.4 is dropped
60
+ if (PHP_VERSION_ID >= 80000 ) {
61
+ $ config
62
+ ->registerCustomFixers (FixerGenerator::create ('vendor/nexusphp/cs-config/src/Fixer ' , 'Nexus \\CsConfig \\Fixer ' ))
63
+ ->setRules (array_merge ($ config ->getRules (), [
64
+ NoCodeSeparatorCommentFixer::name () => true ,
65
+ ]));
66
+ }
67
+
68
+ return $ config ;
Original file line number Diff line number Diff line change 32
32
$ overrides = [];
33
33
34
34
$ options = [
35
- 'cacheFile ' => 'build/.php-cs-fixer.no-header.cache ' ,
36
- 'finder ' => $ finder ,
37
- 'customFixers ' => FixerGenerator::create ('vendor/nexusphp/cs-config/src/Fixer ' , 'Nexus \\CsConfig \\Fixer ' ),
38
- 'customRules ' => [
39
- NoCodeSeparatorCommentFixer::name () => true ,
40
- ],
35
+ 'cacheFile ' => 'build/.php-cs-fixer.no-header.cache ' ,
36
+ 'finder ' => $ finder ,
41
37
];
42
38
43
- return Factory::create (new CodeIgniter4 (), $ overrides , $ options )->forProjects ();
39
+ $ config = Factory::create (new CodeIgniter4 (), $ overrides , $ options )->forProjects ();
40
+
41
+ // @TODO: remove this check when support for PHP 7.4 is dropped
42
+ if (PHP_VERSION_ID >= 80000 ) {
43
+ $ config
44
+ ->registerCustomFixers (FixerGenerator::create ('vendor/nexusphp/cs-config/src/Fixer ' , 'Nexus \\CsConfig \\Fixer ' ))
45
+ ->setRules (array_merge ($ config ->getRules (), [
46
+ NoCodeSeparatorCommentFixer::name () => true ,
47
+ ]));
48
+ }
49
+
50
+ return $ config ;
Original file line number Diff line number Diff line change 36
36
];
37
37
38
38
$ options = [
39
- 'cacheFile ' => 'build/.php-cs-fixer.user-guide.cache ' ,
40
- 'finder ' => $ finder ,
41
- 'customFixers ' => FixerGenerator::create ('vendor/nexusphp/cs-config/src/Fixer ' , 'Nexus \\CsConfig \\Fixer ' ),
42
- 'customRules ' => [
43
- NoCodeSeparatorCommentFixer::name () => true ,
44
- ],
39
+ 'cacheFile ' => 'build/.php-cs-fixer.no-header.cache ' ,
40
+ 'finder ' => $ finder ,
45
41
];
46
42
47
- return Factory::create (new CodeIgniter4 (), $ overrides , $ options )->forProjects ();
43
+ $ config = Factory::create (new CodeIgniter4 (), $ overrides , $ options )->forProjects ();
44
+
45
+ // @TODO: remove this check when support for PHP 7.4 is dropped
46
+ if (PHP_VERSION_ID >= 80000 ) {
47
+ $ config
48
+ ->registerCustomFixers (FixerGenerator::create ('vendor/nexusphp/cs-config/src/Fixer ' , 'Nexus \\CsConfig \\Fixer ' ))
49
+ ->setRules (array_merge ($ config ->getRules (), [
50
+ NoCodeSeparatorCommentFixer::name () => true ,
51
+ ]));
52
+ }
53
+
54
+ return $ config ;
You can’t perform that action at this time.
0 commit comments