Do not add : void for test methods

This commit is contained in:
Fabien Potencier
2026-05-22 12:29:27 +02:00
parent ed6df6b4b4
commit d8781e473c
+20
View File
@@ -19,6 +19,26 @@ return (new Config())
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
])
->setRuleCustomisationPolicy(new class implements PhpCsFixer\Config\RuleCustomisationPolicyInterface {
public function getPolicyVersionForCache(): string
{
return hash_file('xxh128', __FILE__);
}
public function getRuleCustomisers(): array
{
return [
'void_return' => static function (SplFileInfo $file) {
// temporary hack due to bug: https://github.com/symfony/symfony/issues/62734
if (!$file instanceof Symfony\Component\Finder\SplFileInfo) {
return false;
}
return !str_contains($file->getRelativePathname(), '/Tests/');
},
];
}
})
->setRiskyAllowed(true)
->setParallelConfig(ParallelConfigFactory::detect())
->setFinder((new Finder())->in(__DIR__))