Skip to content

Commit 63d0026

Browse files
committed
Classes that were previously @final were made final
1 parent 5651bec commit 63d0026

File tree

103 files changed

+102
-205
lines changed

Some content is hidden

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

103 files changed

+102
-205
lines changed

Diff for: UPGRADING.md

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ As a replacement you can implement [`PHPStan\Type\ExpressionTypeResolverExtensio
216216

217217
### Minor backward compatibility breaks
218218

219+
* Classes that were previously `@final` were made `final`
219220
* Parameter `$callableParameters` of [`MutatingScope::enterAnonymousFunction()`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.MutatingScope.html#_enterAnonymousFunction) and [`enterArrowFunction()`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.MutatingScope.html#_enterArrowFunction) made required
220221
* Parameter `StatementContext $context` of [`NodeScopeResolver::processStmtNodes()`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.NodeScopeResolver.html#_processStmtNodes) made required
221222
* ClassPropertiesNode - remove `$extensions` parameter from [`getUninitializedProperties()`](https://apiref.phpstan.org/2.0.x/PHPStan.Node.ClassPropertiesNode.html#_getUninitializedProperties)

Diff for: src/Analyser/Error.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414

1515
/**
1616
* @api
17-
* @final
1817
*/
19-
class Error implements JsonSerializable
18+
final class Error implements JsonSerializable
2019
{
2120

2221
public const PATTERN_IDENTIFIER = '[a-zA-Z0-9](?:[a-zA-Z0-9\\.]*[a-zA-Z0-9])?';

Diff for: src/Analyser/ImpurePoint.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
/**
99
* @phpstan-type ImpurePointIdentifier = 'echo'|'die'|'exit'|'propertyAssign'|'propertyAssignByRef'|'propertyUnset'|'methodCall'|'new'|'functionCall'|'include'|'require'|'print'|'eval'|'superglobal'|'yield'|'yieldFrom'|'static'|'global'|'betweenPhpTags'
1010
* @api
11-
* @final
1211
*/
13-
class ImpurePoint
12+
final class ImpurePoint
1413
{
1514

1615
/**

Diff for: src/Analyser/InternalError.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010

1111
/**
1212
* @api
13-
* @final
1413
* @phpstan-type Trace = list<array{file: string|null, line: int|null}>
1514
*/
16-
class InternalError implements JsonSerializable
15+
final class InternalError implements JsonSerializable
1716
{
1817

1918
public const STACK_TRACE_METADATA_KEY = 'stackTrace';

Diff for: src/Analyser/NameScope.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919
/**
2020
* @api
21-
* @final
2221
*/
23-
class NameScope
22+
final class NameScope
2423
{
2524

2625
private TemplateTypeMap $templateTypeMap;

Diff for: src/Analyser/ScopeFactory.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
/**
66
* @api
7-
* @final
87
*/
9-
class ScopeFactory
8+
final class ScopeFactory
109
{
1110

1211
public function __construct(private InternalScopeFactory $internalScopeFactory)

Diff for: src/Analyser/StatementExitPoint.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
/**
88
* @api
9-
* @final
109
*/
11-
class StatementExitPoint
10+
final class StatementExitPoint
1211
{
1312

1413
public function __construct(private Stmt $statement, private MutatingScope $scope)

Diff for: src/Analyser/StatementResult.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
/**
99
* @api
10-
* @final
1110
*/
12-
class StatementResult
11+
final class StatementResult
1312
{
1413

1514
/**

Diff for: src/Analyser/ThrowPoint.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
/**
1212
* @api
13-
* @final
1413
*/
15-
class ThrowPoint
14+
final class ThrowPoint
1615
{
1716

1817
/**

Diff for: src/Analyser/TypeSpecifierContext.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
/**
88
* @api
9-
* @final
109
*/
11-
class TypeSpecifierContext
10+
final class TypeSpecifierContext
1211
{
1312

1413
public const CONTEXT_TRUE = 0b0001;

Diff for: src/Broker/Broker.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
/**
1515
* @api
16-
* @final
1716
*/
18-
class Broker implements ReflectionProvider
17+
final class Broker implements ReflectionProvider
1918
{
2019

2120
private static ?Broker $instance = null;

Diff for: src/Collectors/CollectedData.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
/**
1010
* @api
11-
* @final
1211
*/
13-
class CollectedData implements JsonSerializable
12+
final class CollectedData implements JsonSerializable
1413
{
1514

1615
/**

Diff for: src/Command/AnalysisResult.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
/**
1313
* @api
14-
* @final
1514
*/
16-
class AnalysisResult
15+
final class AnalysisResult
1716
{
1817

1918
/** @var list<Error> sorted by their file name, line number and message */

Diff for: src/Command/ErrorFormatter/CiDetectedErrorFormatter.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
/**
1111
* @api
12-
* @final
1312
*/
14-
class CiDetectedErrorFormatter implements ErrorFormatter
13+
final class CiDetectedErrorFormatter implements ErrorFormatter
1514
{
1615

1716
public function __construct(

Diff for: src/DependencyInjection/ContainerFactory.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@
5555

5656
/**
5757
* @api
58-
* @final
5958
*/
60-
class ContainerFactory
59+
final class ContainerFactory
6160
{
6261

6362
private FileHelper $fileHelper;

Diff for: src/Node/BooleanAndNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
/**
1111
* @api
12-
* @final
1312
*/
14-
class BooleanAndNode extends Expr implements VirtualNode
13+
final class BooleanAndNode extends Expr implements VirtualNode
1514
{
1615

1716
public function __construct(private BooleanAnd|LogicalAnd $originalNode, private Scope $rightScope)

Diff for: src/Node/BooleanOrNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
/**
1111
* @api
12-
* @final
1312
*/
14-
class BooleanOrNode extends Expr implements VirtualNode
13+
final class BooleanOrNode extends Expr implements VirtualNode
1514
{
1615

1716
public function __construct(private BooleanOr|LogicalOr $originalNode, private Scope $rightScope)

Diff for: src/Node/BreaklessWhileLoopNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
/**
1010
* @api
11-
* @final
1211
*/
13-
class BreaklessWhileLoopNode extends NodeAbstract implements VirtualNode
12+
final class BreaklessWhileLoopNode extends NodeAbstract implements VirtualNode
1413
{
1514

1615
/**

Diff for: src/Node/CatchWithUnthrownExceptionNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
/**
1010
* @api
11-
* @final
1211
*/
13-
class CatchWithUnthrownExceptionNode extends NodeAbstract implements VirtualNode
12+
final class CatchWithUnthrownExceptionNode extends NodeAbstract implements VirtualNode
1413
{
1514

1615
public function __construct(private Catch_ $originalNode, private Type $caughtType, private Type $originalCaughtType)

Diff for: src/Node/ClassConstantsNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
/**
1212
* @api
13-
* @final
1413
*/
15-
class ClassConstantsNode extends NodeAbstract implements VirtualNode
14+
final class ClassConstantsNode extends NodeAbstract implements VirtualNode
1615
{
1716

1817
/**

Diff for: src/Node/ClassMethod.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
/**
88
* @api
9-
* @final
109
*/
11-
class ClassMethod extends PhpParserClassMethod
10+
final class ClassMethod extends PhpParserClassMethod
1211
{
1312

1413
public function __construct(

Diff for: src/Node/ClassMethodsNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
/**
1111
* @api
12-
* @final
1312
*/
14-
class ClassMethodsNode extends NodeAbstract implements VirtualNode
13+
final class ClassMethodsNode extends NodeAbstract implements VirtualNode
1514
{
1615

1716
/**

Diff for: src/Node/ClassPropertiesNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030

3131
/**
3232
* @api
33-
* @final
3433
*/
35-
class ClassPropertiesNode extends NodeAbstract implements VirtualNode
34+
final class ClassPropertiesNode extends NodeAbstract implements VirtualNode
3635
{
3736

3837
/**

Diff for: src/Node/ClassPropertyNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
/**
1515
* @api
16-
* @final
1716
*/
18-
class ClassPropertyNode extends NodeAbstract implements VirtualNode
17+
final class ClassPropertyNode extends NodeAbstract implements VirtualNode
1918
{
2019

2120
public function __construct(

Diff for: src/Node/ClosureReturnStatementsNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
/**
1515
* @api
16-
* @final
1716
*/
18-
class ClosureReturnStatementsNode extends NodeAbstract implements ReturnStatementsNode
17+
final class ClosureReturnStatementsNode extends NodeAbstract implements ReturnStatementsNode
1918
{
2019

2120
private Node\Expr\Closure $closureExpr;

Diff for: src/Node/CollectedDataNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
/**
1212
* @api
13-
* @final
1413
*/
15-
class CollectedDataNode extends NodeAbstract implements VirtualNode
14+
final class CollectedDataNode extends NodeAbstract implements VirtualNode
1615
{
1716

1817
/**

Diff for: src/Node/Constant/ClassConstantFetch.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
/**
99
* @api
10-
* @final
1110
*/
12-
class ClassConstantFetch
11+
final class ClassConstantFetch
1312
{
1413

1514
public function __construct(private ClassConstFetch $node, private Scope $scope)

Diff for: src/Node/ExecutionEndNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
/**
1010
* @api
11-
* @final
1211
*/
13-
class ExecutionEndNode extends NodeAbstract implements VirtualNode
12+
final class ExecutionEndNode extends NodeAbstract implements VirtualNode
1413
{
1514

1615
public function __construct(

Diff for: src/Node/FileNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
/**
99
* @api
10-
* @final
1110
*/
12-
class FileNode extends NodeAbstract implements VirtualNode
11+
final class FileNode extends NodeAbstract implements VirtualNode
1312
{
1413

1514
/**

Diff for: src/Node/FinallyExitPointsNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
/**
99
* @api
10-
* @final
1110
*/
12-
class FinallyExitPointsNode extends NodeAbstract implements VirtualNode
11+
final class FinallyExitPointsNode extends NodeAbstract implements VirtualNode
1312
{
1413

1514
/**

Diff for: src/Node/FunctionCallableNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
/**
99
* @api
10-
* @final
1110
*/
12-
class FunctionCallableNode extends Expr implements VirtualNode
11+
final class FunctionCallableNode extends Expr implements VirtualNode
1312
{
1413

1514
public function __construct(private Name|Expr $name, private Expr\FuncCall $originalNode)

Diff for: src/Node/FunctionReturnStatementsNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414

1515
/**
1616
* @api
17-
* @final
1817
*/
19-
class FunctionReturnStatementsNode extends NodeAbstract implements ReturnStatementsNode
18+
final class FunctionReturnStatementsNode extends NodeAbstract implements ReturnStatementsNode
2019
{
2120

2221
/**

Diff for: src/Node/InArrowFunctionNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
/**
1111
* @api
12-
* @final
1312
*/
14-
class InArrowFunctionNode extends NodeAbstract implements VirtualNode
13+
final class InArrowFunctionNode extends NodeAbstract implements VirtualNode
1514
{
1615

1716
private Node\Expr\ArrowFunction $originalNode;

Diff for: src/Node/InClassMethodNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
/**
1010
* @api
11-
* @final
1211
*/
13-
class InClassMethodNode extends Node\Stmt implements VirtualNode
12+
final class InClassMethodNode extends Node\Stmt implements VirtualNode
1413
{
1514

1615
public function __construct(

Diff for: src/Node/InClassNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
/**
1010
* @api
11-
* @final
1211
*/
13-
class InClassNode extends Node\Stmt implements VirtualNode
12+
final class InClassNode extends Node\Stmt implements VirtualNode
1413
{
1514

1615
public function __construct(private ClassLike $originalNode, private ClassReflection $classReflection)

Diff for: src/Node/InClosureNode.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
/**
1111
* @api
12-
* @final
1312
*/
14-
class InClosureNode extends NodeAbstract implements VirtualNode
13+
final class InClosureNode extends NodeAbstract implements VirtualNode
1514
{
1615

1716
private Node\Expr\Closure $originalNode;

0 commit comments

Comments
 (0)