/** * @param ClassMethod $classMethod * @param bool $overwrite Should we overwrite method if it already exists * @return bool Did we overwrite method? */ public function addMethod(ClassMethod $classMethod, $overwrite = true) { if ($overwrite) { $this->methods[$classMethod->getName()] = $classMethod; } else { $name = $classMethod->getName(); if (isset($this->methods[$name])) { return false; } else { $this->methods[$name] = $classMethod; } } return true; }
/** * @param ClassMethod $methodDefintion */ public function addMethod(ClassMethod $methodDefintion) { $this->methods[$methodDefintion->getName()] = $methodDefintion; }