Add a call to the instance method.
@param MethodReflection $sourceMethod
977822
function addPlainMethod(MethodReflection $sourceMethod) {

        $parameters = $sourceMethod->getParameters();
        $paramArray = [];
        foreach ($parameters as $parameter) {
            $paramArray[] = '$'.$parameter->getName();
        }

        $paramList = implode(', ', $paramArray);

        $weavedMethod = MethodGenerator::fromReflection($sourceMethod);

        $body = sprintf(
            " return \$this->%s->%s(%s);",
            $this->implementWeaveInfo->getInstancePropertyName(),
            $sourceMethod->getName(),
            $paramList
        );
        
        $weavedMethod->setBody($body);
        $this->generator->addMethodFromGenerator($weavedMethod);
    }
653995
public static void addGeneratedMethod(ClassNode cNode, MethodNode mNode) {
        cNode.addMethod(mNode);
        markAsGenerated(cNode, mNode);
    }
314094
public function addSources(SourceFileCollection $sources)
    {
        foreach ($sources as $source) {
            $this->addSource($source);
        }

        return $this;
    }
328514
protected void makeMethodDoc(MethodSymbol meth, TreePath treePath) {
        MethodDocImpl result = (MethodDocImpl)methodMap.get(meth);
        if (result != null) {
            if (treePath != null) result.setTreePath(treePath);
        } else {
            result = new MethodDocImpl(this, meth, treePath);
            methodMap.put(meth, result);
        }
    }
1269020
public function addMethod($name, $method) 
	{
		$this->methods[$name] = array(
			'name' => $name,
			'call' => $method
		);
		xmlrpc_server_register_method( $this->xmlrpc, $name, array( $this, 'call' ) );
	}
1306705
@Nonnull
    public BugInstance addMethod(PreorderVisitor visitor) {
        MethodAnnotation methodAnnotation = MethodAnnotation.fromVisitedMethod(visitor);
        addMethod(methodAnnotation);
        addSourceLinesForMethod(methodAnnotation, SourceLineAnnotation.fromVisitedMethod(visitor));
        return this;
    }
1109264
public function addMethod(MethodGenerator $method)
    {
        $name = $method->getName();
        if (isset($this->methods[$name]) === true) {
            throw new InvalidArgumentException('Method name "' . $name . '" already added.');
        }

        $this->methods[$name] = $method;
    }
1110868
public function create(ClassReflection $classReflection, \ReflectionMethod $methodReflection, string $methodWrapper = null): MethodReflection
    {
        $phpDocParameterTypes = [];
        $phpDocReturnType = null;
        if ($methodReflection->getDocComment() !== false) {
            $phpDocBlock = PhpDocBlock::resolvePhpDocBlockForMethod(
                Broker::getInstance(),
                $methodReflection->getDocComment(),
                $methodReflection->getDeclaringClass()->getName(),
                $methodReflection->getName(),
                $methodReflection->getFileName()
            );

            $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc(
                $phpDocBlock->getFile(),
                $phpDocBlock->getClass(),
                $phpDocBlock->getDocComment()
            );
            $phpDocParameterTypes = array_map(function (ParamTag $tag): Type {
                return $tag->getType();
            }, $resolvedPhpDoc->getParamTags());
            $phpDocReturnType = $resolvedPhpDoc->getReturnTag() !== null ? $resolvedPhpDoc->getReturnTag()->getType() : null;
        }

        if ($methodWrapper) {
            $methodReflection = new $methodWrapper($methodReflection);
        }

        return $this->methodReflectionFactory->create(
            $classReflection,
            $methodReflection,
            $phpDocParameterTypes,
            $phpDocReturnType
        );
    }
458360
public function addMethod(Method $method): void
    {
        $this->methods[(string) $method->getFqsen()] = $method;
    }
918055
protected function addMethodsToBuilder(ClassBuilder $builder, callable $resolveCall)
    {
        foreach (array_unique($this->expectedStaticMethodCalls) as $methodCall) {
            $inspector = new MethodInspector($this->className, $methodCall);
            $builder->addStaticMethod($methodCall, $resolveCall, $inspector->signatureArgs());
        }
        return $builder;
    }
