From 7503f23b4c64a2d53d8d64963b8c78e72164443b Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Wed, 26 Jan 2022 02:24:32 +0200 Subject: [PATCH 1/2] Lock event classes This makes all event (`Psalm\Plugin\EventHandler\Event\*`) classes `final`, allowing us to add methods to them without breaking BC. Additionally all constructors of those classes are made `@internal` as plugins are not supposed to emit events. --- src/Psalm/Plugin/EventHandler/Event/AddRemoveTaintsEvent.php | 3 ++- src/Psalm/Plugin/EventHandler/Event/AfterAnalysisEvent.php | 3 ++- .../Plugin/EventHandler/Event/AfterClassLikeAnalysisEvent.php | 3 ++- .../EventHandler/Event/AfterClassLikeExistenceCheckEvent.php | 3 ++- .../Plugin/EventHandler/Event/AfterClassLikeVisitEvent.php | 3 ++- .../Plugin/EventHandler/Event/AfterCodebasePopulatedEvent.php | 3 ++- .../Event/AfterEveryFunctionCallAnalysisEvent.php | 3 ++- .../EventHandler/Event/AfterExpressionAnalysisEvent.php | 3 ++- .../Plugin/EventHandler/Event/AfterFileAnalysisEvent.php | 3 ++- .../EventHandler/Event/AfterFunctionCallAnalysisEvent.php | 3 ++- .../EventHandler/Event/AfterFunctionLikeAnalysisEvent.php | 3 ++- .../EventHandler/Event/AfterMethodCallAnalysisEvent.php | 3 ++- .../Plugin/EventHandler/Event/AfterStatementAnalysisEvent.php | 3 ++- .../Plugin/EventHandler/Event/BeforeFileAnalysisEvent.php | 3 ++- .../EventHandler/Event/FunctionExistenceProviderEvent.php | 4 +++- .../Plugin/EventHandler/Event/FunctionParamsProviderEvent.php | 3 ++- .../EventHandler/Event/FunctionReturnTypeProviderEvent.php | 3 ++- .../EventHandler/Event/MethodExistenceProviderEvent.php | 4 +++- .../Plugin/EventHandler/Event/MethodParamsProviderEvent.php | 3 ++- .../EventHandler/Event/MethodReturnTypeProviderEvent.php | 4 +++- .../EventHandler/Event/MethodVisibilityProviderEvent.php | 3 ++- .../EventHandler/Event/PropertyExistenceProviderEvent.php | 3 ++- .../Plugin/EventHandler/Event/PropertyTypeProviderEvent.php | 3 ++- .../EventHandler/Event/PropertyVisibilityProviderEvent.php | 3 ++- .../Plugin/EventHandler/Event/StringInterpreterEvent.php | 4 +++- 25 files changed, 54 insertions(+), 25 deletions(-) diff --git a/src/Psalm/Plugin/EventHandler/Event/AddRemoveTaintsEvent.php b/src/Psalm/Plugin/EventHandler/Event/AddRemoveTaintsEvent.php index 5363179ff1a..6199ade0063 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AddRemoveTaintsEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AddRemoveTaintsEvent.php @@ -7,7 +7,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class AddRemoveTaintsEvent +final class AddRemoveTaintsEvent { /** * @var Expr @@ -28,6 +28,7 @@ class AddRemoveTaintsEvent /** * Called after an expression has been checked + * @internal */ public function __construct( Expr $expr, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterAnalysisEvent.php index b90e349aa07..f38d87e98d3 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterAnalysisEvent.php @@ -6,7 +6,7 @@ use Psalm\Internal\Analyzer\IssueData; use Psalm\SourceControl\SourceControlInfo; -class AfterAnalysisEvent +final class AfterAnalysisEvent { /** * @var Codebase @@ -29,6 +29,7 @@ class AfterAnalysisEvent * Called after analysis is complete * * @param array> $issues + * @internal */ public function __construct( Codebase $codebase, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeAnalysisEvent.php index f74e9dbd491..bf71348640e 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeAnalysisEvent.php @@ -8,7 +8,7 @@ use Psalm\StatementsSource; use Psalm\Storage\ClassLikeStorage; -class AfterClassLikeAnalysisEvent +final class AfterClassLikeAnalysisEvent { /** * @var Node\Stmt\ClassLike @@ -35,6 +35,7 @@ class AfterClassLikeAnalysisEvent * Called after a statement has been checked * * @param FileManipulation[] $file_replacements + * @internal */ public function __construct( Node\Stmt\ClassLike $stmt, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeExistenceCheckEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeExistenceCheckEvent.php index d86201415aa..f5e86112b32 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeExistenceCheckEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeExistenceCheckEvent.php @@ -7,7 +7,7 @@ use Psalm\FileManipulation; use Psalm\StatementsSource; -class AfterClassLikeExistenceCheckEvent +final class AfterClassLikeExistenceCheckEvent { /** * @var string @@ -32,6 +32,7 @@ class AfterClassLikeExistenceCheckEvent /** * @param FileManipulation[] $file_replacements + * @internal */ public function __construct( string $fq_class_name, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeVisitEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeVisitEvent.php index 206b0b445cc..bd61be0783c 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeVisitEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterClassLikeVisitEvent.php @@ -8,7 +8,7 @@ use Psalm\FileSource; use Psalm\Storage\ClassLikeStorage; -class AfterClassLikeVisitEvent +final class AfterClassLikeVisitEvent { /** * @var ClassLike @@ -33,6 +33,7 @@ class AfterClassLikeVisitEvent /** * @param FileManipulation[] $file_replacements + * @internal */ public function __construct( ClassLike $stmt, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterCodebasePopulatedEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterCodebasePopulatedEvent.php index 6d2d91afa68..53df3472fde 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterCodebasePopulatedEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterCodebasePopulatedEvent.php @@ -4,7 +4,7 @@ use Psalm\Codebase; -class AfterCodebasePopulatedEvent +final class AfterCodebasePopulatedEvent { /** * @var Codebase @@ -13,6 +13,7 @@ class AfterCodebasePopulatedEvent /** * Called after codebase has been populated + * @internal */ public function __construct(Codebase $codebase) { diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterEveryFunctionCallAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterEveryFunctionCallAnalysisEvent.php index 92d5717e7e8..9248a107845 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterEveryFunctionCallAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterEveryFunctionCallAnalysisEvent.php @@ -7,7 +7,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class AfterEveryFunctionCallAnalysisEvent +final class AfterEveryFunctionCallAnalysisEvent { /** * @var FuncCall @@ -30,6 +30,7 @@ class AfterEveryFunctionCallAnalysisEvent */ private $codebase; + /** @internal */ public function __construct( FuncCall $expr, string $function_id, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterExpressionAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterExpressionAnalysisEvent.php index 3f21097fa00..9bb5f136dcb 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterExpressionAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterExpressionAnalysisEvent.php @@ -8,7 +8,7 @@ use Psalm\FileManipulation; use Psalm\StatementsSource; -class AfterExpressionAnalysisEvent +final class AfterExpressionAnalysisEvent { /** * @var Expr @@ -35,6 +35,7 @@ class AfterExpressionAnalysisEvent * Called after an expression has been checked * * @param FileManipulation[] $file_replacements + * @internal */ public function __construct( Expr $expr, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterFileAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterFileAnalysisEvent.php index 65027e6fd2f..a1a2eb7dd1d 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterFileAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterFileAnalysisEvent.php @@ -8,7 +8,7 @@ use Psalm\StatementsSource; use Psalm\Storage\FileStorage; -class AfterFileAnalysisEvent +final class AfterFileAnalysisEvent { /** * @var StatementsSource @@ -35,6 +35,7 @@ class AfterFileAnalysisEvent * Called after a file has been checked * * @param array $stmts + * @internal */ public function __construct( StatementsSource $statements_source, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterFunctionCallAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterFunctionCallAnalysisEvent.php index caa0576b28a..4855c19f8b9 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterFunctionCallAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterFunctionCallAnalysisEvent.php @@ -9,7 +9,7 @@ use Psalm\StatementsSource; use Psalm\Type\Union; -class AfterFunctionCallAnalysisEvent +final class AfterFunctionCallAnalysisEvent { /** * @var FuncCall @@ -43,6 +43,7 @@ class AfterFunctionCallAnalysisEvent /** * @param non-empty-string $function_id * @param FileManipulation[] $file_replacements + * @internal */ public function __construct( FuncCall $expr, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterFunctionLikeAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterFunctionLikeAnalysisEvent.php index 792da7a8eca..1463b81f22e 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterFunctionLikeAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterFunctionLikeAnalysisEvent.php @@ -10,7 +10,7 @@ use Psalm\StatementsSource; use Psalm\Storage\FunctionLikeStorage; -class AfterFunctionLikeAnalysisEvent +final class AfterFunctionLikeAnalysisEvent { /** * @var Node\FunctionLike @@ -45,6 +45,7 @@ class AfterFunctionLikeAnalysisEvent * Called after a statement has been checked * * @param FileManipulation[] $file_replacements + * @internal */ public function __construct( Node\FunctionLike $stmt, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterMethodCallAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterMethodCallAnalysisEvent.php index ea60ffa82b9..0a15219650e 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterMethodCallAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterMethodCallAnalysisEvent.php @@ -11,7 +11,7 @@ use Psalm\StatementsSource; use Psalm\Type\Union; -class AfterMethodCallAnalysisEvent +final class AfterMethodCallAnalysisEvent { /** * @var MethodCall|StaticCall @@ -53,6 +53,7 @@ class AfterMethodCallAnalysisEvent /** * @param MethodCall|StaticCall $expr * @param FileManipulation[] $file_replacements + * @internal */ public function __construct( Expr $expr, diff --git a/src/Psalm/Plugin/EventHandler/Event/AfterStatementAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/AfterStatementAnalysisEvent.php index ff3f204d408..6dcdc50de8a 100644 --- a/src/Psalm/Plugin/EventHandler/Event/AfterStatementAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/AfterStatementAnalysisEvent.php @@ -8,7 +8,7 @@ use Psalm\FileManipulation; use Psalm\StatementsSource; -class AfterStatementAnalysisEvent +final class AfterStatementAnalysisEvent { /** * @var Stmt @@ -35,6 +35,7 @@ class AfterStatementAnalysisEvent * Called after a statement has been checked * * @param FileManipulation[] $file_replacements + * @internal */ public function __construct( Stmt $stmt, diff --git a/src/Psalm/Plugin/EventHandler/Event/BeforeFileAnalysisEvent.php b/src/Psalm/Plugin/EventHandler/Event/BeforeFileAnalysisEvent.php index c11f317fa4a..f8fa106680a 100644 --- a/src/Psalm/Plugin/EventHandler/Event/BeforeFileAnalysisEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/BeforeFileAnalysisEvent.php @@ -7,7 +7,7 @@ use Psalm\StatementsSource; use Psalm\Storage\FileStorage; -class BeforeFileAnalysisEvent +final class BeforeFileAnalysisEvent { /** * @var StatementsSource @@ -28,6 +28,7 @@ class BeforeFileAnalysisEvent /** * Called before a file has been checked + * @internal */ public function __construct( StatementsSource $statements_source, diff --git a/src/Psalm/Plugin/EventHandler/Event/FunctionExistenceProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/FunctionExistenceProviderEvent.php index 48a9ee530f0..04f01b12d40 100644 --- a/src/Psalm/Plugin/EventHandler/Event/FunctionExistenceProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/FunctionExistenceProviderEvent.php @@ -4,7 +4,7 @@ use Psalm\StatementsSource; -class FunctionExistenceProviderEvent +final class FunctionExistenceProviderEvent { /** * @var StatementsSource @@ -19,6 +19,8 @@ class FunctionExistenceProviderEvent * Use this hook for informing whether or not a global function exists. If you know the function does * not exist, return false. If you aren't sure if it exists or not, return null and the default analysis * will continue to determine if the function actually exists. + * + * @internal */ public function __construct( StatementsSource $statements_source, diff --git a/src/Psalm/Plugin/EventHandler/Event/FunctionParamsProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/FunctionParamsProviderEvent.php index a623e697083..3957713b173 100644 --- a/src/Psalm/Plugin/EventHandler/Event/FunctionParamsProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/FunctionParamsProviderEvent.php @@ -7,7 +7,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class FunctionParamsProviderEvent +final class FunctionParamsProviderEvent { /** * @var StatementsSource @@ -32,6 +32,7 @@ class FunctionParamsProviderEvent /** * @param list $call_args + * @internal */ public function __construct( StatementsSource $statements_source, diff --git a/src/Psalm/Plugin/EventHandler/Event/FunctionReturnTypeProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/FunctionReturnTypeProviderEvent.php index e686fafdab1..61d749c3fc3 100644 --- a/src/Psalm/Plugin/EventHandler/Event/FunctionReturnTypeProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/FunctionReturnTypeProviderEvent.php @@ -7,7 +7,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class FunctionReturnTypeProviderEvent +final class FunctionReturnTypeProviderEvent { /** * @var StatementsSource @@ -36,6 +36,7 @@ class FunctionReturnTypeProviderEvent * if something should be returned, but can't be more specific. * * @param non-empty-string $function_id + * @internal */ public function __construct( StatementsSource $statements_source, diff --git a/src/Psalm/Plugin/EventHandler/Event/MethodExistenceProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/MethodExistenceProviderEvent.php index 3ca5acc931e..6941df52a53 100644 --- a/src/Psalm/Plugin/EventHandler/Event/MethodExistenceProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/MethodExistenceProviderEvent.php @@ -5,7 +5,7 @@ use Psalm\CodeLocation; use Psalm\StatementsSource; -class MethodExistenceProviderEvent +final class MethodExistenceProviderEvent { /** * @var string @@ -28,6 +28,8 @@ class MethodExistenceProviderEvent * Use this hook for informing whether or not a method exists on a given object. If you know the method does * not exist, return false. If you aren't sure if it exists or not, return null and the default analysis will * continue to determine if the method actually exists. + * + * @internal */ public function __construct( string $fq_classlike_name, diff --git a/src/Psalm/Plugin/EventHandler/Event/MethodParamsProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/MethodParamsProviderEvent.php index d974e4f598e..a0f38c2ff74 100644 --- a/src/Psalm/Plugin/EventHandler/Event/MethodParamsProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/MethodParamsProviderEvent.php @@ -7,7 +7,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class MethodParamsProviderEvent +final class MethodParamsProviderEvent { /** * @var string @@ -36,6 +36,7 @@ class MethodParamsProviderEvent /** * @param list $call_args + * @internal */ public function __construct( string $fq_classlike_name, diff --git a/src/Psalm/Plugin/EventHandler/Event/MethodReturnTypeProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/MethodReturnTypeProviderEvent.php index 52ab51e326a..12fdc590f27 100644 --- a/src/Psalm/Plugin/EventHandler/Event/MethodReturnTypeProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/MethodReturnTypeProviderEvent.php @@ -8,7 +8,7 @@ use Psalm\StatementsSource; use Psalm\Type\Union; -class MethodReturnTypeProviderEvent +final class MethodReturnTypeProviderEvent { /** * @var StatementsSource @@ -56,6 +56,8 @@ class MethodReturnTypeProviderEvent * @param ?array $template_type_parameters * @param lowercase-string $method_name_lowercase * @param lowercase-string $called_method_name_lowercase + * + * @internal */ public function __construct( StatementsSource $source, diff --git a/src/Psalm/Plugin/EventHandler/Event/MethodVisibilityProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/MethodVisibilityProviderEvent.php index 90ceb7d36be..22896110f19 100644 --- a/src/Psalm/Plugin/EventHandler/Event/MethodVisibilityProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/MethodVisibilityProviderEvent.php @@ -6,7 +6,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class MethodVisibilityProviderEvent +final class MethodVisibilityProviderEvent { /** * @var StatementsSource @@ -29,6 +29,7 @@ class MethodVisibilityProviderEvent */ private $code_location; + /** @internal */ public function __construct( StatementsSource $source, string $fq_classlike_name, diff --git a/src/Psalm/Plugin/EventHandler/Event/PropertyExistenceProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/PropertyExistenceProviderEvent.php index 5cb98d5e72c..b61d5f093cd 100644 --- a/src/Psalm/Plugin/EventHandler/Event/PropertyExistenceProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/PropertyExistenceProviderEvent.php @@ -6,7 +6,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class PropertyExistenceProviderEvent +final class PropertyExistenceProviderEvent { /** * @var string @@ -38,6 +38,7 @@ class PropertyExistenceProviderEvent * not exist, return false. If you aren't sure if it exists or not, return null and the default analysis will * continue to determine if the property actually exists. * + * @internal */ public function __construct( string $fq_classlike_name, diff --git a/src/Psalm/Plugin/EventHandler/Event/PropertyTypeProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/PropertyTypeProviderEvent.php index 65e91e22300..da9b31700cd 100644 --- a/src/Psalm/Plugin/EventHandler/Event/PropertyTypeProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/PropertyTypeProviderEvent.php @@ -5,7 +5,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class PropertyTypeProviderEvent +final class PropertyTypeProviderEvent { /** * @var string @@ -28,6 +28,7 @@ class PropertyTypeProviderEvent */ private $context; + /** @internal */ public function __construct( string $fq_classlike_name, string $property_name, diff --git a/src/Psalm/Plugin/EventHandler/Event/PropertyVisibilityProviderEvent.php b/src/Psalm/Plugin/EventHandler/Event/PropertyVisibilityProviderEvent.php index 78ef4b5787a..8d934d9f58b 100644 --- a/src/Psalm/Plugin/EventHandler/Event/PropertyVisibilityProviderEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/PropertyVisibilityProviderEvent.php @@ -6,7 +6,7 @@ use Psalm\Context; use Psalm\StatementsSource; -class PropertyVisibilityProviderEvent +final class PropertyVisibilityProviderEvent { /** * @var StatementsSource @@ -33,6 +33,7 @@ class PropertyVisibilityProviderEvent */ private $code_location; + /** @internal */ public function __construct( StatementsSource $source, string $fq_classlike_name, diff --git a/src/Psalm/Plugin/EventHandler/Event/StringInterpreterEvent.php b/src/Psalm/Plugin/EventHandler/Event/StringInterpreterEvent.php index c92d244295b..1f39a9d398e 100644 --- a/src/Psalm/Plugin/EventHandler/Event/StringInterpreterEvent.php +++ b/src/Psalm/Plugin/EventHandler/Event/StringInterpreterEvent.php @@ -2,7 +2,7 @@ namespace Psalm\Plugin\EventHandler\Event; -class StringInterpreterEvent +final class StringInterpreterEvent { /** * @var string @@ -11,6 +11,8 @@ class StringInterpreterEvent /** * Called after a statement has been checked + * + * @internal */ public function __construct(string $value) { From 1a15db89cc0ba770f5ecc01f3b9eda28235394e9 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Wed, 26 Jan 2022 13:25:27 +0200 Subject: [PATCH 2/2] Update UPGRADING.md --- UPGRADING.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/UPGRADING.md b/UPGRADING.md index 5656531a48b..02fe6e60911 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -122,6 +122,32 @@ - [BC] Method `Psalm\Type\Union::hasFormerStaticObject()` was renamed to `hasStaticObject()` - [BC] Function assertions (from `@psalm-assert Foo $bar`) have been converted from strings to specific `Assertion` objects. - [BC] Property `Psalm\Storage\ClassLikeStorage::$invalid_dependencies` changed from `array` to `array`. +- [BC] Event classes became final and their constructors were marked `@internal`: + - `Psalm\Plugin\EventHandler\Event\AddRemoveTaintsEvent` + - `Psalm\Plugin\EventHandler\Event\AfterAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\AfterClassLikeAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\AfterClassLikeExistenceCheckEvent` + - `Psalm\Plugin\EventHandler\Event\AfterClassLikeVisitEvent` + - `Psalm\Plugin\EventHandler\Event\AfterCodebasePopulatedEvent` + - `Psalm\Plugin\EventHandler\Event\AfterEveryFunctionCallAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\AfterExpressionAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\AfterFileAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\AfterFunctionCallAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\AfterFunctionLikeAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\AfterMethodCallAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\AfterStatementAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\BeforeFileAnalysisEvent` + - `Psalm\Plugin\EventHandler\Event\FunctionExistenceProviderEvent` + - `Psalm\Plugin\EventHandler\Event\FunctionParamsProviderEvent` + - `Psalm\Plugin\EventHandler\Event\FunctionReturnTypeProviderEvent` + - `Psalm\Plugin\EventHandler\Event\MethodExistenceProviderEvent` + - `Psalm\Plugin\EventHandler\Event\MethodParamsProviderEvent` + - `Psalm\Plugin\EventHandler\Event\MethodReturnTypeProviderEvent` + - `Psalm\Plugin\EventHandler\Event\MethodVisibilityProviderEvent` + - `Psalm\Plugin\EventHandler\Event\PropertyExistenceProviderEvent` + - `Psalm\Plugin\EventHandler\Event\PropertyTypeProviderEvent` + - `Psalm\Plugin\EventHandler\Event\PropertyVisibilityProviderEvent` + - `Psalm\Plugin\EventHandler\Event\StringInterpreterEvent` ## Removed - [BC] Property `Psalm\Codebase::$php_major_version` was removed, use