From 734978e9cd1480f79b7a4deee0ddf6ffbfd984f8 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sun, 20 Sep 2020 17:38:41 +0200 Subject: [PATCH] Use callable type hint for $block argument to Assert::throws() --- src/main/php/unittest/Assert.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/php/unittest/Assert.class.php b/src/main/php/unittest/Assert.class.php index b087a54..5863ae2 100755 --- a/src/main/php/unittest/Assert.class.php +++ b/src/main/php/unittest/Assert.class.php @@ -96,13 +96,13 @@ public static function instance($type, $actual, $error= 'instanceof') { * Assert that a given exception is raised * * @param string|lang.Type $type - * @param callable $func + * @param callable $block * @return void */ - public static function throws($type, $func) { + public static function throws($type, callable $block) { $t= $type instanceof Type ? $type : Type::forName($type); try { - $func(); + $block(); } catch (\Throwable $expected) { if ($t->isInstance($expected)) return;