Code Duplication    Length = 8-9 lines in 2 locations

src/main/php/PHPMD/Rule/Design/EmptyCatchBlock.php 1 location

@@ 40-48 (lines=9) @@
37
     * @param \PHPMD\AbstractNode $node
38
     * @return void
39
     */
40
    public function apply(AbstractNode $node)
41
    {
42
        foreach ($node->findChildrenOfType('CatchStatement') as $catchBlock) {
43
            $scope = $catchBlock->getFirstChildOfType('ScopeStatement');
44
            if (count($scope->getChildren()) == 0) {
45
                $this->addViolation($catchBlock, array($node->getName()));
46
            }
47
        }
48
    }
49
}
50

src/main/php/PHPMD/Rule/Naming/ConstantNamingConventions.php 1 location

@@ 38-45 (lines=8) @@
35
     * @param \PHPMD\AbstractNode $node
36
     * @return void
37
     */
38
    public function apply(AbstractNode $node)
39
    {
40
        foreach ($node->findChildrenOfType('ConstantDeclarator') as $declarator) {
41
            if ($declarator->getImage() !== strtoupper($declarator->getImage())) {
42
                $this->addViolation($declarator, array($declarator->getImage()));
43
            }
44
        }
45
    }
46
}
47