Skip to content

Commit

Permalink
Merge pull request #8746 from kenjis/test-add-return-void
Browse files Browse the repository at this point in the history
test: add return void
  • Loading branch information
kenjis authored Apr 10, 2024
2 parents 2c524fd + fa5496c commit 2ae1930
Show file tree
Hide file tree
Showing 49 changed files with 246 additions and 950 deletions.
5 changes: 1 addition & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
->files()
->in([
__DIR__ . '/system',
__DIR__ . '/tests',
__DIR__ . '/utils',
])
->exclude([
Expand All @@ -30,14 +29,12 @@
'Validation/Views',
])
->notPath([
'_support/View/Cells/multiplier.php',
'_support/View/Cells/colors.php',
'_support/View/Cells/addition.php',
])
->notName('#Foobar.php$#')
->append([
__FILE__,
__DIR__ . '/.php-cs-fixer.no-header.php',
__DIR__ . '/.php-cs-fixer.tests.php',
__DIR__ . '/.php-cs-fixer.user-guide.php',
__DIR__ . '/rector.php',
__DIR__ . '/spark',
Expand Down
57 changes: 57 additions & 0 deletions .php-cs-fixer.tests.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

declare(strict_types=1);

/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

use CodeIgniter\CodingStandard\CodeIgniter4;
use Nexus\CsConfig\Factory;
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
use Nexus\CsConfig\FixerGenerator;
use PhpCsFixer\Finder;

$finder = Finder::create()
->files()
->in([
__DIR__ . '/tests',
])
->exclude([
])
->notPath([
'_support/View/Cells/multiplier.php',
'_support/View/Cells/colors.php',
'_support/View/Cells/addition.php',
])
->notName('#Foobar.php$#')
->append([
]);

$overrides = [
'void_return' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
'finder' => $finder,
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter 4 framework',
'CodeIgniter Foundation',
'[email protected]'
);

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
NoCodeSeparatorCommentFixer::name() => true,
]));

return $config;
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@
"Composer\\Config::disableProcessTimeout",
"php-cs-fixer fix --ansi --verbose --dry-run --diff --config=.php-cs-fixer.user-guide.php",
"php-cs-fixer fix --ansi --verbose --dry-run --diff --config=.php-cs-fixer.no-header.php",
"php-cs-fixer fix --ansi --verbose --dry-run --diff --config=.php-cs-fixer.tests.php",
"php-cs-fixer fix --ansi --verbose --dry-run --diff"
],
"cs-fix": [
"Composer\\Config::disableProcessTimeout",
"php-cs-fixer fix --ansi --verbose --diff --config=.php-cs-fixer.user-guide.php",
"php-cs-fixer fix --ansi --verbose --diff --config=.php-cs-fixer.no-header.php",
"php-cs-fixer fix --ansi --verbose --diff --config=.php-cs-fixer.tests.php",
"php-cs-fixer fix --ansi --verbose --diff"
],
"metrics": "tools/phpmetrics/vendor/bin/phpmetrics --config=phpmetrics.json",
Expand Down
Loading

0 comments on commit 2ae1930

Please sign in to comment.