The method getName() does not exist on ReflectionType. It seems like you code against a sub-type of ReflectionType such as ReflectionNamedType.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
43
if ('float' !== $reflection->getReturnType()?->/** @scrutinizer ignore-call */ getName()) {
Loading history...
44
throw new InvalidArgumentException('Time function must return float');
45
}
46
} catch (ReflectionException $e) {
47
throw new InvalidArgumentException('Time function has invalid signature: ' . $e->getMessage());