The return typehint provided for the function is either invalid or not present in the current namespace.
The issue is also raised when native union types are used for PHP < 8.0. Native union types can only be used with PHP >= 8.0.
class SomeTypehints {}
function foo(SomeTypehints $foo, $bar, array $lorem): DNE // invalid type DNE
{
}
class SomeTypehints {}
class DNE {}
function foo(SomeTypehints $foo, $bar, array $lorem): DNE
{
}