1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Allow pure-Callable type to be annotated

This commit is contained in:
Brown 2020-08-28 13:15:04 -04:00
parent 63b74276c6
commit 1825e30752
2 changed files with 5 additions and 1 deletions

View File

@ -745,7 +745,10 @@ class ParseTreeCreator
break;
case '(':
if (in_array(strtolower($type_token[0]), ['closure', 'callable', '\closure', 'pure-callable'], true)) {
if (in_array(
$type_token[0],
['callable', 'pure-callable', 'Closure', '\Closure', 'pure-Closure'], true
)) {
$new_leaf = new ParseTree\CallableTree(
$type_token[0],
$new_parent

View File

@ -42,6 +42,7 @@ class TypeTokenizer
'callable-string' => true,
'callable-array' => true,
'pure-callable' => true,
'pure-Closure' => true,
'trait-string' => true,
'mysql-escaped-string' => true,
'html-escaped-string' => true,