mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Improve resilience of typechecker::isContainedBy
This commit is contained in:
parent
7609ca02c0
commit
df941bd575
@ -699,10 +699,12 @@ class TypeChecker
|
||||
$input_is_object = $input_type_part->isObjectType();
|
||||
$container_is_object = $container_type_part->isObjectType();
|
||||
|
||||
if ($input_type_part->value === $container_type_part->value ||
|
||||
if (strtolower($input_type_part->value) === strtolower($container_type_part->value) ||
|
||||
(
|
||||
$input_is_object &&
|
||||
$container_is_object &&
|
||||
!$input_type_part->isObject() &&
|
||||
ClassChecker::classExists($input_type_part->value, $file_checker) &&
|
||||
(
|
||||
ClassChecker::classExtendsOrImplements(
|
||||
$input_type_part->value,
|
||||
|
@ -386,7 +386,7 @@ class Config
|
||||
|
||||
require_once($path);
|
||||
|
||||
if (!ClassLikeChecker::classExtends($declared_classes[0], 'Psalm\\Checker\\FileChecker')) {
|
||||
if (!\Psalm\Checker\ClassChecker::classExtends($declared_classes[0], 'Psalm\\Checker\\FileChecker')) {
|
||||
throw new \InvalidArgumentException(
|
||||
'Filetype handlers must extend \Psalm\Checker\FileChecker - ' . $path . ' does not'
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user