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);
|
$generic_type_value = self::fixScalarTerms($generic_type->value);
|
||||||
|
|
||||||
if ($generic_type_value === 'array' && count($generic_params) === 1) {
|
if ($generic_type_value === 'array' && count($generic_params) === 1) {
|
||||||
array_unshift($generic_params, new Union([
|
array_unshift($generic_params, Type::getMixed());
|
||||||
new Atomic('int'),
|
|
||||||
new Atomic('string')
|
|
||||||
]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$generic_params) {
|
if (!$generic_params) {
|
||||||
@ -221,10 +218,7 @@ abstract class Type
|
|||||||
$type = new Generic(
|
$type = new Generic(
|
||||||
'array',
|
'array',
|
||||||
[
|
[
|
||||||
new Union([
|
Type::getMixed(),
|
||||||
new Atomic('int'),
|
|
||||||
new Atomic('string')
|
|
||||||
]),
|
|
||||||
Type::getMixed()
|
Type::getMixed()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user