diff --git a/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php b/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php index ae2030f03..82acb443d 100644 --- a/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php @@ -132,10 +132,7 @@ class ProjectAnalyzer private FileReferenceProvider $file_reference_provider; - /** - * @var Progress - */ - public $progress; + public Progress $progress; public bool $debug_lines = false; diff --git a/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php b/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php index 477717b55..075020db7 100644 --- a/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php @@ -138,8 +138,7 @@ class StatementsAnalyzer extends SourceAnalyzer public NodeDataProvider $node_data; - /** @var ?DataFlowGraph */ - public $data_flow_graph; + public ?DataFlowGraph $data_flow_graph = null; /** * Locations of foreach values diff --git a/src/Psalm/Internal/LanguageServer/LanguageServer.php b/src/Psalm/Internal/LanguageServer/LanguageServer.php index a553d765e..e910820d4 100644 --- a/src/Psalm/Internal/LanguageServer/LanguageServer.php +++ b/src/Psalm/Internal/LanguageServer/LanguageServer.php @@ -100,9 +100,8 @@ class LanguageServer extends Dispatcher /** * This should actually be a private property on `parent` * @psalm-suppress UnusedProperty - * @var JsonMapper */ - protected $mapper; + protected JsonMapper $mapper; public function __construct( ProtocolReader $reader, diff --git a/src/Psalm/Internal/MethodIdentifier.php b/src/Psalm/Internal/MethodIdentifier.php index f5348a7a1..df0988a18 100644 --- a/src/Psalm/Internal/MethodIdentifier.php +++ b/src/Psalm/Internal/MethodIdentifier.php @@ -21,10 +21,11 @@ class MethodIdentifier use ImmutableNonCloneableTrait; public string $fq_class_name; - public $method_name; + /** @var lowercase-string */ + public string $method_name; /** - * @param lowercase-string $method_name + * @param lowercase-string $method_name */ public function __construct(string $fq_class_name, string $method_name) { diff --git a/src/Psalm/Internal/Scanner/PhpStormMetaScanner.php b/src/Psalm/Internal/Scanner/PhpStormMetaScanner.php index b326f0fda..d6a503138 100644 --- a/src/Psalm/Internal/Scanner/PhpStormMetaScanner.php +++ b/src/Psalm/Internal/Scanner/PhpStormMetaScanner.php @@ -100,7 +100,6 @@ class PhpStormMetaScanner $codebase->methods->return_type_provider->registerClosure( $meta_fq_classlike_name, - static function ( MethodReturnTypeProviderEvent $event ) use ( @@ -154,7 +153,6 @@ class PhpStormMetaScanner } elseif ($type_offset !== null) { $codebase->methods->return_type_provider->registerClosure( $meta_fq_classlike_name, - static function ( MethodReturnTypeProviderEvent $event ) use ( @@ -189,7 +187,6 @@ class PhpStormMetaScanner } elseif ($element_type_offset !== null) { $codebase->methods->return_type_provider->registerClosure( $meta_fq_classlike_name, - static function ( MethodReturnTypeProviderEvent $event ) use ( @@ -246,7 +243,6 @@ class PhpStormMetaScanner $codebase->functions->return_type_provider->registerClosure( $function_id, - static function ( FunctionReturnTypeProviderEvent $event ) use ( @@ -297,7 +293,6 @@ class PhpStormMetaScanner } elseif ($type_offset !== null) { $codebase->functions->return_type_provider->registerClosure( $function_id, - static function ( FunctionReturnTypeProviderEvent $event ) use ( @@ -328,7 +323,6 @@ class PhpStormMetaScanner } elseif ($element_type_offset !== null) { $codebase->functions->return_type_provider->registerClosure( $function_id, - static function ( FunctionReturnTypeProviderEvent $event ) use ( diff --git a/src/Psalm/Internal/Type/ParseTreeCreator.php b/src/Psalm/Internal/Type/ParseTreeCreator.php index 0adebe41e..1049f8044 100644 --- a/src/Psalm/Internal/Type/ParseTreeCreator.php +++ b/src/Psalm/Internal/Type/ParseTreeCreator.php @@ -36,11 +36,9 @@ use function strtolower; */ class ParseTreeCreator { - /** @var ParseTree */ - private $parse_tree; + private ParseTree $parse_tree; - /** @var ParseTree */ - private $current_leaf; + private ParseTree $current_leaf; /** @var array */ private array $type_tokens;