Inheritance: extends AbstractDefinition
Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * @param ClassMethod $methodDefintion
  */
 public function addMethod(ClassMethod $methodDefintion)
 {
     $this->methods[$methodDefintion->getName()] = $methodDefintion;
 }