mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 17:52:45 +01:00
Be more general with arrays
This commit is contained in:
parent
24fd84617f
commit
dff23e9d74
@ -82,10 +82,7 @@ abstract class Type
|
||||
$generic_type_value = self::fixScalarTerms($generic_type->value);
|
||||
|
||||
if ($generic_type_value === 'array' && count($generic_params) === 1) {
|
||||
array_unshift($generic_params, new Union([
|
||||
new Atomic('int'),
|
||||
new Atomic('string')
|
||||
]));
|
||||
array_unshift($generic_params, Type::getMixed());
|
||||
}
|
||||
|
||||
if (!$generic_params) {
|
||||
@ -221,10 +218,7 @@ abstract class Type
|
||||
$type = new Generic(
|
||||
'array',
|
||||
[
|
||||
new Union([
|
||||
new Atomic('int'),
|
||||
new Atomic('string')
|
||||
]),
|
||||
Type::getMixed(),
|
||||
Type::getMixed()
|
||||
]
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user