1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Allow specifying flags to Codebase::isTypeContainedByType

This commit is contained in:
Daniil Gentili 2024-03-15 12:15:05 +01:00
parent 4ea41cb69a
commit ad87c2e905

View File

@ -47,6 +47,7 @@ use Psalm\Internal\Provider\FileReferenceProvider;
use Psalm\Internal\Provider\FileStorageProvider;
use Psalm\Internal\Provider\Providers;
use Psalm\Internal\Provider\StatementsProvider;
use Psalm\Internal\Type\Comparator\TypeComparisonResult;
use Psalm\Internal\Type\Comparator\UnionTypeComparator;
use Psalm\Progress\Progress;
use Psalm\Progress\VoidProgress;
@ -2352,9 +2353,22 @@ final class Codebase
*/
public function isTypeContainedByType(
Union $input_type,
Union $container_type
Union $container_type,
bool $ignore_null = false,
bool $ignore_false = false,
bool $allow_interface_equality = false,
bool $allow_float_int_equality = true
): bool {
return UnionTypeComparator::isContainedBy($this, $input_type, $container_type);
return UnionTypeComparator::isContainedBy(
$this,
$input_type,
$container_type,
$ignore_null,
$ignore_false,
null,
$allow_interface_equality,
$allow_float_int_equality
);
}
/**