mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Prevent internal consumers of classExists from being penalised
This commit is contained in:
parent
472ab29d74
commit
0da3623372
@ -682,7 +682,7 @@ class Codebase
|
|||||||
*/
|
*/
|
||||||
public function classExtends($fq_class_name, $possible_parent)
|
public function classExtends($fq_class_name, $possible_parent)
|
||||||
{
|
{
|
||||||
return $this->classlikes->classExtends($fq_class_name, $possible_parent);
|
return $this->classlikes->classExtends($fq_class_name, $possible_parent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -413,7 +413,7 @@ class ClassLikes
|
|||||||
* @throws UnpopulatedClasslikeException when called on unpopulated class
|
* @throws UnpopulatedClasslikeException when called on unpopulated class
|
||||||
* @throws \InvalidArgumentException when class does not exist
|
* @throws \InvalidArgumentException when class does not exist
|
||||||
*/
|
*/
|
||||||
public function classExtends($fq_class_name, $possible_parent)
|
public function classExtends($fq_class_name, $possible_parent, bool $from_api = false)
|
||||||
{
|
{
|
||||||
$fq_class_name_lc = strtolower($fq_class_name);
|
$fq_class_name_lc = strtolower($fq_class_name);
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ class ClassLikes
|
|||||||
|
|
||||||
$class_storage = $this->classlike_storage_provider->get($fq_class_name_lc);
|
$class_storage = $this->classlike_storage_provider->get($fq_class_name_lc);
|
||||||
|
|
||||||
if (!$class_storage->populated) {
|
if ($from_api && !$class_storage->populated) {
|
||||||
throw new UnpopulatedClasslikeException($fq_class_name);
|
throw new UnpopulatedClasslikeException($fq_class_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user