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 4646$ overrides = [];
4747
4848$ 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 ,
5551];
5652
57- return Factory::create (new CodeIgniter4 (), $ overrides , $ options )->forLibrary (
53+ $ config = Factory::create (new CodeIgniter4 (), $ overrides , $ options )->forLibrary (
5854 'CodeIgniter 4 framework ' ,
5955 'CodeIgniter Foundation ' ,
60566157);
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 3232$ overrides = [];
3333
3434$ 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 ,
4137];
4238
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 3636];
3737
3838$ 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 ,
4541];
4642
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