PhpCsFixer\RuleSetInterface::getRules PHP Method

getRules() public method

Get all rules from rules set.
public getRules ( ) : array
return array
    public function getRules();

Usage Example

 /**
  * Apply RuleSet on fixers to filter out all unwanted fixers.
  *
  * @param RuleSetInterface $ruleSet
  *
  * @return $this
  */
 public function useRuleSet(RuleSetInterface $ruleSet)
 {
     $fixers = array();
     $fixersByName = array();
     foreach (array_keys($ruleSet->getRules()) as $name) {
         if (!array_key_exists($name, $this->fixersByName)) {
             throw new \UnexpectedValueException(sprintf('Rule "%s" does not exist.', $name));
         }
         $fixer = $this->fixersByName[$name];
         $fixer->configure($ruleSet->getRuleConfiguration($name));
         $fixers[] = $fixer;
         $fixersByName[$name] = $fixer;
     }
     $this->fixers = $fixers;
     $this->fixersByName = $fixersByName;
     return $this;
 }
All Usage Examples Of PhpCsFixer\RuleSetInterface::getRules