mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #3142 - array_unique should remove count info
This commit is contained in:
parent
d470903722
commit
e4bfe9e6be
@ -45,7 +45,13 @@ class ArrayUniqueReturnTypeProvider implements \Psalm\Plugin\Hook\FunctionReturn
|
||||
}
|
||||
|
||||
if ($first_arg_array instanceof Type\Atomic\TArray) {
|
||||
return new Type\Union([clone $first_arg_array]);
|
||||
$first_arg_array = clone $first_arg_array;
|
||||
|
||||
if ($first_arg_array instanceof Type\Atomic\TNonEmptyArray) {
|
||||
$first_arg_array->count = null;
|
||||
}
|
||||
|
||||
return new Type\Union([$first_arg_array]);
|
||||
}
|
||||
|
||||
if ($first_arg_array instanceof Type\Atomic\TList) {
|
||||
|
Loading…
Reference in New Issue
Block a user