fix syntax error under PHP 7.3

7.3 is still the minimum requirement for 21.1
This commit is contained in:
Ralf Becker 2021-12-01 19:59:22 +02:00
parent 0435f3a4a5
commit 67412124a4

View File

@ -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];