Skip to content

Commit 7acc50e

Browse files
authored
Merge pull request #10318 from danog/finalize
Finalize all internal classes
2 parents 41acef5 + ec23f99 commit 7acc50e

File tree

368 files changed

+370
-370
lines changed

Some content is hidden

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

368 files changed

+370
-370
lines changed

examples/TemplateChecker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
use function strtolower;
3131
use function trim;
3232

33-
class TemplateAnalyzer extends Psalm\Internal\Analyzer\FileAnalyzer
33+
final class TemplateAnalyzer extends Psalm\Internal\Analyzer\FileAnalyzer
3434
{
3535
const VIEW_CLASS = 'Your\\View\\Class';
3636

examples/TemplateScanner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use function preg_match;
1515
use function trim;
1616

17-
class TemplateScanner extends Psalm\Internal\Scanner\FileScanner
17+
final class TemplateScanner extends Psalm\Internal\Scanner\FileScanner
1818
{
1919
const VIEW_CLASS = 'Your\\View\\Class';
2020

examples/plugins/ClassUnqualifier.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use function strpos;
1313
use function strtolower;
1414

15-
class ClassUnqualifier implements AfterClassLikeExistenceCheckInterface
15+
final class ClassUnqualifier implements AfterClassLikeExistenceCheckInterface
1616
{
1717
public static function afterClassLikeExistenceCheck(
1818
AfterClassLikeExistenceCheckEvent $event

examples/plugins/FunctionCasingChecker.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Checks that functions and methods are correctly-cased
2323
*/
24-
class FunctionCasingChecker implements AfterFunctionCallAnalysisInterface, AfterMethodCallAnalysisInterface
24+
final class FunctionCasingChecker implements AfterFunctionCallAnalysisInterface, AfterMethodCallAnalysisInterface
2525
{
2626
public static function afterMethodCallAnalysis(AfterMethodCallAnalysisEvent $event): void
2727
{
@@ -99,6 +99,6 @@ public static function afterFunctionCallAnalysis(AfterFunctionCallAnalysisEvent
9999
}
100100
}
101101

102-
class IncorrectFunctionCasing extends PluginIssue
102+
final class IncorrectFunctionCasing extends PluginIssue
103103
{
104104
}

examples/plugins/InternalChecker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
use function strpos;
1414

15-
class InternalChecker implements AfterClassLikeAnalysisInterface
15+
final class InternalChecker implements AfterClassLikeAnalysisInterface
1616
{
1717
/** @return null|false */
1818
public static function afterStatementAnalysis(AfterClassLikeAnalysisEvent $event): ?bool

examples/plugins/PreventFloatAssignmentChecker.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/**
1313
* Prevents any assignment to a float value
1414
*/
15-
class PreventFloatAssignmentChecker implements AfterExpressionAnalysisInterface
15+
final class PreventFloatAssignmentChecker implements AfterExpressionAnalysisInterface
1616
{
1717
/**
1818
* Called after an expression has been checked
@@ -40,6 +40,6 @@ public static function afterExpressionAnalysis(AfterExpressionAnalysisEvent $eve
4040
}
4141
}
4242

43-
class NoFloatAssignment extends PluginIssue
43+
final class NoFloatAssignment extends PluginIssue
4444
{
4545
}

examples/plugins/SafeArrayKeyChecker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Psalm\Plugin\EventHandler\Event\AddRemoveTaintsEvent;
88
use Psalm\Plugin\EventHandler\RemoveTaintsInterface;
99

10-
class SafeArrayKeyChecker implements RemoveTaintsInterface
10+
final class SafeArrayKeyChecker implements RemoveTaintsInterface
1111
{
1212
/**
1313
* Called to see what taints should be removed

examples/plugins/StringChecker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use function strpos;
1717
use function strtolower;
1818

19-
class StringChecker implements AfterExpressionAnalysisInterface
19+
final class StringChecker implements AfterExpressionAnalysisInterface
2020
{
2121
/**
2222
* Called after an expression has been checked

examples/plugins/composer-based/echo-checker/EchoChecker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Psalm\Type\Atomic\TLiteralString;
1212
use Psalm\Type\Atomic\TString;
1313

14-
class EchoChecker implements AfterStatementAnalysisInterface
14+
final class EchoChecker implements AfterStatementAnalysisInterface
1515
{
1616
/**
1717
* Called after a statement has been checked

examples/plugins/composer-based/echo-checker/PluginEntryPoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Psalm\Plugin\RegistrationInterface;
77
use SimpleXMLElement;
88

9-
class PluginEntryPoint implements PluginEntryPointInterface
9+
final class PluginEntryPoint implements PluginEntryPointInterface
1010
{
1111
public function __invoke(RegistrationInterface $registration, ?SimpleXMLElement $config = null): void
1212
{

src/Psalm/Internal/Algebra.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* @internal
2626
*/
27-
class Algebra
27+
final class Algebra
2828
{
2929
/**
3030
* @param array<string, non-empty-list<non-empty-list<Assertion>>> $all_types

src/Psalm/Internal/Algebra/FormulaGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* @internal
2323
*/
24-
class FormulaGenerator
24+
final class FormulaGenerator
2525
{
2626
/**
2727
* @return list<Clause>

src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* @internal
2222
*/
23-
class AlgebraAnalyzer
23+
final class AlgebraAnalyzer
2424
{
2525
/**
2626
* This looks to see if there are any clauses in one formula that contradict

src/Psalm/Internal/Analyzer/AttributesAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* @internal
3535
*/
36-
class AttributesAnalyzer
36+
final class AttributesAnalyzer
3737
{
3838
private const TARGET_DESCRIPTIONS = [
3939
1 => 'class',

src/Psalm/Internal/Analyzer/ClassAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
/**
107107
* @internal
108108
*/
109-
class ClassAnalyzer extends ClassLikeAnalyzer
109+
final class ClassAnalyzer extends ClassLikeAnalyzer
110110
{
111111
/**
112112
* @var array<string, Union>

src/Psalm/Internal/Analyzer/ClassLikeNameOptions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @internal
77
*/
8-
class ClassLikeNameOptions
8+
final class ClassLikeNameOptions
99
{
1010
public bool $inferred;
1111

src/Psalm/Internal/Analyzer/ClosureAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @internal
2828
* @extends FunctionLikeAnalyzer<PhpParser\Node\Expr\Closure|PhpParser\Node\Expr\ArrowFunction>
2929
*/
30-
class ClosureAnalyzer extends FunctionLikeAnalyzer
30+
final class ClosureAnalyzer extends FunctionLikeAnalyzer
3131
{
3232
/**
3333
* @param PhpParser\Node\Expr\Closure|PhpParser\Node\Expr\ArrowFunction $function

src/Psalm/Internal/Analyzer/CommentAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
/**
4242
* @internal
4343
*/
44-
class CommentAnalyzer
44+
final class CommentAnalyzer
4545
{
4646
public const TYPE_REGEX = '(\??\\\?[\(\)A-Za-z0-9_&\<\.=,\>\[\]\-\{\}:|?\\\\]*|\$[a-zA-Z_0-9_]+)';
4747

src/Psalm/Internal/Analyzer/DataFlowNodeData.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @psalm-immutable
99
* @internal
1010
*/
11-
class DataFlowNodeData
11+
final class DataFlowNodeData
1212
{
1313
use ImmutableNonCloneableTrait;
1414

src/Psalm/Internal/Analyzer/FunctionAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @internal
1515
* @extends FunctionLikeAnalyzer<PhpParser\Node\Stmt\Function_>
1616
*/
17-
class FunctionAnalyzer extends FunctionLikeAnalyzer
17+
final class FunctionAnalyzer extends FunctionLikeAnalyzer
1818
{
1919
public function __construct(PhpParser\Node\Stmt\Function_ $function, SourceAnalyzer $source)
2020
{

src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
/**
6464
* @internal
6565
*/
66-
class ReturnTypeAnalyzer
66+
final class ReturnTypeAnalyzer
6767
{
6868
/**
6969
* @param Closure|Function_|ClassMethod|ArrowFunction $function

src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @internal
2626
*/
27-
class ReturnTypeCollector
27+
final class ReturnTypeCollector
2828
{
2929
/**
3030
* Gets the return types from a list of statements

src/Psalm/Internal/Analyzer/InterfaceAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* @internal
2727
*/
28-
class InterfaceAnalyzer extends ClassLikeAnalyzer
28+
final class InterfaceAnalyzer extends ClassLikeAnalyzer
2929
{
3030
public function __construct(
3131
PhpParser\Node\Stmt\Interface_ $interface,

src/Psalm/Internal/Analyzer/IssueData.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* @internal
1111
*/
12-
class IssueData
12+
final class IssueData
1313
{
1414
public const SEVERITY_INFO = 'info';
1515
public const SEVERITY_ERROR = 'error';

src/Psalm/Internal/Analyzer/MethodAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @internal
2828
* @extends FunctionLikeAnalyzer<PhpParser\Node\Stmt\ClassMethod>
2929
*/
30-
class MethodAnalyzer extends FunctionLikeAnalyzer
30+
final class MethodAnalyzer extends FunctionLikeAnalyzer
3131
{
3232
// https://github.com/php/php-src/blob/a83923044c48982c80804ae1b45e761c271966d3/Zend/zend_enum.c#L77-L95
3333
private const FORBIDDEN_ENUM_METHODS = [

src/Psalm/Internal/Analyzer/MethodComparator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
/**
4545
* @internal
4646
*/
47-
class MethodComparator
47+
final class MethodComparator
4848
{
4949
/**
5050
* @param string[] $suppressed_issues

src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* @internal
2525
*/
26-
class NamespaceAnalyzer extends SourceAnalyzer
26+
final class NamespaceAnalyzer extends SourceAnalyzer
2727
{
2828
use CanAlias;
2929

src/Psalm/Internal/Analyzer/ProjectAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
/**
9494
* @internal
9595
*/
96-
class ProjectAnalyzer
96+
final class ProjectAnalyzer
9797
{
9898
/**
9999
* Cached config

src/Psalm/Internal/Analyzer/ScopeAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* @internal
1919
*/
20-
class ScopeAnalyzer
20+
final class ScopeAnalyzer
2121
{
2222
public const ACTION_END = 'END';
2323
public const ACTION_BREAK = 'BREAK';

src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* @internal
3030
*/
31-
class DoAnalyzer
31+
final class DoAnalyzer
3232
{
3333
public static function analyze(
3434
StatementsAnalyzer $statements_analyzer,

src/Psalm/Internal/Analyzer/Statements/Block/ForAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* @internal
2121
*/
22-
class ForAnalyzer
22+
final class ForAnalyzer
2323
{
2424
/**
2525
* @return false|null

src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
/**
7575
* @internal
7676
*/
77-
class ForeachAnalyzer
77+
final class ForeachAnalyzer
7878
{
7979
/**
8080
* @return false|null

src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* @internal
3131
*/
32-
class IfConditionalAnalyzer
32+
final class IfConditionalAnalyzer
3333
{
3434
public static function analyze(
3535
StatementsAnalyzer $statements_analyzer,

src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* @internal
2828
*/
29-
class ElseAnalyzer
29+
final class ElseAnalyzer
3030
{
3131
/**
3232
* @return false|null

src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/**
4141
* @internal
4242
*/
43-
class ElseIfAnalyzer
43+
final class ElseIfAnalyzer
4444
{
4545
/**
4646
* @return false|null

src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/**
4747
* @internal
4848
*/
49-
class IfAnalyzer
49+
final class IfAnalyzer
5050
{
5151
/**
5252
* @param array<string, Union> $pre_assignment_else_redefined_vars

src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
/**
4242
* @internal
4343
*/
44-
class IfElseAnalyzer
44+
final class IfElseAnalyzer
4545
{
4646
/**
4747
* System of type substitution and deletion

src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* @internal
3030
*/
31-
class LoopAnalyzer
31+
final class LoopAnalyzer
3232
{
3333
/**
3434
* Checks an array of statements in a loop

src/Psalm/Internal/Analyzer/Statements/Block/SwitchAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* @internal
2323
*/
24-
class SwitchAnalyzer
24+
final class SwitchAnalyzer
2525
{
2626
public static function analyze(
2727
StatementsAnalyzer $statements_analyzer,

src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
/**
5454
* @internal
5555
*/
56-
class SwitchCaseAnalyzer
56+
final class SwitchCaseAnalyzer
5757
{
5858
/**
5959
* @return null|false

src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* @internal
3131
*/
32-
class TryAnalyzer
32+
final class TryAnalyzer
3333
{
3434
/**
3535
* @return false|null

src/Psalm/Internal/Analyzer/Statements/Block/WhileAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* @internal
1818
*/
19-
class WhileAnalyzer
19+
final class WhileAnalyzer
2020
{
2121
/**
2222
* @return false|null

0 commit comments

Comments
 (0)