Skip to content

Commit ba888f7

Browse files
committed
Internal classes made final, @api classes made @final
`@api` classes will become `final` in PHPStan 2.0 PHPStan\Type\Type interface implementations are excluded from these changes If these changes impact your project, please open a GitHub Discussion so we can have a conversation about your use case and solve it properly.
1 parent 67193b6 commit ba888f7

File tree

994 files changed

+1313
-1027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

994 files changed

+1313
-1027
lines changed

bin/generate-rule-error-classes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* @internal Use PHPStan\Rules\RuleErrorBuilder instead.
1616
*/
17-
class RuleError%s implements %s
17+
final class RuleError%s implements %s
1818
{
1919
2020
%s

build/enum-adapter-errors.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,3 @@ parameters:
144144
message: "#^Method PHPStan\\\\Reflection\\\\Php\\\\BuiltinMethodReflection\\:\\:getDeclaringClass\\(\\) has invalid return type PHPStan\\\\BetterReflection\\\\Reflection\\\\Adapter\\\\ReflectionEnum\\.$#"
145145
count: 1
146146
path: ../src/Reflection/Php/BuiltinMethodReflection.php
147-
148-
-
149-
message: "#^Method PHPStan\\\\Reflection\\\\Php\\\\NativeBuiltinMethodReflection\\:\\:getDeclaringClass\\(\\) has invalid return type PHPStan\\\\BetterReflection\\\\Reflection\\\\Adapter\\\\ReflectionEnum\\.$#"
150-
count: 1
151-
path: ../src/Reflection/Php/NativeBuiltinMethodReflection.php

phpstan-baseline.neon

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -212,31 +212,6 @@ parameters:
212212
count: 1
213213
path: src/PhpDoc/StubValidator.php
214214

215-
-
216-
message: "#^Return type \\(PHPStan\\\\PhpDoc\\\\Tag\\\\ParamOutTag\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\ParamOutTag\\:\\:withType\\(\\) should be covariant with return type \\(static\\(PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\)\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\:\\:withType\\(\\)$#"
217-
count: 1
218-
path: src/PhpDoc/Tag/ParamOutTag.php
219-
220-
-
221-
message: "#^Return type \\(PHPStan\\\\PhpDoc\\\\Tag\\\\ParamTag\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\ParamTag\\:\\:withType\\(\\) should be covariant with return type \\(static\\(PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\)\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\:\\:withType\\(\\)$#"
222-
count: 1
223-
path: src/PhpDoc/Tag/ParamTag.php
224-
225-
-
226-
message: "#^Return type \\(PHPStan\\\\PhpDoc\\\\Tag\\\\ReturnTag\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\ReturnTag\\:\\:withType\\(\\) should be covariant with return type \\(static\\(PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\)\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\:\\:withType\\(\\)$#"
227-
count: 1
228-
path: src/PhpDoc/Tag/ReturnTag.php
229-
230-
-
231-
message: "#^Return type \\(PHPStan\\\\PhpDoc\\\\Tag\\\\SelfOutTypeTag\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\SelfOutTypeTag\\:\\:withType\\(\\) should be covariant with return type \\(static\\(PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\)\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\:\\:withType\\(\\)$#"
232-
count: 1
233-
path: src/PhpDoc/Tag/SelfOutTypeTag.php
234-
235-
-
236-
message: "#^Return type \\(PHPStan\\\\PhpDoc\\\\Tag\\\\VarTag\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\VarTag\\:\\:withType\\(\\) should be covariant with return type \\(static\\(PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\)\\) of method PHPStan\\\\PhpDoc\\\\Tag\\\\TypedTag\\:\\:withType\\(\\)$#"
237-
count: 1
238-
path: src/PhpDoc/Tag/VarTag.php
239-
240215
-
241216
message: "#^Doing instanceof PHPStan\\\\Type\\\\ArrayType is error\\-prone and deprecated\\. Use Type\\:\\:isArray\\(\\) or Type\\:\\:getArrays\\(\\) instead\\.$#"
242217
count: 1

src/Analyser/Analyser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use function count;
1313
use function memory_get_peak_usage;
1414

15-
class Analyser
15+
final class Analyser
1616
{
1717

1818
public function __construct(

src/Analyser/AnalyserResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* @phpstan-import-type LinesToIgnore from FileAnalyserResult
1111
*/
12-
class AnalyserResult
12+
final class AnalyserResult
1313
{
1414

1515
/** @var list<Error>|null */

src/Analyser/AnalyserResultFinalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use function get_class;
1515
use function sprintf;
1616

17-
class AnalyserResultFinalizer
17+
final class AnalyserResultFinalizer
1818
{
1919

2020
public function __construct(

src/Analyser/ConditionalExpressionHolder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use function implode;
99
use function sprintf;
1010

11-
class ConditionalExpressionHolder
11+
final class ConditionalExpressionHolder
1212
{
1313

1414
/**

src/Analyser/ConstantResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use const NAN;
2626
use const PHP_INT_SIZE;
2727

28-
class ConstantResolver
28+
final class ConstantResolver
2929
{
3030

3131
/** @var array<string, true> */

src/Analyser/ConstantResolverFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PHPStan\DependencyInjection\Container;
66
use PHPStan\Reflection\ReflectionProvider\ReflectionProviderProvider;
77

8-
class ConstantResolverFactory
8+
final class ConstantResolverFactory
99
{
1010

1111
public function __construct(

src/Analyser/DirectInternalScopeFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use PHPStan\ShouldNotHappenException;
1818
use function is_a;
1919

20-
class DirectInternalScopeFactory implements InternalScopeFactory
20+
final class DirectInternalScopeFactory implements InternalScopeFactory
2121
{
2222

2323
/**

0 commit comments

Comments
 (0)