diff --git a/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php b/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php index 1f3bff497..f44ab86de 100644 --- a/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php @@ -1187,7 +1187,6 @@ class ProjectAnalyzer public function setAllIssuesToFix(): void { - /** @var array $keyed_issues */ $keyed_issues = array_fill_keys(static::getSupportedIssuesToFix(), true); $this->setIssuesToFix($keyed_issues); diff --git a/src/Psalm/Internal/Fork/Pool.php b/src/Psalm/Internal/Fork/Pool.php index f0027ff8f..d08895dc3 100644 --- a/src/Psalm/Internal/Fork/Pool.php +++ b/src/Psalm/Internal/Fork/Pool.php @@ -287,7 +287,6 @@ class Pool // Create an array for the content received on each stream, // indexed by resource id. - /** @var array $content */ $content = array_fill_keys(array_keys($streams), ''); $terminationMessages = []; diff --git a/src/Psalm/Internal/Stubs/CoreGenericFunctions.php b/src/Psalm/Internal/Stubs/CoreGenericFunctions.php index 6586a4741..58aa04fbd 100644 --- a/src/Psalm/Internal/Stubs/CoreGenericFunctions.php +++ b/src/Psalm/Internal/Stubs/CoreGenericFunctions.php @@ -217,3 +217,17 @@ function array_key_exists($key, array $search) : bool function array_merge_recursive(array $arr, array ...$arr2) { } + +/** + * @psalm-template TKey as array-key + * @psalm-template TValue + * + * @param array $keys + * @param TValue $value + * + * @return array + * @psalm-pure + */ +function array_fill_keys(array $keys, $value): array +{ +} diff --git a/tests/FunctionCallTest.php b/tests/FunctionCallTest.php index b614e577f..898e339fa 100644 --- a/tests/FunctionCallTest.php +++ b/tests/FunctionCallTest.php @@ -2334,6 +2334,14 @@ class FunctionCallTest extends TestCase ); }' ], + 'arrayFillKeys' => [ + ' [ + '$result' => 'array', + ], + ], ]; }