Skip to content

Commit 5dc7f91

Browse files
committed
Fix: Initialize and set Finder
1 parent 38eda3e commit 5dc7f91

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.php-cs-fixer.fixture.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
use Ergebnis\PhpCsFixer;
15+
use PhpCsFixer\Finder;
1516

1617
$ruleSet = PhpCsFixer\Config\RuleSet\Php74::create()
1718
->withHeader('')
@@ -35,9 +36,7 @@
3536
'static_private_method' => false,
3637
]));
3738

38-
$config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet);
39-
40-
$config->getFinder()
39+
$finder = Finder::create()
4140
->in(__DIR__ . '/test/Fixture/')
4241
->notPath([
4342
'CallLikes/NoNamedArgumentRule/ClassUsingInvokableClass.php',
@@ -57,6 +56,9 @@
5756
'Methods/NoParameterWithNullableTypeDeclarationRule/script.php',
5857
]);
5958

59+
$config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet);
60+
6061
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php_cs.fixture.cache');
62+
$config->setFinder($finder);
6163

6264
return $config;

.php-cs-fixer.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Ergebnis\License;
1515
use Ergebnis\PhpCsFixer;
16+
use PhpCsFixer\Finder;
1617

1718
$license = License\Type\MIT::markdown(
1819
__DIR__ . '/LICENSE.md',
@@ -28,9 +29,7 @@
2829

2930
$ruleSet = PhpCsFixer\Config\RuleSet\Php74::create()->withHeader($license->header());
3031

31-
$config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet);
32-
33-
$config->getFinder()
32+
$finder = Finder::create()
3433
->exclude([
3534
'.build/',
3635
'.github/',
@@ -40,6 +39,9 @@
4039
->ignoreDotFiles(false)
4140
->in(__DIR__);
4241

42+
$config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet);
43+
4344
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php-cs-fixer.cache');
45+
$config->setFinder($finder);
4446

4547
return $config;

0 commit comments

Comments
 (0)