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;
/**
* @var Progress
*/
public $progress;
public Progress $progress;
public bool $debug_lines = false;

View File

@ -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

View File

@ -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,

View File

@ -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)
{

View File

@ -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 (

View File

@ -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<int, array{0: string, 1: int, 2?: string}> */
private array $type_tokens;