Skip to content

Commit 2ae1930

Browse files
authored
Merge pull request #8746 from kenjis/test-add-return-void
test: add return void
2 parents 2c524fd + fa5496c commit 2ae1930

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+246
-950
lines changed

.php-cs-fixer.dist.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
->files()
2222
->in([
2323
__DIR__ . '/system',
24-
__DIR__ . '/tests',
2524
__DIR__ . '/utils',
2625
])
2726
->exclude([
@@ -30,14 +29,12 @@
3029
'Validation/Views',
3130
])
3231
->notPath([
33-
'_support/View/Cells/multiplier.php',
34-
'_support/View/Cells/colors.php',
35-
'_support/View/Cells/addition.php',
3632
])
3733
->notName('#Foobar.php$#')
3834
->append([
3935
__FILE__,
4036
__DIR__ . '/.php-cs-fixer.no-header.php',
37+
__DIR__ . '/.php-cs-fixer.tests.php',
4138
__DIR__ . '/.php-cs-fixer.user-guide.php',
4239
__DIR__ . '/rector.php',
4340
__DIR__ . '/spark',

.php-cs-fixer.tests.php

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of CodeIgniter 4 framework.
7+
*
8+
* (c) CodeIgniter Foundation <[email protected]>
9+
*
10+
* For the full copyright and license information, please view
11+
* the LICENSE file that was distributed with this source code.
12+
*/
13+
14+
use CodeIgniter\CodingStandard\CodeIgniter4;
15+
use Nexus\CsConfig\Factory;
16+
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17+
use Nexus\CsConfig\FixerGenerator;
18+
use PhpCsFixer\Finder;
19+
20+
$finder = Finder::create()
21+
->files()
22+
->in([
23+
__DIR__ . '/tests',
24+
])
25+
->exclude([
26+
])
27+
->notPath([
28+
'_support/View/Cells/multiplier.php',
29+
'_support/View/Cells/colors.php',
30+
'_support/View/Cells/addition.php',
31+
])
32+
->notName('#Foobar.php$#')
33+
->append([
34+
]);
35+
36+
$overrides = [
37+
'void_return' => true,
38+
];
39+
40+
$options = [
41+
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
42+
'finder' => $finder,
43+
];
44+
45+
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
46+
'CodeIgniter 4 framework',
47+
'CodeIgniter Foundation',
48+
49+
);
50+
51+
$config
52+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
53+
->setRules(array_merge($config->getRules(), [
54+
NoCodeSeparatorCommentFixer::name() => true,
55+
]));
56+
57+
return $config;

composer.json

+2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@
101101
"Composer\\Config::disableProcessTimeout",
102102
"php-cs-fixer fix --ansi --verbose --dry-run --diff --config=.php-cs-fixer.user-guide.php",
103103
"php-cs-fixer fix --ansi --verbose --dry-run --diff --config=.php-cs-fixer.no-header.php",
104+
"php-cs-fixer fix --ansi --verbose --dry-run --diff --config=.php-cs-fixer.tests.php",
104105
"php-cs-fixer fix --ansi --verbose --dry-run --diff"
105106
],
106107
"cs-fix": [
107108
"Composer\\Config::disableProcessTimeout",
108109
"php-cs-fixer fix --ansi --verbose --diff --config=.php-cs-fixer.user-guide.php",
109110
"php-cs-fixer fix --ansi --verbose --diff --config=.php-cs-fixer.no-header.php",
111+
"php-cs-fixer fix --ansi --verbose --diff --config=.php-cs-fixer.tests.php",
110112
"php-cs-fixer fix --ansi --verbose --diff"
111113
],
112114
"metrics": "tools/phpmetrics/vendor/bin/phpmetrics --config=phpmetrics.json",

0 commit comments

Comments
 (0)