public function testGetFilewideRules()
 {
     $collection = new RuleCollection([new CamelCaseRule(), new EitherDeclarationsOrSideEffectsRule()]);
     $rules = $collection->getAssociatedRules(new ClassMethod([]));
     $expected = [new CamelCaseRule()];
     $this->assertEquals($expected, $rules);
 }
 /**
  * @inheritdoc
  */
 public function leaveNode(Node $node)
 {
     foreach ($this->rules->getAssociatedRules($node) as $rule) {
         $result = $rule->verify($node);
         if (!$result instanceof AbstractRuleResult) {
             continue;
         }
         if ($result instanceof OkRuleResult) {
             if ($this->debug) {
                 $this->collect($result);
             }
             continue;
         }
         if ($this->fix && $result instanceof WarningRuleResult && $rule instanceof FixableRuleInterface) {
             $fixResult = $rule->fix($node);
             if ($fixResult instanceof FixedRuleResult) {
                 $this->collect($fixResult);
                 return $fixResult->getFixedNode();
             }
         }
         $this->collect($result);
     }
 }