Updates trans return type to be string or array

This commit is contained in:
Jeremy Smith 2021-08-18 15:03:54 +10:00
parent 76745c98f9
commit 6c425c1ac7

View File

@ -21,7 +21,7 @@ class TransHandler implements FunctionReturnTypeProviderInterface
$first_arg_type = $event->getStatementsSource()->getNodeTypeProvider()->getType($call_args[0]->value); $first_arg_type = $event->getStatementsSource()->getNodeTypeProvider()->getType($call_args[0]->value);
if ($first_arg_type && $first_arg_type->isString()) { if ($first_arg_type && $first_arg_type->isString()) {
return Type::getString(); return Type::combineUnionTypes(Type::getString(), Type::getArray());
} }
} }