/**
* @return Method[]
*/
public static function methodListFromReflectionClassAndMethod(Context $context, CodeBase $code_base, \ReflectionClass $class, \ReflectionMethod $reflection_method) : array
{
$method_fqsen = FullyQualifiedMethodName::fromStringInContext($reflection_method->getName(), $context);
$reflection_method = new \ReflectionMethod($class->getName(), $reflection_method->name);
$method = new Method($context, $reflection_method->name, new UnionType(), $reflection_method->getModifiers(), $method_fqsen);
$method->setNumberOfRequiredParameters($reflection_method->getNumberOfRequiredParameters());
$method->setNumberOfOptionalParameters($reflection_method->getNumberOfParameters() - $reflection_method->getNumberOfRequiredParameters());
if ($method->getIsMagicCall() || $method->getIsMagicCallStatic()) {
$method->setNumberOfOptionalParameters(999);
$method->setNumberOfRequiredParameters(0);
}
return self::functionListFromFunction($method, $code_base);
}