1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00

Add more property typehints

This commit is contained in:
Jack Worman 2022-12-13 21:34:34 -06:00
parent 36fa162d6d
commit 749ce58c27
6 changed files with 8 additions and 20 deletions

View File

@ -132,10 +132,7 @@ class ProjectAnalyzer
private FileReferenceProvider $file_reference_provider; private FileReferenceProvider $file_reference_provider;
/** public Progress $progress;
* @var Progress
*/
public $progress;
public bool $debug_lines = false; public bool $debug_lines = false;

View File

@ -138,8 +138,7 @@ class StatementsAnalyzer extends SourceAnalyzer
public NodeDataProvider $node_data; public NodeDataProvider $node_data;
/** @var ?DataFlowGraph */ public ?DataFlowGraph $data_flow_graph = null;
public $data_flow_graph;
/** /**
* Locations of foreach values * Locations of foreach values

View File

@ -100,9 +100,8 @@ class LanguageServer extends Dispatcher
/** /**
* This should actually be a private property on `parent` * This should actually be a private property on `parent`
* @psalm-suppress UnusedProperty * @psalm-suppress UnusedProperty
* @var JsonMapper
*/ */
protected $mapper; protected JsonMapper $mapper;
public function __construct( public function __construct(
ProtocolReader $reader, ProtocolReader $reader,

View File

@ -21,7 +21,8 @@ class MethodIdentifier
use ImmutableNonCloneableTrait; use ImmutableNonCloneableTrait;
public string $fq_class_name; 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

View File

@ -100,7 +100,6 @@ class PhpStormMetaScanner
$codebase->methods->return_type_provider->registerClosure( $codebase->methods->return_type_provider->registerClosure(
$meta_fq_classlike_name, $meta_fq_classlike_name,
static function ( static function (
MethodReturnTypeProviderEvent $event MethodReturnTypeProviderEvent $event
) use ( ) use (
@ -154,7 +153,6 @@ class PhpStormMetaScanner
} elseif ($type_offset !== null) { } elseif ($type_offset !== null) {
$codebase->methods->return_type_provider->registerClosure( $codebase->methods->return_type_provider->registerClosure(
$meta_fq_classlike_name, $meta_fq_classlike_name,
static function ( static function (
MethodReturnTypeProviderEvent $event MethodReturnTypeProviderEvent $event
) use ( ) use (
@ -189,7 +187,6 @@ class PhpStormMetaScanner
} elseif ($element_type_offset !== null) { } elseif ($element_type_offset !== null) {
$codebase->methods->return_type_provider->registerClosure( $codebase->methods->return_type_provider->registerClosure(
$meta_fq_classlike_name, $meta_fq_classlike_name,
static function ( static function (
MethodReturnTypeProviderEvent $event MethodReturnTypeProviderEvent $event
) use ( ) use (
@ -246,7 +243,6 @@ class PhpStormMetaScanner
$codebase->functions->return_type_provider->registerClosure( $codebase->functions->return_type_provider->registerClosure(
$function_id, $function_id,
static function ( static function (
FunctionReturnTypeProviderEvent $event FunctionReturnTypeProviderEvent $event
) use ( ) use (
@ -297,7 +293,6 @@ class PhpStormMetaScanner
} elseif ($type_offset !== null) { } elseif ($type_offset !== null) {
$codebase->functions->return_type_provider->registerClosure( $codebase->functions->return_type_provider->registerClosure(
$function_id, $function_id,
static function ( static function (
FunctionReturnTypeProviderEvent $event FunctionReturnTypeProviderEvent $event
) use ( ) use (
@ -328,7 +323,6 @@ class PhpStormMetaScanner
} elseif ($element_type_offset !== null) { } elseif ($element_type_offset !== null) {
$codebase->functions->return_type_provider->registerClosure( $codebase->functions->return_type_provider->registerClosure(
$function_id, $function_id,
static function ( static function (
FunctionReturnTypeProviderEvent $event FunctionReturnTypeProviderEvent $event
) use ( ) use (

View File

@ -36,11 +36,9 @@ use function strtolower;
*/ */
class ParseTreeCreator class ParseTreeCreator
{ {
/** @var ParseTree */ private ParseTree $parse_tree;
private $parse_tree;
/** @var ParseTree */ private ParseTree $current_leaf;
private $current_leaf;
/** @var array<int, array{0: string, 1: int, 2?: string}> */ /** @var array<int, array{0: string, 1: int, 2?: string}> */
private array $type_tokens; private array $type_tokens;