From 67412124a43904bf78e78f783e8f1d0254dc7083 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 1 Dec 2021 19:59:22 +0200 Subject: [PATCH] fix syntax error under PHP 7.3 7.3 is still the minimum requirement for 21.1 --- api/src/Etemplate/Widget.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget.php b/api/src/Etemplate/Widget.php index 8f0ffac02f..79ed256ae6 100644 --- a/api/src/Etemplate/Widget.php +++ b/api/src/Etemplate/Widget.php @@ -568,7 +568,10 @@ class Widget $types = $paramType instanceof \ReflectionUnionType ? $paramType->getTypes() : [$paramType]; - if(in_array('array', array_map(fn(\ReflectionNamedType $t) => $t->getName(), $types)) && !is_array($params[$index])) + if(in_array('array', array_map(static function(\ReflectionNamedType $t) + { + return $t->getName(); + }, $types)) && !is_array($params[$index])) { error_log("$method_name expects an array for {$param->getPosition()}: {$param->getName()}"); $params[$index] = (array)$params[$index];