1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Simplify FunctionLikeDocblockScanner

This commit is contained in:
Matt Brown 2020-12-03 00:19:01 -05:00 committed by Daniil Gentili
parent 17d9db089f
commit 74b8198cb4
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 590 additions and 459 deletions

View File

@ -935,8 +935,22 @@ class AtomicPropertyFetchAnalyzer
}
}
private static function handleNonExistentProperty(StatementsAnalyzer $statements_analyzer, \Psalm\Codebase $codebase, PhpParser\Node\Expr\PropertyFetch $stmt, Context $contex, Config $config, ClassLikeStorage $class_storage, string $prop_name, TNamedObject $lhs_type_part, ?string $declaring_property_class, string $property_id, bool $in_assignment, ?string $stmt_var_id, bool $has_magic_getter, ?string $var_id): void
{
private static function handleNonExistentProperty(
StatementsAnalyzer $statements_analyzer,
\Psalm\Codebase $codebase,
PhpParser\Node\Expr\PropertyFetch $stmt,
Context $contex,
Config $config,
ClassLikeStorage $class_storage,
string $prop_name,
TNamedObject $lhs_type_part,
?string $declaring_property_class,
string $property_id,
bool $in_assignment,
?string $stmt_var_id,
bool $has_magic_getter,
?string $var_id
): void {
if ($config->use_phpdoc_property_without_magic_or_parent
&& isset($class_storage->pseudo_property_get_types['$' . $prop_name])
) {
@ -960,8 +974,8 @@ class AtomicPropertyFetchAnalyzer
$class_storage,
$declaring_property_class
? $codebase->classlike_storage_provider->get(
$declaring_property_class
) : $class_storage
$declaring_property_class
) : $class_storage
);
}

View File

@ -159,11 +159,6 @@ class FunctionDocblockComment
*/
public $templates = [];
/**
* @var array<int, array{template_type: string, param_name: string, line_number?: int}>
*/
public $template_typeofs = [];
/**
* @var array<int, array{type: string, param_name: string}>
*/