From 1d6ca9bd7d72c534eadaeec0aeac6a4375c0181e Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sun, 20 Oct 2019 15:33:57 -0400 Subject: [PATCH] Allow callable-array type in docblocks --- src/Psalm/Type.php | 1 + src/Psalm/Type/Atomic.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/Psalm/Type.php b/src/Psalm/Type.php index 5da9fbd0d..fd793aac2 100644 --- a/src/Psalm/Type.php +++ b/src/Psalm/Type.php @@ -85,6 +85,7 @@ abstract class Type 'numeric-string' => true, 'class-string' => true, 'callable-string' => true, + 'callable-array' => true, 'trait-string' => true, 'mysql-escaped-string' => true, 'html-escaped-string' => true, diff --git a/src/Psalm/Type/Atomic.php b/src/Psalm/Type/Atomic.php index 5e2de1938..ab0bc1cea 100644 --- a/src/Psalm/Type/Atomic.php +++ b/src/Psalm/Type/Atomic.php @@ -163,6 +163,9 @@ abstract class Atomic case 'non-empty-array': return new TNonEmptyArray([new Union([new TMixed]), new Union([new TMixed])]); + case 'callable-array': + return new Type\Atomic\TCallableArray([new Union([new TArrayKey]), new Union([new TMixed])]); + case 'list': return new TList(Type::getMixed());