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

Added Psalm\Codebase::isTypeContainedByType()

This commit is contained in:
Bruce Weirdan 2019-02-18 22:40:47 +02:00 committed by Matthew Brown
parent 3fdef1a032
commit e87f500458

View File

@ -4,6 +4,7 @@ namespace Psalm;
use LanguageServerProtocol\{Position, Range};
use PhpParser;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Analyzer\TypeAnalyzer;
use Psalm\Internal\Provider\ClassLikeStorageProvider;
use Psalm\Internal\Provider\FileProvider;
use Psalm\Internal\Provider\FileReferenceProvider;
@ -1148,4 +1149,10 @@ class Codebase
{
$this->file_provider->removeTemporaryFileChanges($file_path);
}
public function isTypeContainedByType(
Type\Union $input_type,
Type\Union $container_type
): bool {
return TypeAnalyzer::isContainedBy($this, $input_type, $container_type);
}
}