Skip to content

Commit 1611a03

Browse files
committed
Make all classes final
1 parent 17036d8 commit 1611a03

35 files changed

+61
-60
lines changed

phpcs.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<exclude name="SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden"/><!-- It removes @dataProvider, but PHPUnit 9 does not yet have #[DataProvider] -->
1919
</rule>
2020

21+
<rule ref="SlevomatCodingStandard.Classes.RequireAbstractOrFinal"/>
2122
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration">
2223
<properties>
2324
<property name="onlySingleLine" value="false"/>

src/Collector/ClassDefinitionCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* interfaces: array<string, null>,
3535
* }>
3636
*/
37-
class ClassDefinitionCollector implements Collector
37+
final class ClassDefinitionCollector implements Collector
3838
{
3939

4040
private ReflectionProvider $reflectionProvider;

src/Collector/ConstantFetchCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* @implements Collector<Node, list<string>>
3131
*/
32-
class ConstantFetchCollector implements Collector
32+
final class ConstantFetchCollector implements Collector
3333
{
3434

3535
use BufferedUsageCollector;

src/Collector/MethodCallCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/**
3636
* @implements Collector<Node, list<string>>
3737
*/
38-
class MethodCallCollector implements Collector
38+
final class MethodCallCollector implements Collector
3939
{
4040

4141
use BufferedUsageCollector;

src/Collector/ProvidedUsagesCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* @implements Collector<Node, list<string>>
1919
*/
20-
class ProvidedUsagesCollector implements Collector
20+
final class ProvidedUsagesCollector implements Collector
2121
{
2222

2323
use BufferedUsageCollector;

src/Compatibility/BackwardCompatibilityChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use function implode;
1010
use function var_export;
1111

12-
class BackwardCompatibilityChecker
12+
final class BackwardCompatibilityChecker
1313
{
1414

1515
/**

src/Debug/DebugUsagePrinter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
use function strpos;
2929
use function substr;
3030

31-
class DebugUsagePrinter
31+
final class DebugUsagePrinter
3232
{
3333

3434
public const ANY_MEMBER = "\0";

src/Excluder/MixedUsageExcluder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use PHPStan\Analyser\Scope;
77
use ShipMonk\PHPStan\DeadCode\Graph\ClassMemberUsage;
88

9-
class MixedUsageExcluder implements MemberUsageExcluder
9+
final class MixedUsageExcluder implements MemberUsageExcluder
1010
{
1111

1212
private bool $enabled;

src/Excluder/TestsUsageExcluder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
use function strpos;
2525
use const JSON_ERROR_NONE;
2626

27-
class TestsUsageExcluder implements MemberUsageExcluder
27+
final class TestsUsageExcluder implements MemberUsageExcluder
2828
{
2929

3030
private ReflectionProvider $reflectionProvider;

src/Formatter/RemoveDeadCodeFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use function array_keys;
1616
use function count;
1717

18-
class RemoveDeadCodeFormatter implements ErrorFormatter
18+
final class RemoveDeadCodeFormatter implements ErrorFormatter
1919
{
2020

2121
private FileSystem $fileSystem;

0 commit comments

Comments
 (0)