Skip to content

Commit

Permalink
Finalize (and internalize) more classes
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Feb 5, 2022
1 parent a83c717 commit 3e837ca
Show file tree
Hide file tree
Showing 55 changed files with 64 additions and 54 deletions.
3 changes: 2 additions & 1 deletion src/Psalm/Aliases.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion src/Psalm/Progress/VoidProgress.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Psalm\Progress;

class VoidProgress extends Progress
final class VoidProgress extends Progress
{
public function write(string $message): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Report/CheckstyleReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use function sprintf;

class CheckstyleReport extends Report
final class CheckstyleReport extends Report
{
public function create(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Report/CodeClimateReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Olivier Doucet <[email protected]>
*/
class CodeClimateReport extends Report
final class CodeClimateReport extends Report
{
public function create(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Report/CompactReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use function strlen;
use function strtoupper;

class CompactReport extends Report
final class CompactReport extends Report
{
/**
* @psalm-suppress PossiblyNullReference
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Report/ConsoleReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Report/EmacsReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use function sprintf;

class EmacsReport extends Report
final class EmacsReport extends Report
{
public function create(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Report/GithubActionsReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use function sprintf;
use function strtr;

class GithubActionsReport extends Report
final class GithubActionsReport extends Report
{
public function create(): string
{
Expand Down
Loading

0 comments on commit 3e837ca

Please sign in to comment.