gossi\codegen\model\AbstractPhpStruct::removeMethod PHP Method

removeMethod() public method

Removes a method
public removeMethod ( string | PhpMethod $nameOrMethod )
$nameOrMethod string | PhpMethod method name or Method instance
    public function removeMethod($nameOrMethod)
    {
        if ($nameOrMethod instanceof PhpMethod) {
            $nameOrMethod = $nameOrMethod->getName();
        }
        if (!$this->methods->has($nameOrMethod)) {
            throw new \InvalidArgumentException(sprintf('The method "%s" does not exist.', $nameOrMethod));
        }
        $m = $this->methods->get($nameOrMethod);
        $m->setParent(null);
        $this->methods->remove($nameOrMethod);
        return $this;
    }