Skip to content

Commit 681c927

Browse files
committed
Remove the "Repository cannot be final" requirement
1 parent a5d2531 commit 681c927

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

ecs.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
use BitBag\CodingStandard\Fixer\FinalClassInEntitiesOrRepositoriesFixer;
5+
use BitBag\CodingStandard\Fixer\FinalClassInEntitiesFixer;
66
use BitBag\CodingStandard\Fixer\AboveTwoArgumentsMultilineFixer;
77
use PhpCsFixer\Fixer\Alias\EregToPregFixer;
88
use PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer;
@@ -391,9 +391,8 @@
391391
$services->set(RequireOneLinePropertyDocCommentSniff::class);
392392

393393
$services->set(YodaStyleFixer::class)->call('configure',[['equal' => true, 'identical' => true, 'less_and_greater' => true,]]);
394-
395-
$services->set(FinalClassInEntitiesOrRepositoriesFixer::class);
396-
394+
395+
$services->set(FinalClassInEntitiesFixer::class);
396+
397397
$services->set(AboveTwoArgumentsMultilineFixer::class);
398398
};
399-

src/Fixer/FinalClassInEntitiesOrRepositoriesFixer.php renamed to src/Fixer/FinalClassInEntitiesFixer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use PhpCsFixer\Tokenizer\Tokens;
1212
use SplFileInfo;
1313

14-
final class FinalClassInEntitiesOrRepositoriesFixer implements FixerInterface
14+
final class FinalClassInEntitiesFixer implements FixerInterface
1515
{
1616
public function isCandidate(Tokens $tokens): bool
1717
{
@@ -42,13 +42,13 @@ public function fix(SplFileInfo $file, Tokens $tokens): void
4242
public function getDefinition(): FixerDefinitionInterface
4343
{
4444
return new FixerDefinition(
45-
'Repositories and Entities should not be defined as final.',
45+
'Entities should not be defined as final.',
4646
[
4747
new CodeSample(
4848
'<?php
4949
declare(strict_types=1);
5050
namespace App\Entity;
51-
final class Product
51+
class Product
5252
{
5353
}
5454
'
@@ -69,6 +69,6 @@ public function getPriority(): int
6969

7070
public function supports(SplFileInfo $file): bool
7171
{
72-
return str_contains($file->getPath(), 'src/Entity') || str_contains($file->getPath(), 'src/Repository');
72+
return str_contains($file->getPath(), 'src/Entity');
7373
}
7474
}

0 commit comments

Comments
 (0)