/** * 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; }
/** * Adds an additional propery to the given <b>$rule</b> instance. * * @param PHP_PMD_AbstractRule $rule The context rule object. * @param SimpleXMLElement $node The raw xml property node. * * @return void */ private function _addProperty(PHP_PMD_AbstractRule $rule, SimpleXMLElement $node) { $name = trim($node['name']); $value = trim($this->_getPropertyValue($node)); if ($name !== '' && $value !== '') { $rule->addProperty($name, $value); } }