1314298
public void addProxyMethods(TypeSpec.Builder classBuilder) {
        processRemoterElements(classBuilder, new ElementVisitor() {
            @Override
            public void visitElement(TypeSpec.Builder classBuilder, Element member, int methodIndex, MethodSpec.Builder methodBuilder) {
                addProxyMethods(classBuilder, member, methodIndex);
            }
        }, null);

        addProxyExtras(classBuilder);
        addCommonExtras(classBuilder);
    }
1032221
public static function fromReflection(ReflectionMethod $reflectionMethod)
    {
        $method = new static($reflectionMethod->getName());
        foreach ($reflectionMethod->getParameters() as $parameter) {
            $method->addParameter(ParameterGenerator::fromReflection($parameter));
        }

        $method->setFinal($reflectionMethod->isFinal());
        $method->setAbstract($reflectionMethod->isAbstract());

        if ($reflectionMethod->isStatic() === true) {
            $method->setStatic(true);
        }

        if ($reflectionMethod->isPrivate() === true) {
            $method->setVisibility(Modifiers::VISIBILITY_PRIVATE);
        } elseif ($reflectionMethod->isProtected() === true) {
            $method->setVisibility(Modifiers::VISIBILITY_PROTECTED);
        } else {
            $method->setVisibility(Modifiers::VISIBILITY_PUBLIC);
        }

        if ($reflectionMethod->getReflectionDocComment()->isEmpty() !== true) {
            $method->setDocumentation(
                DocCommentGenerator::fromReflection($reflectionMethod->getReflectionDocComment())
            );
        }

        if ($reflectionMethod->isAbstract() !== true) {
            $body = trim($reflectionMethod->getBody());
            if ($body !== '') {
                $method->setBody($body);
            }
        }

        return $method;
    }
1327410
protected void addMethod(String k, ExecutableElement e, MethodModel exec) {
    ArrayList<ContractableMethod> list = methodMap.get(k);
    if (list == null) {
      list = new ArrayList<ContractableMethod>();
      methodMap.put(k, list);
    }
    list.add(new ContractableMethod(e, exec));
  }
128162
@SuppressWarnings("unused")
    @Internal
    @UsedByGeneratedCode
    protected final AbstractBeanDefinition<T> addExecutableMethod(ExecutableMethod<T, ?> executableMethod) {
        MethodKey key = new MethodKey(executableMethod.getMethodName(), executableMethod.getArgumentTypes());
        executableMethodMap.put(key, executableMethod);
        return this;
    }
1076439
protected function _initialize($property, $method) {
		if (is_string($method)) {
			$mode = self::MODE_JOIN;
			$sourcePrimary = null;
		}
		elseif (is_array($method)) {
			if (isset($method[self::SOURCE_METHOD], $method[self::SOURCE_MODE])) {
				$sourcePrimary = isset($method[self::SOURCE_PRIMARY]) ? $method[self::SOURCE_PRIMARY] : null;
				
				$mode   = $method[self::SOURCE_MODE];
				$method = $method[self::SOURCE_METHOD];
			}
			elseif (isset($method[0], $method[1])) {
				$sourcePrimary = isset($method[2]) ? $method[2] : null;
				
				$mode   = $method[1];
				$method = $method[0];
			}
			else {
				throw new Exception('Invalid source definition');
			}
		}
		else {
			throw new Exception('Source must be specified as a string or an array');
		}
		
		if ($this->hasCollection()) {
			$this->_initMany($property, $method, $mode, $sourcePrimary);
		} else {
			$this->_initOne($property, $method, $mode);
		}
	}
996423
public static SourceLineAnnotation fromVisitedMethod(MethodGen methodGen, String sourceFile) {
        LineNumberTable lineNumberTable = methodGen.getLineNumberTable(methodGen.getConstantPool());
        String className = methodGen.getClassName();
        int codeSize = methodGen.getInstructionList().getLength();
        if (lineNumberTable == null) {
            return createUnknown(className, sourceFile, 0, codeSize - 1);
        }
        return forEntireMethod(className, sourceFile, lineNumberTable, codeSize);
    }
985376
public function addMethods($object, array $method_aliases = [])
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('$object must be an object');
        }
        foreach ($method_aliases as $alias => $method) {
            $callable = [$object, $method];
            if (!is_callable($callable)) {
                $class = get_class($object);
                throw new \InvalidArgumentException("Method {$method} not found in class {$class}");
            }
            if (is_int($alias)) {
                $alias = $method;
            }
            $this->plugins[$alias] = $callable;
        }
    }