Example #1
0
 /**
  * Builds a method object based on the provided method scanner
  *
  * @param  MethodScanner $classMethod
  * @return Method
  */
 protected function buildMethod(MethodScanner $classMethod)
 {
     $method = new Method($classMethod->getName());
     $method->setNumberOfParameters($classMethod->getNumberOfParameters());
     // Loop through annotations
     if ($annotations = $classMethod->getAnnotations($this->annotationManager)) {
         foreach ($annotations as $annotation) {
             // @todo annotations should implement some kind of interface?
             if (method_exists($annotation, 'decorateObject')) {
                 $annotation->decorateObject($method);
             }
         }
     }
     return $method;
 }
Example #2
0
 /**
  * Add a method
  *
  * @param Method $method
  */
 public function addMethod(Method $method)
 {
     $this->methods[$method->getObjectName()] = $method;
 }