mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Remove array properties that are never read
This commit is contained in:
parent
b558748db2
commit
4229045c23
@ -95,14 +95,6 @@ class Codebase
|
|||||||
*/
|
*/
|
||||||
public $use_referencing_locations = [];
|
public $use_referencing_locations = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* A map of file names to the classes that they contain explicit references to
|
|
||||||
* used in collaboration with use_referencing_locations
|
|
||||||
*
|
|
||||||
* @var array<string, array<lowercase-string, bool>>
|
|
||||||
*/
|
|
||||||
public $use_referencing_files = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var FileStorageProvider
|
* @var FileStorageProvider
|
||||||
*/
|
*/
|
||||||
|
@ -235,11 +235,6 @@ class Context
|
|||||||
*/
|
*/
|
||||||
public $parent_context;
|
public $parent_context;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, Type\Union>
|
|
||||||
*/
|
|
||||||
public $possible_param_types = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of vars that have been assigned to
|
* A list of vars that have been assigned to
|
||||||
*
|
*
|
||||||
|
@ -72,8 +72,6 @@ trait CanAlias
|
|||||||
// register the path
|
// register the path
|
||||||
$codebase->use_referencing_locations[$use_path_lc][] =
|
$codebase->use_referencing_locations[$use_path_lc][] =
|
||||||
new CodeLocation($this, $use);
|
new CodeLocation($this, $use);
|
||||||
|
|
||||||
$codebase->use_referencing_files[$this->getFilePath()][$use_path_lc] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codebase->alter_code) {
|
if ($codebase->alter_code) {
|
||||||
|
@ -459,12 +459,6 @@ class IfElseAnalyzer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($if_scope->possible_param_types) {
|
|
||||||
foreach ($if_scope->possible_param_types as $var => $type) {
|
|
||||||
$context->possible_param_types[$var] = $type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($if_scope->reasonable_clauses
|
if ($if_scope->reasonable_clauses
|
||||||
&& (count($if_scope->reasonable_clauses) > 1 || !$if_scope->reasonable_clauses[0]->wedge)
|
&& (count($if_scope->reasonable_clauses) > 1 || !$if_scope->reasonable_clauses[0]->wedge)
|
||||||
) {
|
) {
|
||||||
|
@ -1285,19 +1285,6 @@ class ClassLikeNodeScanner
|
|||||||
}
|
}
|
||||||
|
|
||||||
$constant_storage->description = $description;
|
$constant_storage->description = $description;
|
||||||
|
|
||||||
foreach ($stmt->attrGroups as $attr_group) {
|
|
||||||
foreach ($attr_group->attrs as $attr) {
|
|
||||||
$constant_storage->attributes[] = AttributeResolver::resolve(
|
|
||||||
$this->codebase,
|
|
||||||
$this->file_scanner,
|
|
||||||
$this->file_storage,
|
|
||||||
$this->aliases,
|
|
||||||
$attr,
|
|
||||||
$this->storage->name ?? null
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1368,7 +1368,7 @@ class FunctionLikeDocblockScanner
|
|||||||
): array {
|
): array {
|
||||||
$storage->template_types = [];
|
$storage->template_types = [];
|
||||||
|
|
||||||
foreach ($docblock_info->templates as $i => $template_map) {
|
foreach ($docblock_info->templates as $template_map) {
|
||||||
$template_name = $template_map[0];
|
$template_name = $template_map[0];
|
||||||
|
|
||||||
if ($template_map[1] !== null && $template_map[2] !== null) {
|
if ($template_map[1] !== null && $template_map[2] !== null) {
|
||||||
@ -1416,8 +1416,6 @@ class FunctionLikeDocblockScanner
|
|||||||
'fn-' . strtolower($cased_function_id) => $template_type,
|
'fn-' . strtolower($cased_function_id) => $template_type,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$storage->template_covariants[$i] = $template_map[3];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_merge($template_types ?: [], $storage->template_types);
|
return array_merge($template_types ?: [], $storage->template_types);
|
||||||
|
@ -74,13 +74,6 @@ class IfScope
|
|||||||
*/
|
*/
|
||||||
public $reasonable_clauses = [];
|
public $reasonable_clauses = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Variables that were mixed, but are no longer
|
|
||||||
*
|
|
||||||
* @var array<string, Type\Union>|null
|
|
||||||
*/
|
|
||||||
public $possible_param_types;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
|
@ -38,11 +38,6 @@ class ClassConstantStorage
|
|||||||
*/
|
*/
|
||||||
public $deprecated = false;
|
public $deprecated = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var list<AttributeStorage>
|
|
||||||
*/
|
|
||||||
public $attributes = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ?string
|
* @var ?string
|
||||||
*/
|
*/
|
||||||
|
@ -120,11 +120,6 @@ abstract class FunctionLikeStorage
|
|||||||
*/
|
*/
|
||||||
public $template_types;
|
public $template_types;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<int, bool>|null
|
|
||||||
*/
|
|
||||||
public $template_covariants;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array<int, Assertion>
|
* @var array<int, Assertion>
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user