mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
parent
471d7610f0
commit
2c48d42904
@ -625,7 +625,7 @@ class Union
|
||||
*/
|
||||
public function hasArray()
|
||||
{
|
||||
return isset($this->types['array']);
|
||||
return isset($this->types['array']) || isset($this->types['callable-array']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -713,6 +713,24 @@ class CallableTest extends TestCase
|
||||
}
|
||||
}'
|
||||
],
|
||||
'destructureCallableArray' => [
|
||||
'<?php
|
||||
function getCallable(): callable {
|
||||
return [DateTimeImmutable::class, "createFromFormat"];
|
||||
}
|
||||
|
||||
$callable = getCallable();
|
||||
|
||||
if (!is_array($callable)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
[$classOrObject, $method] = $callable;',
|
||||
[
|
||||
'$classOrObject' => 'class-string|object',
|
||||
'$method' => 'string'
|
||||
]
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user