mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
makes array_combine return non-empty-array for most cases (#5393)
* makes array_combine return non-empty-array for most cases * Add back newline Co-authored-by: Matthew Brown <github@muglug.com>
This commit is contained in:
parent
f1a840727d
commit
dd4d970a37
@ -66,7 +66,7 @@ function array_intersect_assoc(array $arr, array $arr2, array ...$arr3)
|
||||
* @param array<mixed, TKey> $arr
|
||||
* @param array<mixed, TValue> $arr2
|
||||
*
|
||||
* @return array<TKey, TValue>|false
|
||||
* @return ($arr is non-empty-array ? non-empty-array<TKey, TValue>|false : array<empty, empty>|false)
|
||||
* @psalm-ignore-falsable-return
|
||||
* @psalm-pure
|
||||
*/
|
||||
|
@ -157,14 +157,14 @@ class ArrayFunctionCallTest extends TestCase
|
||||
'<?php
|
||||
$c = array_combine(["a", "b", "c"], [1, 2, 3]);',
|
||||
'assertions' => [
|
||||
'$c' => 'array<string, int>|false',
|
||||
'$c' => 'false|non-empty-array<string, int>',
|
||||
],
|
||||
],
|
||||
'arrayCombineFalse' => [
|
||||
'<?php
|
||||
$c = array_combine(["a", "b"], [1, 2, 3]);',
|
||||
'assertions' => [
|
||||
'$c' => 'array<string, int>|false',
|
||||
'$c' => 'false|non-empty-array<string, int>',
|
||||
],
|
||||
],
|
||||
'arrayMergeIntArrays' => [
|
||||
|
Loading…
x
Reference in New Issue
Block a user