original_string: function addDecoratedMethod(MethodReflection $sourceMethod, MethodReflection $decoratorMethodReflection ) {
          $weavedMethod = MethodGenerator::fromReflection($sourceMethod);
          $newBody = $decoratorMethodReflection->getBody();
  
          $newBody = trimBody($newBody);
  
          $parameters = $sourceMethod->getParameters();
  
          $paramArray = [];
          $searchArray = [];
  
          $count = 0;
          foreach ($parameters as $parameter) {
              $searchArray[] = '$param'.$count;
              $paramArray[] = '$'.$parameter->getName();
          }
  
          $paramList = implode(', ', $paramArray);
  
          $newBody = str_replace(
              '$this->__prototype()',
              '$this->weavedInstance->'.$sourceMethod->getName()."($paramList)",
              $newBody
          );
  
          $newBody = str_replace($searchArray, $paramArray, $newBody);
          $weavedMethod->setBody($newBody);
          $this->generator->addMethodFromGenerator($weavedMethod);
      }
code: function addDecoratedMethod(MethodReflection $sourceMethod, MethodReflection $decoratorMethodReflection ) {
          $weavedMethod = MethodGenerator::fromReflection($sourceMethod);
          $newBody = $decoratorMethodReflection->getBody();
  
          $newBody = trimBody($newBody);
  
          $parameters = $sourceMethod->getParameters();
  
          $paramArray = [];
          $searchArray = [];
  
          $count = 0;
          foreach ($parameters as $parameter) {
              $searchArray[] = '$param'.$count;
              $paramArray[] = '$'.$parameter->getName();
          }
  
          $paramList = implode(', ', $paramArray);
  
          $newBody = str_replace(
              '$this->__prototype()',
              '$this->weavedInstance->'.$sourceMethod->getName()."($paramList)",
              $newBody
          );
  
          $newBody = str_replace($searchArray, $paramArray, $newBody);
          $weavedMethod->setBody($newBody);
          $this->generator->addMethodFromGenerator($weavedMethod);
      }
code_tokens: function addDecoratedMethod ( MethodReflection $ sourceMethod , MethodReflection $ decoratorMethodReflection ) { $ weavedMethod = MethodGenerator :: fromReflection ( $ sourceMethod ) ; $ newBody = $ decoratorMethodReflection -> getBody ( ) ; $ newBody = trimBody ( $ newBody ) ; $ parameters = $ sourceMethod -> getParameters ( ) ; $ paramArray = [ ] ; $ searchArray = [ ] ; $ count = 0 ; foreach ( $ parameters as $ parameter ) { $ searchArray [ ] = '$param' . $ count ; $ paramArray [ ] = '$' . $ parameter -> getName ( ) ; } $ paramList = implode ( ', ' , $ paramArray ) ; $ newBody = str_replace ( '$this->__prototype()' , '$this->weavedInstance->' . $ sourceMethod -> getName ( ) . "($paramList)" , $ newBody ) ; $ newBody = str_replace ( $ searchArray , $ paramArray , $ newBody ) ; $ weavedMethod -> setBody ( $ newBody ) ; $ this -> generator -> addMethodFromGenerator ( $ weavedMethod ) ; }
docstring: Decorate the method and call the instance.
  @param MethodReflection $sourceMethod
  @param MethodReflection $decoratorMethodReflection
docstring_tokens: Decorate the method and call the instance .