1
0
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:
Matthew Brown 2019-03-17 17:11:04 -04:00
parent 472ab29d74
commit 0da3623372
2 changed files with 3 additions and 3 deletions

View File

@ -682,7 +682,7 @@ class Codebase
*/
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);
}
/**

View File

@ -413,7 +413,7 @@ class ClassLikes
* @throws UnpopulatedClasslikeException when called on unpopulated class
* @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);
@ -425,7 +425,7 @@ class ClassLikes
$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);
}