Skip to content

Commit

Permalink
Display type correctly for constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
bolmstedt committed Dec 18, 2014
1 parent 7bc6dde commit 49f19d8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/php/PHPMD/Rule/Design/LongMethod.php
Expand Up @@ -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
)
);
}
}

0 comments on commit 49f19d8

Please sign in to comment.