PHPMD\RuleSetFactory::getIgnorePattern PHP Method

getIgnorePattern() public method

http://pmd.sourceforge.net/pmd-5.0.4/howtomakearuleset.html#Excluding_files_from_a_ruleset
public getIgnorePattern ( $fileName ) : array
$fileName The filename of a rule-set definition.
return array
    public function getIgnorePattern($fileName)
    {
        $excludes = array();
        foreach (array_map('trim', explode(',', $fileName)) as $ruleSetFileName) {
            $ruleSetFileName = $this->createRuleSetFileName($ruleSetFileName);
            // Hide error messages
            $libxml = libxml_use_internal_errors(true);
            $xml = simplexml_load_string(file_get_contents($ruleSetFileName));
            if ($xml === false) {
                // Reset error handling to previous setting
                libxml_use_internal_errors($libxml);
                throw new \RuntimeException(trim(libxml_get_last_error()->message));
            }
            foreach ($xml->children() as $node) {
                if ($node->getName() === 'exclude-pattern') {
                    $excludes[] = '' . $node;
                }
            }
            return $excludes;
        }
    }