mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
Fix ReflectionParameter::isArray() was deprecated as of PHP 8.0.0
This commit is contained in:
parent
4fdefd61ae
commit
918d91eb9b
@ -558,7 +558,16 @@ class Widget
|
|||||||
error_log("Missing required parameter {$param->getPosition()}: {$param->getName()}");
|
error_log("Missing required parameter {$param->getPosition()}: {$param->getName()}");
|
||||||
$call = false;
|
$call = false;
|
||||||
}
|
}
|
||||||
if($param->isArray() && !is_array($params[$index]))
|
// Check to see if method wants an array, and we're providing it
|
||||||
|
$paramType = $param->getType();
|
||||||
|
if(!$paramType)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$types = $paramType instanceof \ReflectionUnionType
|
||||||
|
? $paramType->getTypes()
|
||||||
|
: [$paramType];
|
||||||
|
if(in_array('array', array_map(fn(\ReflectionNamedType $t) => $t->getName(), $types)) && !is_array($params[$index]))
|
||||||
{
|
{
|
||||||
error_log("$method_name expects an array for {$param->getPosition()}: {$param->getName()}");
|
error_log("$method_name expects an array for {$param->getPosition()}: {$param->getName()}");
|
||||||
$params[$index] = (array)$params[$index];
|
$params[$index] = (array)$params[$index];
|
||||||
|
Loading…
Reference in New Issue
Block a user