Exemple #1
0
 /**
  * Checks if this annotation suppresses the given rule.
  *
  * @param PHP_PMD_Rule $rule The rule to check.
  *
  * @return boolean
  */
 private function _suppresses(PHP_PMD_Rule $rule)
 {
     if (in_array($this->_value, array('PHPMD', 'PMD'))) {
         return true;
     } else {
         if (strpos($this->_value, 'PMD.' . $rule->getName()) !== false) {
             return true;
         }
     }
     return stripos($rule->getName(), $this->_value) !== false;
 }
 /**
  * Checks if the given rule is included/not excluded by the given rule-set
  * reference node.
  *
  * @param PHP_PMD_Rule     $rule        The currently processed rule.
  * @param SimpleXMLElement $ruleSetNode The context rule-set xml element.
  *
  * @return boolean
  * @since 0.2.3
  */
 private function isIncluded(PHP_PMD_Rule $rule, SimpleXMLElement $ruleSetNode)
 {
     foreach ($ruleSetNode->exclude as $exclude) {
         if ($rule->getName() === (string) $exclude['name']) {
             return false;
         }
     }
     return true;
 }