Skip to content

Commit

Permalink
Merge pull request #7578 from weirdan/finalize-more-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Feb 5, 2022
2 parents a83c717 + 75c5871 commit e00cbc7
Show file tree
Hide file tree
Showing 56 changed files with 128 additions and 54 deletions.
64 changes: 64 additions & 0 deletions UPGRADING.md
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Psalm/Aliases.php
Expand Up @@ -2,7 +2,7 @@

namespace Psalm;

class Aliases
final class Aliases
{
/**
* @var array<lowercase-string, string>
Expand Down Expand Up @@ -53,6 +53,7 @@ class Aliases
* @param array<lowercase-string, string> $uses_flipped
* @param array<lowercase-string, string> $functions_flipped
* @param array<string, string> $constants_flipped
* @internal
*/
public function __construct(
?string $namespace = null,
Expand Down
3 changes: 2 additions & 1 deletion src/Psalm/Codebase.php
Expand Up @@ -92,7 +92,7 @@

use const PHP_VERSION_ID;

class Codebase
final class Codebase
{
/**
* @var Config
Expand Down Expand Up @@ -314,6 +314,7 @@ class Codebase
*/
public $track_unused_suppressions = false;

/** @internal */
public function __construct(
Config $config,
Providers $providers,
Expand Down
1 change: 1 addition & 0 deletions src/Psalm/Config.php
Expand Up @@ -608,6 +608,7 @@ class Config
*/
private $plugins = [];

/** @internal */
protected function __construct()
{
self::$instance = $this;
Expand Down
3 changes: 2 additions & 1 deletion src/Psalm/Config/Creator.php
Expand Up @@ -35,7 +35,8 @@
use const GLOB_NOSORT;
use const JSON_THROW_ON_ERROR;

class Creator
/** @internal */
final class Creator
{
private const TEMPLATE = '<?xml version="1.0"?>
<psalm
Expand Down
3 changes: 2 additions & 1 deletion src/Psalm/Config/ErrorLevelFileFilter.php
Expand Up @@ -8,7 +8,8 @@

use function in_array;

class ErrorLevelFileFilter extends FileFilter
/** @internal */
final class ErrorLevelFileFilter extends FileFilter
{
/**
* @var string
Expand Down
3 changes: 2 additions & 1 deletion src/Psalm/Config/IssueHandler.php
Expand Up @@ -16,7 +16,8 @@

use const SCANDIR_SORT_NONE;

class IssueHandler
/** @internal */
final class IssueHandler
{
/**
* @var string
Expand Down
3 changes: 2 additions & 1 deletion src/Psalm/Config/ProjectFileFilter.php
Expand Up @@ -8,7 +8,8 @@
use function stripos;
use function strpos;

class ProjectFileFilter extends FileFilter
/** @internal */
final class ProjectFileFilter extends FileFilter
{
/**
* @var ProjectFileFilter|null
Expand Down
3 changes: 2 additions & 1 deletion src/Psalm/Config/TaintAnalysisFileFilter.php
Expand Up @@ -2,6 +2,7 @@

namespace Psalm\Config;

class TaintAnalysisFileFilter extends FileFilter
/** @internal */
final class TaintAnalysisFileFilter extends FileFilter
{
}
3 changes: 2 additions & 1 deletion src/Psalm/Context.php
Expand Up @@ -31,7 +31,7 @@

use const JSON_THROW_ON_ERROR;

class Context
final class Context
{
/**
* @var array<string, Union>
Expand Down Expand Up @@ -413,6 +413,7 @@ class Context
*/
public $parent_remove_vars = [];

/** @internal */
public function __construct(?string $self = null)
{
$this->self = $self;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/DocComment.php
Expand Up @@ -16,7 +16,7 @@
use function substr;
use function trim;

class DocComment
final class DocComment
{
public const PSALM_ANNOTATIONS = [
'return', 'param', 'template', 'var', 'type',
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/ErrorBaseline.php
Expand Up @@ -30,7 +30,7 @@
use const LIBXML_NOBLANKS;
use const PHP_VERSION;

class ErrorBaseline
final class ErrorBaseline
{
/**
* @param array<string,array<string,array{o:int, s:array<int, string>}>> $existingIssues
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Exception/CircularReferenceException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class CircularReferenceException extends Exception
final class CircularReferenceException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/CodeException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class CodeException extends Exception
final class CodeException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/ComplicatedExpressionException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class ComplicatedExpressionException extends Exception
final class ComplicatedExpressionException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/ConfigCreationException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class ConfigCreationException extends Exception
final class ConfigCreationException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/ConfigNotFoundException.php
Expand Up @@ -2,6 +2,6 @@

namespace Psalm\Exception;

class ConfigNotFoundException extends ConfigException
final class ConfigNotFoundException extends ConfigException
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/FileIncludeException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class FileIncludeException extends Exception
final class FileIncludeException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/IncorrectDocblockException.php
Expand Up @@ -2,6 +2,6 @@

namespace Psalm\Exception;

class IncorrectDocblockException extends DocblockParseException
final class IncorrectDocblockException extends DocblockParseException
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/InvalidClasslikeOverrideException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class InvalidClasslikeOverrideException extends Exception
final class InvalidClasslikeOverrideException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/InvalidMethodOverrideException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class InvalidMethodOverrideException extends Exception
final class InvalidMethodOverrideException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/RefactorException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class RefactorException extends Exception
final class RefactorException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/ScopeAnalysisException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class ScopeAnalysisException extends Exception
final class ScopeAnalysisException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/TypeParseTreeException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class TypeParseTreeException extends Exception
final class TypeParseTreeException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/UnanalyzedFileException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class UnanalyzedFileException extends Exception
final class UnanalyzedFileException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/UnpopulatedClasslikeException.php
Expand Up @@ -4,7 +4,7 @@

use LogicException;

class UnpopulatedClasslikeException extends LogicException
final class UnpopulatedClasslikeException extends LogicException
{
public function __construct(string $fq_classlike_name)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Exception/UnpreparedAnalysisException.php
Expand Up @@ -4,6 +4,6 @@

use Exception;

class UnpreparedAnalysisException extends Exception
final class UnpreparedAnalysisException extends Exception
{
}
2 changes: 1 addition & 1 deletion src/Psalm/Exception/UnresolvableConstantException.php
Expand Up @@ -4,7 +4,7 @@

use Exception;

class UnresolvableConstantException extends Exception
final class UnresolvableConstantException extends Exception
{
/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Exception/UnsupportedIssueToFixException.php
Expand Up @@ -4,7 +4,7 @@

use Exception;

class UnsupportedIssueToFixException extends Exception
final class UnsupportedIssueToFixException extends Exception
{

}
3 changes: 2 additions & 1 deletion src/Psalm/FileBasedPluginAdapter.php
Expand Up @@ -16,7 +16,8 @@

use const DIRECTORY_SEPARATOR;

class FileBasedPluginAdapter implements PluginEntryPointInterface
/** @internal */
final class FileBasedPluginAdapter implements PluginEntryPointInterface
{
/** @var string */
private $path;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/FileManipulation.php
Expand Up @@ -8,7 +8,7 @@
use function substr;
use function trim;

class FileManipulation
final class FileManipulation
{
/** @var int */
public $start;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/IssueBuffer.php
Expand Up @@ -77,7 +77,7 @@
use const PSALM_VERSION;
use const STDERR;

class IssueBuffer
final class IssueBuffer
{
/**
* @var array<string, list<IssueData>>
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Plugin/Shepherd.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/PluginFileExtensionsSocket.php
Expand Up @@ -12,7 +12,7 @@
use function is_a;
use function sprintf;

class PluginFileExtensionsSocket implements FileExtensionsInterface
final class PluginFileExtensionsSocket implements FileExtensionsInterface
{
/**
* @var Config
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/PluginRegistrationSocket.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Progress/DebugProgress.php
Expand Up @@ -6,7 +6,7 @@

use const E_ALL;

class DebugProgress extends Progress
final class DebugProgress extends Progress
{
public function setErrorReporting(): void
{
Expand Down

0 comments on commit e00cbc7

Please sign in to comment.