diff --git a/phpcs.xml b/phpcs.xml index bf29aa71589..b539ffc6481 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -252,10 +252,16 @@ - + + + + src/Psalm/Storage/Assertion/HasArrayKey\.php + src/Psalm/Storage/Assertion/IsNotCountable\.php + src/Psalm/Storage/Assertion/NonEmptyCountable\.php + diff --git a/src/Psalm/Internal/Analyzer/IssueData.php b/src/Psalm/Internal/Analyzer/IssueData.php index 46ac2b840da..6b273c0b1fb 100644 --- a/src/Psalm/Internal/Analyzer/IssueData.php +++ b/src/Psalm/Internal/Analyzer/IssueData.php @@ -88,7 +88,6 @@ class IssueData public ?array $other_references = null; /** - * @var ?string * @readonly */ public ?string $dupe_key = null; diff --git a/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php b/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php index 380ada271eb..38696dbbb08 100644 --- a/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php @@ -127,7 +127,6 @@ class ProjectAnalyzer private ?ParserCacheProvider $parser_cache_provider = null; - /** @var ?ProjectCacheProvider */ public ?ProjectCacheProvider $project_cache_provider = null; private FileReferenceProvider $file_reference_provider; @@ -153,9 +152,6 @@ class ProjectAnalyzer public bool $only_replace_php_types_with_non_docblock_types = false; - /** - * @var ?int - */ public ?int $onchange_line_limit = null; public bool $provide_completion = false; @@ -180,9 +176,6 @@ class ProjectAnalyzer */ private array $to_refactor = []; - /** - * @var ?ReportOptions - */ public ?ReportOptions $stdout_report_options = null; /** diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallInfo.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallInfo.php index 7201221f80f..c2e38864d5b 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallInfo.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallInfo.php @@ -12,14 +12,8 @@ */ class FunctionCallInfo { - /** - * @var ?string - */ public ?string $function_id = null; - /** - * @var ?bool - */ public ?bool $function_exists = null; public bool $is_stubbed = false; @@ -41,14 +35,8 @@ class FunctionCallInfo */ public ?array $function_params = null; - /** - * @var ?FunctionLikeStorage - */ public ?FunctionLikeStorage $function_storage = null; - /** - * @var ?PhpParser\Node\Name - */ public ?PhpParser\Node\Name $new_function_name = null; public bool $allow_named_args = true; diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalysisResult.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalysisResult.php index 515f98ddefb..e83742e070b 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalysisResult.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalysisResult.php @@ -10,9 +10,6 @@ */ class AtomicMethodCallAnalysisResult { - /** - * @var ?Union - */ public ?Union $return_type = null; public bool $returns_by_ref = false; diff --git a/src/Psalm/Internal/DataFlow/DataFlowNode.php b/src/Psalm/Internal/DataFlow/DataFlowNode.php index 59481847b9d..e0c38e03934 100644 --- a/src/Psalm/Internal/DataFlow/DataFlowNode.php +++ b/src/Psalm/Internal/DataFlow/DataFlowNode.php @@ -14,15 +14,12 @@ class DataFlowNode { public string $id; - /** @var ?string */ public ?string $unspecialized_id = null; public string $label; - /** @var ?CodeLocation */ public ?CodeLocation $code_location = null; - /** @var ?string */ public ?string $specialization_key = null; /** @var array */ diff --git a/src/Psalm/Internal/LanguageServer/LanguageServer.php b/src/Psalm/Internal/LanguageServer/LanguageServer.php index 9120a5126fe..3c4501763fa 100644 --- a/src/Psalm/Internal/LanguageServer/LanguageServer.php +++ b/src/Psalm/Internal/LanguageServer/LanguageServer.php @@ -62,15 +62,11 @@ class LanguageServer extends Dispatcher { /** * Handles textDocument/* method calls - * - * @var ?ServerTextDocument */ public ?ServerTextDocument $textDocument = null; /** * Handles workspace/* method calls - * - * @var ?ServerWorkspace */ public ?ServerWorkspace $workspace = null; diff --git a/src/Psalm/Internal/LanguageServer/Message.php b/src/Psalm/Internal/LanguageServer/Message.php index d787a6414e3..ba1e73f9622 100644 --- a/src/Psalm/Internal/LanguageServer/Message.php +++ b/src/Psalm/Internal/LanguageServer/Message.php @@ -15,9 +15,6 @@ */ class Message { - /** - * @var ?MessageBody - */ public ?MessageBody $body = null; /** diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php index 3c21b4204b6..c2846292a86 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php @@ -113,9 +113,6 @@ class ClassLikeNodeScanner private Aliases $aliases; - /** - * @var ?ClassLikeStorage - */ public ?ClassLikeStorage $storage = null; /** diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php index 84e8848e055..f6986f2e13f 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php @@ -92,9 +92,6 @@ class FunctionLikeNodeScanner */ private array $type_aliases; - /** - * @var ?FunctionLikeStorage - */ public ?FunctionLikeStorage $storage = null; /** diff --git a/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php b/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php index 97526820d6d..5e9d9e5a9c8 100644 --- a/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php +++ b/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php @@ -26,9 +26,6 @@ class ClassLikeStorageProvider */ private static array $new_storage = []; - /** - * @var ?ClassLikeStorageCacheProvider - */ public ?ClassLikeStorageCacheProvider $cache = null; public function __construct(?ClassLikeStorageCacheProvider $cache = null) diff --git a/src/Psalm/Internal/Provider/FileReferenceProvider.php b/src/Psalm/Internal/Provider/FileReferenceProvider.php index 829c0b45496..5c79ebc0063 100644 --- a/src/Psalm/Internal/Provider/FileReferenceProvider.php +++ b/src/Psalm/Internal/Provider/FileReferenceProvider.php @@ -164,9 +164,6 @@ class FileReferenceProvider */ private static array $method_param_uses = []; - /** - * @var ?FileReferenceCacheProvider - */ public ?FileReferenceCacheProvider $cache = null; public function __construct(?FileReferenceCacheProvider $cache = null) diff --git a/src/Psalm/Internal/Provider/FileStorageProvider.php b/src/Psalm/Internal/Provider/FileStorageProvider.php index 1c4a26b8f75..946d3c46062 100644 --- a/src/Psalm/Internal/Provider/FileStorageProvider.php +++ b/src/Psalm/Internal/Provider/FileStorageProvider.php @@ -29,9 +29,6 @@ class FileStorageProvider */ private static array $new_storage = []; - /** - * @var ?FileStorageCacheProvider - */ public ?FileStorageCacheProvider $cache = null; public function __construct(?FileStorageCacheProvider $cache = null) diff --git a/src/Psalm/Internal/Provider/Providers.php b/src/Psalm/Internal/Provider/Providers.php index b052a6518a1..57e0414dffc 100644 --- a/src/Psalm/Internal/Provider/Providers.php +++ b/src/Psalm/Internal/Provider/Providers.php @@ -20,9 +20,6 @@ class Providers { public FileProvider $file_provider; - /** - * @var ?ParserCacheProvider - */ public ?ParserCacheProvider $parser_cache_provider = null; public FileStorageProvider $file_storage_provider; @@ -33,9 +30,6 @@ class Providers public FileReferenceProvider $file_reference_provider; - /** - * @var ?ProjectCacheProvider - */ public ?ProjectCacheProvider $project_cache_provider = null; public function __construct( diff --git a/src/Psalm/Internal/Provider/StatementsProvider.php b/src/Psalm/Internal/Provider/StatementsProvider.php index b3f7444c590..ab8ee607945 100644 --- a/src/Psalm/Internal/Provider/StatementsProvider.php +++ b/src/Psalm/Internal/Provider/StatementsProvider.php @@ -43,9 +43,6 @@ class StatementsProvider { private FileProvider $file_provider; - /** - * @var ?ParserCacheProvider - */ public ?ParserCacheProvider $parser_cache_provider = null; /** diff --git a/src/Psalm/Internal/Provider/StatementsVolatileCache.php b/src/Psalm/Internal/Provider/StatementsVolatileCache.php index 12cc53966f2..e9fef387164 100644 --- a/src/Psalm/Internal/Provider/StatementsVolatileCache.php +++ b/src/Psalm/Internal/Provider/StatementsVolatileCache.php @@ -31,9 +31,6 @@ final class StatementsVolatileCache protected int $max_size; - /** - * @var ?StatementsVolatileCache - */ protected static ?StatementsVolatileCache $instance = null; public function __construct(int $max_size = 4096) diff --git a/src/Psalm/Internal/Scanner/ClassLikeDocblockComment.php b/src/Psalm/Internal/Scanner/ClassLikeDocblockComment.php index 850f7187ca1..0b865ba01b9 100644 --- a/src/Psalm/Internal/Scanner/ClassLikeDocblockComment.php +++ b/src/Psalm/Internal/Scanner/ClassLikeDocblockComment.php @@ -51,9 +51,6 @@ class ClassLikeDocblockComment */ public array $template_implements = []; - /** - * @var ?string - */ public ?string $yield = null; /** @@ -103,8 +100,5 @@ class ClassLikeDocblockComment */ public array $implementation_requirements = []; - /** - * @var ?string - */ public ?string $description = null; } diff --git a/src/Psalm/Internal/Scanner/FunctionDocblockComment.php b/src/Psalm/Internal/Scanner/FunctionDocblockComment.php index 3c48864bf08..74b315600c7 100644 --- a/src/Psalm/Internal/Scanner/FunctionDocblockComment.php +++ b/src/Psalm/Internal/Scanner/FunctionDocblockComment.php @@ -170,9 +170,6 @@ class FunctionDocblockComment public int $since_php_minor_version = 0; - /** - * @var ?string - */ public ?string $description = null; /** @var array, suggested_replacement?:string}> */ diff --git a/src/Psalm/Internal/Scanner/UnresolvedConstant/KeyValuePair.php b/src/Psalm/Internal/Scanner/UnresolvedConstant/KeyValuePair.php index d12060b150f..607bc7a58f8 100644 --- a/src/Psalm/Internal/Scanner/UnresolvedConstant/KeyValuePair.php +++ b/src/Psalm/Internal/Scanner/UnresolvedConstant/KeyValuePair.php @@ -10,7 +10,6 @@ */ class KeyValuePair extends UnresolvedConstantComponent { - /** @var ?UnresolvedConstantComponent */ public ?UnresolvedConstantComponent $key = null; public UnresolvedConstantComponent $value; diff --git a/src/Psalm/Internal/Scanner/VarDocblockComment.php b/src/Psalm/Internal/Scanner/VarDocblockComment.php index 8c6363d3903..4a1651c9044 100644 --- a/src/Psalm/Internal/Scanner/VarDocblockComment.php +++ b/src/Psalm/Internal/Scanner/VarDocblockComment.php @@ -9,9 +9,6 @@ */ class VarDocblockComment { - /** - * @var ?Union - */ public ?Union $type = null; public ?string $var_id = null; @@ -59,8 +56,5 @@ class VarDocblockComment */ public array $suppressed_issues = []; - /** - * @var ?string - */ public ?string $description = null; } diff --git a/src/Psalm/Internal/Scope/IfScope.php b/src/Psalm/Internal/Scope/IfScope.php index 4b69b9186db..27a5181d970 100644 --- a/src/Psalm/Internal/Scope/IfScope.php +++ b/src/Psalm/Internal/Scope/IfScope.php @@ -86,8 +86,5 @@ class IfScope */ public array $final_actions = []; - /** - * @var ?Context - */ public ?Context $post_leaving_if_context = null; } diff --git a/src/Psalm/Internal/Type/Comparator/TypeComparisonResult.php b/src/Psalm/Internal/Type/Comparator/TypeComparisonResult.php index 94dab670536..284d946b591 100644 --- a/src/Psalm/Internal/Type/Comparator/TypeComparisonResult.php +++ b/src/Psalm/Internal/Type/Comparator/TypeComparisonResult.php @@ -13,21 +13,15 @@ class TypeComparisonResult /** * This is used to trigger `InvalidScalarArgument` in situations where we know PHP * will try to coerce one scalar type to another. - * - * @var ?bool */ public ?bool $scalar_type_match_found = null; - /** @var ?bool */ public ?bool $type_coerced = null; - /** @var ?bool */ public ?bool $type_coerced_from_mixed = null; - /** @var ?bool */ public ?bool $type_coerced_from_as_mixed = null; - /** @var ?bool */ public ?bool $to_string_cast = null; /** @@ -38,15 +32,11 @@ class TypeComparisonResult * function takesAnInt(int $i): string { * return ["foo", "bar"][$i]; * } - * - * @var ?bool */ public ?bool $type_coerced_from_scalar = null; - /** @var ?Union */ public ?Union $replacement_union_type = null; - /** @var ?Atomic */ public ?Atomic $replacement_atomic_type = null; /** @var ?non-empty-list */ diff --git a/src/Psalm/Internal/Type/ParseTree/Value.php b/src/Psalm/Internal/Type/ParseTree/Value.php index 587696c4e33..e61d14efbe6 100644 --- a/src/Psalm/Internal/Type/ParseTree/Value.php +++ b/src/Psalm/Internal/Type/ParseTree/Value.php @@ -15,9 +15,6 @@ class Value extends ParseTree public int $offset_end; - /** - * @var ?string - */ public ?string $text = null; public function __construct( diff --git a/src/Psalm/Internal/Type/TemplateBound.php b/src/Psalm/Internal/Type/TemplateBound.php index 664c0bbe0fb..01aada21077 100644 --- a/src/Psalm/Internal/Type/TemplateBound.php +++ b/src/Psalm/Internal/Type/TemplateBound.php @@ -24,15 +24,11 @@ class TemplateBound * The argument offset where this template was set * * In the type Foo the type appears at argument offsets 0 and 2 - * - * @var ?int */ public ?int $arg_offset = null; /** * When non-null, indicates an equality template bound (vs a lower or upper bound) - * - * @var ?string */ public ?string $equality_bound_classlike = null; diff --git a/src/Psalm/Internal/Type/TypeCombination.php b/src/Psalm/Internal/Type/TypeCombination.php index b39049a2e07..8531377860d 100644 --- a/src/Psalm/Internal/Type/TypeCombination.php +++ b/src/Psalm/Internal/Type/TypeCombination.php @@ -50,17 +50,14 @@ class TypeCombination public bool $objectlike_sealed = true; - /** @var ?Union */ public ?Union $objectlike_key_type = null; - /** @var ?Union */ public ?Union $objectlike_value_type = null; public bool $empty_mixed = false; public bool $non_empty_mixed = false; - /** @var ?bool */ public ?bool $mixed_from_loop_isset = null; /** @var array|null */ @@ -80,13 +77,10 @@ class TypeCombination */ public array $extra_types = []; - /** @var ?bool */ public ?bool $all_arrays_lists = null; - /** @var ?bool */ public ?bool $all_arrays_callable = null; - /** @var ?bool */ public ?bool $all_arrays_class_string_maps = null; /** @var array */