Skip to content

Commit

Permalink
Let the DocBlock::ofMethod handle an optional className
Browse files Browse the repository at this point in the history
Fixes #3879
  • Loading branch information
wgevaert authored and sebastianbergmann committed Oct 7, 2019
1 parent 4fffaf1 commit bf1782d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Util/Annotation/DocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static function ofClass(\ReflectionClass $class): self
);
}

public static function ofMethod(\ReflectionMethod $method): self
public static function ofMethod(\ReflectionMethod $method, string $className = null): self
{
return new self(
(string) $method->getDocComment(),
Expand All @@ -111,7 +111,7 @@ public static function ofMethod(\ReflectionMethod $method): self
$method->getEndLine(),
$method->getFileName(),
$method->getName(),
$method->getDeclaringClass()->getName()
$className ?? $method->getDeclaringClass()->getName()
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Util/Annotation/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ public function forMethod(string $class, string $method): DocBlock
);
}

return $this->methodDocBlocks[$class][$method] = DocBlock::ofMethod($reflection);
return $this->methodDocBlocks[$class][$method] = DocBlock::ofMethod($reflection, $class);
}
}

0 comments on commit bf1782d

Please sign in to comment.