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