1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Support ext-ds and fix offset count

This commit is contained in:
Brown 2019-10-18 11:35:24 -04:00
parent dda68228f3
commit 89752b8574
3 changed files with 1883 additions and 2 deletions

View File

@ -1517,7 +1517,19 @@ class Config
throw new \UnexpectedValueException('Cannot locate core generic classes');
}
$stub_files = array_merge([$generic_stubs_path, $generic_classes_path], $this->stub_files);
$core_generic_files = [$generic_stubs_path, $generic_classes_path];
if (\extension_loaded('ds')) {
$ext_ds_path = __DIR__ . '/Internal/Stubs/ext-ds.php';
if (!file_exists($ext_ds_path)) {
throw new \UnexpectedValueException('Cannot locate core generic classes');
}
$core_generic_files[] = $ext_ds_path;
}
$stub_files = array_merge($core_generic_files, $this->stub_files);
$phpstorm_meta_path = $this->base_dir . DIRECTORY_SEPARATOR . '.phpstorm.meta.php';

View File

@ -261,7 +261,7 @@ class ReturnTypeCollector
switch (count($type->type_params)) {
case 1:
$key_type_param = Type::getMixed();
$value_type_param = $type->type_params[1];
$value_type_param = $type->type_params[0];
break;
default:

File diff suppressed because it is too large Load Diff