public function visitFuncDecl(Decl $node) : Context
{
$method = $this->context->getFunctionLikeInScope($this->code_base);
$return_type = $method->getUnionType();
if (!$return_type->isEmpty() && !$method->getHasReturn() && !$this->declOnlyThrows($node) && !$return_type->hasType(VoidType::instance()) && !$return_type->hasType(NullType::instance())) {
$this->emitIssue(Issue::TypeMissingReturn, $node->lineno ?? 0, (string) $method->getFQSEN(), (string) $return_type);
}
$parameters_seen = [];
foreach ($method->getParameterList() as $i => $parameter) {
if (isset($parameters_seen[$parameter->getName()])) {
$this->emitIssue(Issue::ParamRedefined, $node->lineno ?? 0, '$' . $parameter->getName());
} else {
$parameters_seen[$parameter->getName()] = $i;
}
}
return $this->context;
}