Exemple #1
0
 /**
  * Checks if this annotation suppresses the given rule.
  *
  * @param PHP_PMD_AbstractRule $rule The rule to check.
  *
  * @return boolean
  */
 private function _suppresses(PHP_PMD_AbstractRule $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;
 }
Exemple #2
0
 /**
  * Checks if the given rule is included/not excluded by the given rule-set
  * reference node.
  *
  * @param PHP_PMD_AbstractRule $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_AbstractRule $rule, SimpleXMLElement $ruleSetNode)
 {
     foreach ($ruleSetNode->exclude as $exclude) {
         if ($rule->getName() === (string) $exclude['name']) {
             return false;
         }
     }
     return true;
 }