File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
6262 -- This works around a long-standing PHP bug with is_readable()
6363 -- Thanks to Michael S for the patch
6464 - Fixed bug #2913 : Generic.WhiteSpace.ScopeIndent false positive when opening and closing tag on same line inside conditional
65+ - Fixed bug #2992 : Enabling caching using a ruleset produces invalid cache files when using --sniffs and --exclude CLI args
6566 - Fixed bug #3157 : PSR2.ControlStructures.SwitchDeclaration.BreakIndent false positive when case keyword is not indented
6667 - Fixed bug #3165 : Squiz.PHP.DisallowComparisonAssignment false positive when comparison inside closure
6768 - Fixed bug #3167 : Generic.WhiteSpace.ScopeIndent false positive when using PHP 8.0 constructor property promotion
Original file line number Diff line number Diff line change @@ -126,15 +126,9 @@ class Ruleset
126126 */
127127 public function __construct (Config $ config )
128128 {
129- // Ignore sniff restrictions if caching is on.
130- $ restrictions = [];
131- $ exclusions = [];
132- if ($ config ->cache === false ) {
133- $ restrictions = $ config ->sniffs ;
134- $ exclusions = $ config ->exclude ;
135- }
136-
137129 $ this ->config = $ config ;
130+ $ restrictions = $ config ->sniffs ;
131+ $ exclusions = $ config ->exclude ;
138132 $ sniffs = [];
139133
140134 $ standardPaths = [];
@@ -200,6 +194,12 @@ public function __construct(Config $config)
200194 $ sniffs = array_merge ($ sniffs , $ this ->processRuleset ($ standard ));
201195 }//end foreach
202196
197+ // Ignore sniff restrictions if caching is on.
198+ if ($ config ->cache === true ) {
199+ $ restrictions = [];
200+ $ exclusions = [];
201+ }
202+
203203 $ sniffRestrictions = [];
204204 foreach ($ restrictions as $ sniffCode ) {
205205 $ parts = explode ('. ' , strtolower ($ sniffCode ));
You can’t perform that action at this time.
0 commit comments