public function getFunctionLikeInScope(CodeBase $code_base) : FunctionInterface
{
assert($this->isInFunctionLikeScope(), "Must be in method scope to get method.");
$fqsen = $this->getFunctionLikeFQSEN();
if ($fqsen instanceof FullyQualifiedFunctionName) {
assert($code_base->hasFunctionWithFQSEN($fqsen), "The function does not exist");
return $code_base->getFunctionByFQSEN($fqsen);
}
if ($fqsen instanceof FullyQualifiedMethodName) {
assert($code_base->hasMethodWithFQSEN($fqsen), "Method does not exist");
return $code_base->getMethodByFQSEN($fqsen);
}
assert(false, "FQSEN must be for a function or method");
}