PHP Класс PHPMD\RuleSetFactory

Автор: Manuel Pichler ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( ) Constructs a new default rule-set factory instance.
createRuleSets ( string $ruleSetFileNames ) : PHPMD\RuleSet[] Creates an array of rule-set instances for the given argument.
createSingleRuleSet ( string $ruleSetOrFileName ) : PHPMD\RuleSet Creates a single rule-set instance for the given filename or identifier.
getIgnorePattern ( $fileName ) : array Returns an array of path exclude patterns in format described at
listAvailableRuleSets ( ) : array(string) Lists available rule-set identifiers.
setMinimumPriority ( integer $minimumPriority ) : void Sets the minimum priority that a rule must have.
setStrict ( ) : void Activates the strict mode for all rule sets.

Приватные методы

Метод Описание
addProperty ( phpmd\Rule $rule, SimpleXMLElement $node ) : void Adds an additional property to the given $rule instance.
createRuleSetFileName ( string $ruleSetOrFileName ) : string This method creates the filename for a rule-set identifier or it returns the input when it is already a filename.
getPropertyValue ( SimpleXMLElement $propertyNode ) : string Returns the value of a property node. This value can be expressed in two different notations. First version is an attribute named value and the second valid notation is a child element named value that contains the value as character data.
isIncluded ( phpmd\Rule $rule, SimpleXMLElement $ruleSetNode ) : boolean Checks if the given rule is included/not excluded by the given rule-set reference node.
listRuleSetsInDirectory ( string $directory ) : array(string) Lists available rule-set identifiers in given directory.
parsePropertiesNode ( phpmd\Rule $rule, SimpleXMLElement $propertiesNode ) : void This method parses a xml properties structure and adds all found properties to the given $rule object.
parseRuleNode ( phpmd\RuleSet $ruleSet, SimpleXMLElement $node ) : void This method parses a single rule xml node. Bases on the structure of the xml node this method delegates the parsing process to another method in this class.
parseRuleReferenceNode ( phpmd\RuleSet $ruleSet, SimpleXMLElement $ruleNode ) : void This method parses a single rule that was included from a different rule-set.
parseRuleSetNode ( string $fileName ) : PHPMD\RuleSet This method parses the rule-set definition in the given file.
parseRuleSetReference ( SimpleXMLElement $ruleSetNode ) : PHPMD\RuleSet Parses a rule-set xml file referenced by the given rule-set xml element.
parseRuleSetReferenceNode ( phpmd\RuleSet $ruleSet, SimpleXMLElement $ruleSetNode ) : void This method parses a complete rule set that was includes a reference in the currently parsed ruleset.
parseSingleRuleNode ( phpmd\RuleSet $ruleSet, SimpleXMLElement $ruleNode ) : void This method will create a single rule instance and add it to the given {@link \PHPMD\RuleSet} object.

Описание методов

__construct() публичный Метод

Constructs a new default rule-set factory instance.
public __construct ( )

createRuleSets() публичный Метод

Creates an array of rule-set instances for the given argument.
public createRuleSets ( string $ruleSetFileNames ) : PHPMD\RuleSet[]
$ruleSetFileNames string Comma-separated string of rule-set filenames or identifier.
Результат PHPMD\RuleSet[]

createSingleRuleSet() публичный Метод

Creates a single rule-set instance for the given filename or identifier.
public createSingleRuleSet ( string $ruleSetOrFileName ) : PHPMD\RuleSet
$ruleSetOrFileName string The rule-set filename or identifier.
Результат PHPMD\RuleSet

getIgnorePattern() публичный Метод

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.
Результат array

listAvailableRuleSets() публичный Метод

Lists available rule-set identifiers.
public listAvailableRuleSets ( ) : array(string)
Результат array(string)

setMinimumPriority() публичный Метод

Sets the minimum priority that a rule must have.
public setMinimumPriority ( integer $minimumPriority ) : void
$minimumPriority integer The minimum priority value.
Результат void

setStrict() публичный Метод

Activates the strict mode for all rule sets.
С версии: 1.2.0
public setStrict ( ) : void
Результат void