mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Limit constructor check invalidation
This commit is contained in:
parent
d5186308d0
commit
61ecd2a5fe
@ -642,7 +642,22 @@ class Analyzer
|
||||
if (isset($all_referencing_methods[$unchanged_signature_member_id])) {
|
||||
foreach ($all_referencing_methods[$unchanged_signature_member_id] as $referencing_method_id => $_) {
|
||||
if (substr($referencing_method_id, -13) === '::__construct') {
|
||||
$newly_invalidated_methods[$referencing_method_id] = true;
|
||||
$referencing_base_classlike = explode('::', $referencing_method_id)[0];
|
||||
$unchanged_signature_classlike = explode('::', $unchanged_signature_member_id)[0];
|
||||
|
||||
if ($referencing_base_classlike === $unchanged_signature_classlike) {
|
||||
$newly_invalidated_methods[$referencing_method_id] = true;
|
||||
} else {
|
||||
$referencing_storage = $codebase->classlike_storage_provider->get(
|
||||
$referencing_base_classlike
|
||||
);
|
||||
|
||||
if (isset($referencing_storage->used_traits[$unchanged_signature_classlike])
|
||||
|| isset($referencing_storage->parent_classes[$unchanged_signature_classlike])
|
||||
) {
|
||||
$newly_invalidated_methods[$referencing_method_id] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ class ClassLikeStorage
|
||||
/**
|
||||
* Parent classes
|
||||
*
|
||||
* @var array<string, string>
|
||||
* @var array<lowercase-string, string>
|
||||
*/
|
||||
public $parent_classes = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user