getDeclaringFunction() public method

Get the function (or method) that declared this parameter.
public getDeclaringFunction ( ) : ReflectionFunctionAbstract
return ReflectionFunctionAbstract
 /**
  * {@inheritDoc}
  */
 public function getDeclaringFunction()
 {
     $function = $this->betterReflectionParameter->getDeclaringFunction();
     if ($function instanceof BetterReflectionMethod) {
         return new ReflectionMethod($function);
     }
     return new ReflectionFunction($function);
 }
Exemplo n.º 2
0
 /**
  * @return string
  */
 public function getDescription()
 {
     $docBlock = new DocBlock($this->reflectionParameter->getDeclaringFunction()->getDocComment());
     /** @var \phpDocumentor\Reflection\DocBlock\Tag\ParamTag[] $paramTags */
     $paramTags = $docBlock->getTagsByName('param');
     foreach ($paramTags as $paramTag) {
         if ($paramTag->getVariableName() === '$' . $this->reflectionParameter->getName()) {
             $lines = Multiline::create($paramTag->getDescription());
             $lines->apply('ltrim');
             return (string) $lines;
         }
     }
     return '';
 }