Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaGhostman/a9c430adaf76001259658a65199c5707 to your computer and use it in GitHub Desktop.
Save DaGhostman/a9c430adaf76001259658a65199c5707 to your computer and use it in GitHub Desktop.
diff --git a/src/Visitor/CodeCoverageMethodIgnoreVisitor.php b/src/Visitor/CodeCoverageMethodIgnoreVisitor.php
index f1bd6fd..305770d 100644
--- a/src/Visitor/CodeCoverageMethodIgnoreVisitor.php
+++ b/src/Visitor/CodeCoverageMethodIgnoreVisitor.php
@@ -53,6 +53,10 @@ final class CodeCoverageMethodIgnoreVisitor extends NodeVisitorAbstract
/** @var \ReflectionClass $reflection */
$reflection = $node->getAttribute(ReflectionVisitor::REFLECTION_CLASS_KEY);
+ if (!$reflection->hasMethod($node->name->toString())) {
+ return null;
+ }
+
$method = $reflection->getMethod($node->name->toString());
$docComment = $method->getDocComment();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment