diff --git a/src/main/php/PHPMD/Rule/Design/LongMethod.php b/src/main/php/PHPMD/Rule/Design/LongMethod.php index be0a74c89..f8f07394d 100644 --- a/src/main/php/PHPMD/Rule/Design/LongMethod.php +++ b/src/main/php/PHPMD/Rule/Design/LongMethod.php @@ -78,9 +78,14 @@ public function apply(AbstractNode $node) return; } - $type = explode('_', get_class($node)); - $type = strtolower(array_pop($type)); - - $this->addViolation($node, array($type, $node->getName(), $loc, $threshold)); + $this->addViolation( + $node, + array( + $node->getType(), + $node->getName(), + $loc, + $threshold + ) + ); } }