1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Consider emptiness for array_count_values()

Fixes vimeo/psalm#7044
This commit is contained in:
Bruce Weirdan 2021-12-02 04:51:06 +02:00
parent 826b26bf6b
commit dc271fe25c
No known key found for this signature in database
GPG Key ID: CFC3AAB181751B0D

View File

@ -1084,10 +1084,11 @@ function str_getcsv(string $string, string $separator = ',', string $enclosure =
/**
* @template TKey as array-key
* @template TArray as array<mixed, TKey>
*
* @param array<mixed, TKey> $array
* @param TArray $array
*
* @return array<TKey, positive-int>
* @return (TArray is non-empty-array ? non-empty-array<TKey, positive-int> : array<empty, empty>)
*
* @psalm-pure
*/