public function isVariadic() : bool
{
$isNativelyVariadic = $this->reflection->isVariadic();
if (!$isNativelyVariadic && $this->declaringClass->getName() === 'ReflectionMethod' && $this->reflection->getName() === 'invoke') {
return true;
}
if (!$isNativelyVariadic && $this->declaringClass->getNativeReflection()->getFileName() !== false) {
$key = sprintf('variadic-method-%s-%s-v2', $this->declaringClass->getName(), $this->reflection->getName());
$cachedResult = $this->cache->load($key);
if ($cachedResult === null) {
$nodes = $this->parser->parseFile($this->declaringClass->getNativeReflection()->getFileName());
$result = $this->callsFuncGetArgs($nodes);
$this->cache->save($key, $result);
return $result;
}
return $cachedResult;
}
return $isNativelyVariadic;
}