From 3e837cabd047e3508543378d291094826f0772e8 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Fri, 4 Feb 2022 04:51:18 +0200 Subject: [PATCH 1/2] Finalize (and internalize) more classes --- src/Psalm/Aliases.php | 3 ++- src/Psalm/Codebase.php | 3 ++- src/Psalm/Config.php | 1 + src/Psalm/Config/Creator.php | 3 ++- src/Psalm/Config/ErrorLevelFileFilter.php | 3 ++- src/Psalm/Config/IssueHandler.php | 3 ++- src/Psalm/Config/ProjectFileFilter.php | 3 ++- src/Psalm/Config/TaintAnalysisFileFilter.php | 3 ++- src/Psalm/Context.php | 3 ++- src/Psalm/DocComment.php | 2 +- src/Psalm/ErrorBaseline.php | 2 +- src/Psalm/Exception/CircularReferenceException.php | 2 +- src/Psalm/Exception/CodeException.php | 2 +- src/Psalm/Exception/ComplicatedExpressionException.php | 2 +- src/Psalm/Exception/ConfigCreationException.php | 2 +- src/Psalm/Exception/ConfigNotFoundException.php | 2 +- src/Psalm/Exception/FileIncludeException.php | 2 +- src/Psalm/Exception/IncorrectDocblockException.php | 2 +- src/Psalm/Exception/InvalidClasslikeOverrideException.php | 2 +- src/Psalm/Exception/InvalidMethodOverrideException.php | 2 +- src/Psalm/Exception/RefactorException.php | 2 +- src/Psalm/Exception/ScopeAnalysisException.php | 2 +- src/Psalm/Exception/TypeParseTreeException.php | 2 +- src/Psalm/Exception/UnanalyzedFileException.php | 2 +- src/Psalm/Exception/UnpopulatedClasslikeException.php | 2 +- src/Psalm/Exception/UnpreparedAnalysisException.php | 2 +- src/Psalm/Exception/UnresolvableConstantException.php | 2 +- src/Psalm/Exception/UnsupportedIssueToFixException.php | 2 +- src/Psalm/FileBasedPluginAdapter.php | 3 ++- src/Psalm/FileManipulation.php | 2 +- src/Psalm/IssueBuffer.php | 2 +- src/Psalm/Plugin/Shepherd.php | 2 +- src/Psalm/PluginFileExtensionsSocket.php | 2 +- src/Psalm/PluginRegistrationSocket.php | 2 +- src/Psalm/Progress/DebugProgress.php | 2 +- src/Psalm/Progress/VoidProgress.php | 2 +- src/Psalm/Report/CheckstyleReport.php | 2 +- src/Psalm/Report/CodeClimateReport.php | 2 +- src/Psalm/Report/CompactReport.php | 2 +- src/Psalm/Report/ConsoleReport.php | 2 +- src/Psalm/Report/EmacsReport.php | 2 +- src/Psalm/Report/GithubActionsReport.php | 2 +- src/Psalm/Report/JsonReport.php | 2 +- src/Psalm/Report/JsonSummaryReport.php | 2 +- src/Psalm/Report/JunitReport.php | 2 +- src/Psalm/Report/PhpStormReport.php | 2 +- src/Psalm/Report/PylintReport.php | 2 +- src/Psalm/Report/ReportOptions.php | 2 +- src/Psalm/Report/SarifReport.php | 2 +- src/Psalm/Report/SonarqubeReport.php | 2 +- src/Psalm/Report/TextReport.php | 2 +- src/Psalm/Report/XmlReport.php | 2 +- src/Psalm/SourceControl/Git/CommitInfo.php | 2 +- src/Psalm/SourceControl/Git/GitInfo.php | 2 +- src/Psalm/SourceControl/Git/RemoteInfo.php | 2 +- 55 files changed, 64 insertions(+), 54 deletions(-) diff --git a/src/Psalm/Aliases.php b/src/Psalm/Aliases.php index 1b7dd23321f..ab271df3ee8 100644 --- a/src/Psalm/Aliases.php +++ b/src/Psalm/Aliases.php @@ -2,7 +2,7 @@ namespace Psalm; -class Aliases +final class Aliases { /** * @var array @@ -53,6 +53,7 @@ class Aliases * @param array $uses_flipped * @param array $functions_flipped * @param array $constants_flipped + * @internal */ public function __construct( ?string $namespace = null, diff --git a/src/Psalm/Codebase.php b/src/Psalm/Codebase.php index ef309d7feb2..9bab2d6ed40 100644 --- a/src/Psalm/Codebase.php +++ b/src/Psalm/Codebase.php @@ -92,7 +92,7 @@ use const PHP_VERSION_ID; -class Codebase +final class Codebase { /** * @var Config @@ -314,6 +314,7 @@ class Codebase */ public $track_unused_suppressions = false; + /** @internal */ public function __construct( Config $config, Providers $providers, diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index a65deb91270..4f8a7e104fb 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -608,6 +608,7 @@ class Config */ private $plugins = []; + /** @internal */ protected function __construct() { self::$instance = $this; diff --git a/src/Psalm/Config/Creator.php b/src/Psalm/Config/Creator.php index 1274fba1612..d33a07f453d 100644 --- a/src/Psalm/Config/Creator.php +++ b/src/Psalm/Config/Creator.php @@ -35,7 +35,8 @@ use const GLOB_NOSORT; use const JSON_THROW_ON_ERROR; -class Creator +/** @internal */ +final class Creator { private const TEMPLATE = ' @@ -413,6 +413,7 @@ class Context */ public $parent_remove_vars = []; + /** @internal */ public function __construct(?string $self = null) { $this->self = $self; diff --git a/src/Psalm/DocComment.php b/src/Psalm/DocComment.php index d1c0bc51dd0..c8c3fa574cd 100644 --- a/src/Psalm/DocComment.php +++ b/src/Psalm/DocComment.php @@ -16,7 +16,7 @@ use function substr; use function trim; -class DocComment +final class DocComment { public const PSALM_ANNOTATIONS = [ 'return', 'param', 'template', 'var', 'type', diff --git a/src/Psalm/ErrorBaseline.php b/src/Psalm/ErrorBaseline.php index d0cc5ddd3e1..3b91979547f 100644 --- a/src/Psalm/ErrorBaseline.php +++ b/src/Psalm/ErrorBaseline.php @@ -30,7 +30,7 @@ use const LIBXML_NOBLANKS; use const PHP_VERSION; -class ErrorBaseline +final class ErrorBaseline { /** * @param array}>> $existingIssues diff --git a/src/Psalm/Exception/CircularReferenceException.php b/src/Psalm/Exception/CircularReferenceException.php index 2056b1a3068..178991f6e9d 100644 --- a/src/Psalm/Exception/CircularReferenceException.php +++ b/src/Psalm/Exception/CircularReferenceException.php @@ -4,6 +4,6 @@ use Exception; -class CircularReferenceException extends Exception +final class CircularReferenceException extends Exception { } diff --git a/src/Psalm/Exception/CodeException.php b/src/Psalm/Exception/CodeException.php index a10e143623c..d89d3802be0 100644 --- a/src/Psalm/Exception/CodeException.php +++ b/src/Psalm/Exception/CodeException.php @@ -4,6 +4,6 @@ use Exception; -class CodeException extends Exception +final class CodeException extends Exception { } diff --git a/src/Psalm/Exception/ComplicatedExpressionException.php b/src/Psalm/Exception/ComplicatedExpressionException.php index 2687f6145ca..0d9f97fb74b 100644 --- a/src/Psalm/Exception/ComplicatedExpressionException.php +++ b/src/Psalm/Exception/ComplicatedExpressionException.php @@ -4,6 +4,6 @@ use Exception; -class ComplicatedExpressionException extends Exception +final class ComplicatedExpressionException extends Exception { } diff --git a/src/Psalm/Exception/ConfigCreationException.php b/src/Psalm/Exception/ConfigCreationException.php index 814ddf34c14..3543e90ff90 100644 --- a/src/Psalm/Exception/ConfigCreationException.php +++ b/src/Psalm/Exception/ConfigCreationException.php @@ -4,6 +4,6 @@ use Exception; -class ConfigCreationException extends Exception +final class ConfigCreationException extends Exception { } diff --git a/src/Psalm/Exception/ConfigNotFoundException.php b/src/Psalm/Exception/ConfigNotFoundException.php index 10f9939b9e6..d2355da98cf 100644 --- a/src/Psalm/Exception/ConfigNotFoundException.php +++ b/src/Psalm/Exception/ConfigNotFoundException.php @@ -2,6 +2,6 @@ namespace Psalm\Exception; -class ConfigNotFoundException extends ConfigException +final class ConfigNotFoundException extends ConfigException { } diff --git a/src/Psalm/Exception/FileIncludeException.php b/src/Psalm/Exception/FileIncludeException.php index a24296b7874..98693105ca1 100644 --- a/src/Psalm/Exception/FileIncludeException.php +++ b/src/Psalm/Exception/FileIncludeException.php @@ -4,6 +4,6 @@ use Exception; -class FileIncludeException extends Exception +final class FileIncludeException extends Exception { } diff --git a/src/Psalm/Exception/IncorrectDocblockException.php b/src/Psalm/Exception/IncorrectDocblockException.php index dc878a56d8f..d00c50b119d 100644 --- a/src/Psalm/Exception/IncorrectDocblockException.php +++ b/src/Psalm/Exception/IncorrectDocblockException.php @@ -2,6 +2,6 @@ namespace Psalm\Exception; -class IncorrectDocblockException extends DocblockParseException +final class IncorrectDocblockException extends DocblockParseException { } diff --git a/src/Psalm/Exception/InvalidClasslikeOverrideException.php b/src/Psalm/Exception/InvalidClasslikeOverrideException.php index 42181364c36..16a85b2c403 100644 --- a/src/Psalm/Exception/InvalidClasslikeOverrideException.php +++ b/src/Psalm/Exception/InvalidClasslikeOverrideException.php @@ -4,6 +4,6 @@ use Exception; -class InvalidClasslikeOverrideException extends Exception +final class InvalidClasslikeOverrideException extends Exception { } diff --git a/src/Psalm/Exception/InvalidMethodOverrideException.php b/src/Psalm/Exception/InvalidMethodOverrideException.php index 807c06c5d87..a3c2fa9cdee 100644 --- a/src/Psalm/Exception/InvalidMethodOverrideException.php +++ b/src/Psalm/Exception/InvalidMethodOverrideException.php @@ -4,6 +4,6 @@ use Exception; -class InvalidMethodOverrideException extends Exception +final class InvalidMethodOverrideException extends Exception { } diff --git a/src/Psalm/Exception/RefactorException.php b/src/Psalm/Exception/RefactorException.php index 53e47538532..e76b1ec72d6 100644 --- a/src/Psalm/Exception/RefactorException.php +++ b/src/Psalm/Exception/RefactorException.php @@ -4,6 +4,6 @@ use Exception; -class RefactorException extends Exception +final class RefactorException extends Exception { } diff --git a/src/Psalm/Exception/ScopeAnalysisException.php b/src/Psalm/Exception/ScopeAnalysisException.php index 87b6184d0eb..fd9317e005d 100644 --- a/src/Psalm/Exception/ScopeAnalysisException.php +++ b/src/Psalm/Exception/ScopeAnalysisException.php @@ -4,6 +4,6 @@ use Exception; -class ScopeAnalysisException extends Exception +final class ScopeAnalysisException extends Exception { } diff --git a/src/Psalm/Exception/TypeParseTreeException.php b/src/Psalm/Exception/TypeParseTreeException.php index f17cc2c5fdb..eb544a41e99 100644 --- a/src/Psalm/Exception/TypeParseTreeException.php +++ b/src/Psalm/Exception/TypeParseTreeException.php @@ -4,6 +4,6 @@ use Exception; -class TypeParseTreeException extends Exception +final class TypeParseTreeException extends Exception { } diff --git a/src/Psalm/Exception/UnanalyzedFileException.php b/src/Psalm/Exception/UnanalyzedFileException.php index df8024cc68a..15d81fda793 100644 --- a/src/Psalm/Exception/UnanalyzedFileException.php +++ b/src/Psalm/Exception/UnanalyzedFileException.php @@ -4,6 +4,6 @@ use Exception; -class UnanalyzedFileException extends Exception +final class UnanalyzedFileException extends Exception { } diff --git a/src/Psalm/Exception/UnpopulatedClasslikeException.php b/src/Psalm/Exception/UnpopulatedClasslikeException.php index a44ecfa79fe..26096bf9235 100644 --- a/src/Psalm/Exception/UnpopulatedClasslikeException.php +++ b/src/Psalm/Exception/UnpopulatedClasslikeException.php @@ -4,7 +4,7 @@ use LogicException; -class UnpopulatedClasslikeException extends LogicException +final class UnpopulatedClasslikeException extends LogicException { public function __construct(string $fq_classlike_name) { diff --git a/src/Psalm/Exception/UnpreparedAnalysisException.php b/src/Psalm/Exception/UnpreparedAnalysisException.php index ef62d351bf1..63a40b9eeed 100644 --- a/src/Psalm/Exception/UnpreparedAnalysisException.php +++ b/src/Psalm/Exception/UnpreparedAnalysisException.php @@ -4,6 +4,6 @@ use Exception; -class UnpreparedAnalysisException extends Exception +final class UnpreparedAnalysisException extends Exception { } diff --git a/src/Psalm/Exception/UnresolvableConstantException.php b/src/Psalm/Exception/UnresolvableConstantException.php index 10032182587..d2de1c44284 100644 --- a/src/Psalm/Exception/UnresolvableConstantException.php +++ b/src/Psalm/Exception/UnresolvableConstantException.php @@ -4,7 +4,7 @@ use Exception; -class UnresolvableConstantException extends Exception +final class UnresolvableConstantException extends Exception { /** * @var string diff --git a/src/Psalm/Exception/UnsupportedIssueToFixException.php b/src/Psalm/Exception/UnsupportedIssueToFixException.php index be1021c81b5..c1392d5ea15 100644 --- a/src/Psalm/Exception/UnsupportedIssueToFixException.php +++ b/src/Psalm/Exception/UnsupportedIssueToFixException.php @@ -4,7 +4,7 @@ use Exception; -class UnsupportedIssueToFixException extends Exception +final class UnsupportedIssueToFixException extends Exception { } diff --git a/src/Psalm/FileBasedPluginAdapter.php b/src/Psalm/FileBasedPluginAdapter.php index 0f6ed2f1862..a1dd2023808 100644 --- a/src/Psalm/FileBasedPluginAdapter.php +++ b/src/Psalm/FileBasedPluginAdapter.php @@ -16,7 +16,8 @@ use const DIRECTORY_SEPARATOR; -class FileBasedPluginAdapter implements PluginEntryPointInterface +/** @internal */ +final class FileBasedPluginAdapter implements PluginEntryPointInterface { /** @var string */ private $path; diff --git a/src/Psalm/FileManipulation.php b/src/Psalm/FileManipulation.php index d9e7884d1f1..afa3ea93c10 100644 --- a/src/Psalm/FileManipulation.php +++ b/src/Psalm/FileManipulation.php @@ -8,7 +8,7 @@ use function substr; use function trim; -class FileManipulation +final class FileManipulation { /** @var int */ public $start; diff --git a/src/Psalm/IssueBuffer.php b/src/Psalm/IssueBuffer.php index a9fe2423c1a..50efebd93b5 100644 --- a/src/Psalm/IssueBuffer.php +++ b/src/Psalm/IssueBuffer.php @@ -77,7 +77,7 @@ use const PSALM_VERSION; use const STDERR; -class IssueBuffer +final class IssueBuffer { /** * @var array> diff --git a/src/Psalm/Plugin/Shepherd.php b/src/Psalm/Plugin/Shepherd.php index 2cdd05f56ab..16a66bdeb19 100644 --- a/src/Psalm/Plugin/Shepherd.php +++ b/src/Psalm/Plugin/Shepherd.php @@ -34,7 +34,7 @@ use const PHP_URL_SCHEME; use const STDERR; -class Shepherd implements AfterAnalysisInterface +final class Shepherd implements AfterAnalysisInterface { /** * Called after analysis is complete diff --git a/src/Psalm/PluginFileExtensionsSocket.php b/src/Psalm/PluginFileExtensionsSocket.php index 7a4567700fb..ae9cf95bcd5 100644 --- a/src/Psalm/PluginFileExtensionsSocket.php +++ b/src/Psalm/PluginFileExtensionsSocket.php @@ -12,7 +12,7 @@ use function is_a; use function sprintf; -class PluginFileExtensionsSocket implements FileExtensionsInterface +final class PluginFileExtensionsSocket implements FileExtensionsInterface { /** * @var Config diff --git a/src/Psalm/PluginRegistrationSocket.php b/src/Psalm/PluginRegistrationSocket.php index c0829aff85d..51d121a909e 100644 --- a/src/Psalm/PluginRegistrationSocket.php +++ b/src/Psalm/PluginRegistrationSocket.php @@ -19,7 +19,7 @@ use function class_exists; use function is_subclass_of; -class PluginRegistrationSocket implements RegistrationInterface +final class PluginRegistrationSocket implements RegistrationInterface { /** @var Config */ private $config; diff --git a/src/Psalm/Progress/DebugProgress.php b/src/Psalm/Progress/DebugProgress.php index 192976d6693..5e5c1cbda80 100644 --- a/src/Psalm/Progress/DebugProgress.php +++ b/src/Psalm/Progress/DebugProgress.php @@ -6,7 +6,7 @@ use const E_ALL; -class DebugProgress extends Progress +final class DebugProgress extends Progress { public function setErrorReporting(): void { diff --git a/src/Psalm/Progress/VoidProgress.php b/src/Psalm/Progress/VoidProgress.php index fb14dcc4c03..14e291b53a5 100644 --- a/src/Psalm/Progress/VoidProgress.php +++ b/src/Psalm/Progress/VoidProgress.php @@ -2,7 +2,7 @@ namespace Psalm\Progress; -class VoidProgress extends Progress +final class VoidProgress extends Progress { public function write(string $message): void { diff --git a/src/Psalm/Report/CheckstyleReport.php b/src/Psalm/Report/CheckstyleReport.php index 247c258abde..080194dc4f2 100644 --- a/src/Psalm/Report/CheckstyleReport.php +++ b/src/Psalm/Report/CheckstyleReport.php @@ -6,7 +6,7 @@ use function sprintf; -class CheckstyleReport extends Report +final class CheckstyleReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/CodeClimateReport.php b/src/Psalm/Report/CodeClimateReport.php index 27523ab3627..4eb31c92fb0 100644 --- a/src/Psalm/Report/CodeClimateReport.php +++ b/src/Psalm/Report/CodeClimateReport.php @@ -20,7 +20,7 @@ * * @author Olivier Doucet */ -class CodeClimateReport extends Report +final class CodeClimateReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/CompactReport.php b/src/Psalm/Report/CompactReport.php index f1d001a0594..d351b5ba41f 100644 --- a/src/Psalm/Report/CompactReport.php +++ b/src/Psalm/Report/CompactReport.php @@ -13,7 +13,7 @@ use function strlen; use function strtoupper; -class CompactReport extends Report +final class CompactReport extends Report { /** * @psalm-suppress PossiblyNullReference diff --git a/src/Psalm/Report/ConsoleReport.php b/src/Psalm/Report/ConsoleReport.php index 214b7124008..f968326f1a0 100644 --- a/src/Psalm/Report/ConsoleReport.php +++ b/src/Psalm/Report/ConsoleReport.php @@ -14,7 +14,7 @@ use function strtr; use function substr; -class ConsoleReport extends Report +final class ConsoleReport extends Report { /** @var string|null */ private $link_format; diff --git a/src/Psalm/Report/EmacsReport.php b/src/Psalm/Report/EmacsReport.php index 785b502cbd4..185f4a494e1 100644 --- a/src/Psalm/Report/EmacsReport.php +++ b/src/Psalm/Report/EmacsReport.php @@ -7,7 +7,7 @@ use function sprintf; -class EmacsReport extends Report +final class EmacsReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/GithubActionsReport.php b/src/Psalm/Report/GithubActionsReport.php index 9625de5eb0f..8545b41aa11 100644 --- a/src/Psalm/Report/GithubActionsReport.php +++ b/src/Psalm/Report/GithubActionsReport.php @@ -8,7 +8,7 @@ use function sprintf; use function strtr; -class GithubActionsReport extends Report +final class GithubActionsReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/JsonReport.php b/src/Psalm/Report/JsonReport.php index 442e46447c3..11f1fd188c5 100644 --- a/src/Psalm/Report/JsonReport.php +++ b/src/Psalm/Report/JsonReport.php @@ -8,7 +8,7 @@ use function array_map; use function array_values; -class JsonReport extends Report +final class JsonReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/JsonSummaryReport.php b/src/Psalm/Report/JsonSummaryReport.php index fc36ccd87d7..44a2171683a 100644 --- a/src/Psalm/Report/JsonSummaryReport.php +++ b/src/Psalm/Report/JsonSummaryReport.php @@ -5,7 +5,7 @@ use Psalm\Internal\Json\Json; use Psalm\Report; -class JsonSummaryReport extends Report +final class JsonSummaryReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/JunitReport.php b/src/Psalm/Report/JunitReport.php index 6b849dcd7da..9ff30590819 100644 --- a/src/Psalm/Report/JunitReport.php +++ b/src/Psalm/Report/JunitReport.php @@ -17,7 +17,7 @@ * * with a few modifications */ -class JunitReport extends Report +final class JunitReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/PhpStormReport.php b/src/Psalm/Report/PhpStormReport.php index 8bb1f68cb5d..75294cafd1e 100644 --- a/src/Psalm/Report/PhpStormReport.php +++ b/src/Psalm/Report/PhpStormReport.php @@ -9,7 +9,7 @@ use function substr; -class PhpStormReport extends Report +final class PhpStormReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/PylintReport.php b/src/Psalm/Report/PylintReport.php index fd348f08367..1fa45b296ba 100644 --- a/src/Psalm/Report/PylintReport.php +++ b/src/Psalm/Report/PylintReport.php @@ -8,7 +8,7 @@ use function sprintf; -class PylintReport extends Report +final class PylintReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/ReportOptions.php b/src/Psalm/Report/ReportOptions.php index 3ade03bd083..242caf4884a 100644 --- a/src/Psalm/Report/ReportOptions.php +++ b/src/Psalm/Report/ReportOptions.php @@ -4,7 +4,7 @@ use Psalm\Report; -class ReportOptions +final class ReportOptions { /** * @var bool diff --git a/src/Psalm/Report/SarifReport.php b/src/Psalm/Report/SarifReport.php index c489901bec6..c94be96cb53 100644 --- a/src/Psalm/Report/SarifReport.php +++ b/src/Psalm/Report/SarifReport.php @@ -16,7 +16,7 @@ * * https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html */ -class SarifReport extends Report +final class SarifReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/SonarqubeReport.php b/src/Psalm/Report/SonarqubeReport.php index ea6a6d08c68..677751a69de 100644 --- a/src/Psalm/Report/SonarqubeReport.php +++ b/src/Psalm/Report/SonarqubeReport.php @@ -14,7 +14,7 @@ * * https://docs.sonarqube.org/latest/analysis/generic-issue/ */ -class SonarqubeReport extends Report +final class SonarqubeReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/TextReport.php b/src/Psalm/Report/TextReport.php index 1365cebca3c..b8081097378 100644 --- a/src/Psalm/Report/TextReport.php +++ b/src/Psalm/Report/TextReport.php @@ -7,7 +7,7 @@ use function sprintf; -class TextReport extends Report +final class TextReport extends Report { public function create(): string { diff --git a/src/Psalm/Report/XmlReport.php b/src/Psalm/Report/XmlReport.php index 0c4cfe9b86f..0136b51e583 100644 --- a/src/Psalm/Report/XmlReport.php +++ b/src/Psalm/Report/XmlReport.php @@ -10,7 +10,7 @@ use function array_map; use function get_object_vars; -class XmlReport extends Report +final class XmlReport extends Report { public function create(): string { diff --git a/src/Psalm/SourceControl/Git/CommitInfo.php b/src/Psalm/SourceControl/Git/CommitInfo.php index 9238c1f04d6..c157eefbd7a 100644 --- a/src/Psalm/SourceControl/Git/CommitInfo.php +++ b/src/Psalm/SourceControl/Git/CommitInfo.php @@ -7,7 +7,7 @@ * * @author Kitamura Satoshi */ -class CommitInfo +final class CommitInfo { /** * Commit ID. diff --git a/src/Psalm/SourceControl/Git/GitInfo.php b/src/Psalm/SourceControl/Git/GitInfo.php index 7f891616fd7..83c0dbc6ea9 100644 --- a/src/Psalm/SourceControl/Git/GitInfo.php +++ b/src/Psalm/SourceControl/Git/GitInfo.php @@ -27,7 +27,7 @@ * * @author Kitamura Satoshi */ -class GitInfo extends SourceControlInfo +final class GitInfo extends SourceControlInfo { /** * Branch name. diff --git a/src/Psalm/SourceControl/Git/RemoteInfo.php b/src/Psalm/SourceControl/Git/RemoteInfo.php index dd609c86807..212b6f5fa47 100644 --- a/src/Psalm/SourceControl/Git/RemoteInfo.php +++ b/src/Psalm/SourceControl/Git/RemoteInfo.php @@ -7,7 +7,7 @@ * * @author Kitamura Satoshi */ -class RemoteInfo +final class RemoteInfo { /** * Remote name. From 75c58712c1e27fb2ddff988274389ed4c0d28540 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Fri, 4 Feb 2022 05:02:39 +0200 Subject: [PATCH 2/2] Update UPGRADING.md --- UPGRADING.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/UPGRADING.md b/UPGRADING.md index f73358db4c8..31d73a9c979 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -158,6 +158,70 @@ - [BC] `TKeyOfClassConstant` has been renamed to `TKeyOfArray`. - [BC] `TValueOfClassConstant` has been renamed to `TValueOfArray`. - [BC] `TKeyOfTemplate` base class has been changed from `Scalar` to `Atomic`. +- [BC] Class `Psalm\FileManipulation` became final +- [BC] Class `Psalm\Context` became final +- [BC] `Psalm\Context#__construct()` was marked `@internal` +- [BC] Class `Psalm\PluginRegistrationSocket` became final +- [BC] Class `Psalm\PluginFileExtensionsSocket` became final +- [BC] Class `Psalm\Config\IssueHandler` became final +- [BC] `Psalm\Config\IssueHandler` was marked `@internal` +- [BC] Class `Psalm\Config\ProjectFileFilter` became final +- [BC] `Psalm\Config\ProjectFileFilter` was marked `@internal` +- [BC] Class `Psalm\Config\Creator` became final +- [BC] `Psalm\Config\Creator` was marked `@internal` +- [BC] Class `Psalm\Config\TaintAnalysisFileFilter` became final +- [BC] `Psalm\Config\TaintAnalysisFileFilter` was marked `@internal` +- [BC] Class `Psalm\Config\ErrorLevelFileFilter` became final +- [BC] `Psalm\Config\ErrorLevelFileFilter` was marked `@internal` +- [BC] Class `Psalm\FileBasedPluginAdapter` became final +- [BC] `Psalm\FileBasedPluginAdapter` was marked `@internal` +- [BC] Class `Psalm\Exception\InvalidMethodOverrideException` became final +- [BC] Class `Psalm\Exception\UnpopulatedClasslikeException` became final +- [BC] Class `Psalm\Exception\ConfigNotFoundException` became final +- [BC] Class `Psalm\Exception\TypeParseTreeException` became final +- [BC] Class `Psalm\Exception\ComplicatedExpressionException` became final +- [BC] Class `Psalm\Exception\ScopeAnalysisException` became final +- [BC] Class `Psalm\Exception\InvalidClasslikeOverrideException` became final +- [BC] Class `Psalm\Exception\CircularReferenceException` became final +- [BC] Class `Psalm\Exception\UnsupportedIssueToFixException` became final +- [BC] Class `Psalm\Exception\CodeException` became final +- [BC] Class `Psalm\Exception\RefactorException` became final +- [BC] Class `Psalm\Exception\UnpreparedAnalysisException` became final +- [BC] Class `Psalm\Exception\IncorrectDocblockException` became final +- [BC] Class `Psalm\Exception\UnanalyzedFileException` became final +- [BC] Class `Psalm\Exception\UnresolvableConstantException` became final +- [BC] Class `Psalm\Exception\FileIncludeException` became final +- [BC] Class `Psalm\Exception\ConfigCreationException` became final +- [BC] Class `Psalm\Aliases` became final +- [BC] `Psalm\Aliases#__construct()` was marked `@internal` +- [BC] Class `Psalm\Codebase` became final +- [BC] `Psalm\Codebase#__construct()` was marked `@internal` +- [BC] Class `Psalm\Progress\VoidProgress` became final +- [BC] Class `Psalm\Progress\DebugProgress` became final +- [BC] Class `Psalm\Report\JsonReport` became final +- [BC] Class `Psalm\Report\SonarqubeReport` became final +- [BC] Class `Psalm\Report\CodeClimateReport` became final +- [BC] Class `Psalm\Report\CheckstyleReport` became final +- [BC] Class `Psalm\Report\JsonSummaryReport` became final +- [BC] Class `Psalm\Report\XmlReport` became final +- [BC] Class `Psalm\Report\EmacsReport` became final +- [BC] Class `Psalm\Report\ConsoleReport` became final +- [BC] Class `Psalm\Report\ReportOptions` became final +- [BC] Class `Psalm\Report\PylintReport` became final +- [BC] Class `Psalm\Report\JunitReport` became final +- [BC] Class `Psalm\Report\CompactReport` became final +- [BC] Class `Psalm\Report\GithubActionsReport` became final +- [BC] Class `Psalm\Report\TextReport` became final +- [BC] Class `Psalm\Report\SarifReport` became final +- [BC] Class `Psalm\Report\PhpStormReport` became final +- [BC] Class `Psalm\Plugin\Shepherd` became final +- [BC] Class `Psalm\IssueBuffer` became final +- [BC] Class `Psalm\SourceControl\Git\RemoteInfo` became final +- [BC] Class `Psalm\SourceControl\Git\CommitInfo` became final +- [BC] Class `Psalm\SourceControl\Git\GitInfo` became final +- [BC] Class `Psalm\ErrorBaseline` became final +- [BC] `Psalm\Config#__construct()` was marked `@internal` +- [BC] Class `Psalm\DocComment` became final ## Removed - [BC] Property `Psalm\Codebase::$php_major_version` was removed, use