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">
62
62
-- This works around a long-standing PHP bug with is_readable()
63
63
-- Thanks to Michael S for the patch
64
64
- 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
65
66
- Fixed bug #3157 : PSR2.ControlStructures.SwitchDeclaration.BreakIndent false positive when case keyword is not indented
66
67
- Fixed bug #3165 : Squiz.PHP.DisallowComparisonAssignment false positive when comparison inside closure
67
68
- 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
126
126
*/
127
127
public function __construct (Config $ config )
128
128
{
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
-
137
129
$ this ->config = $ config ;
130
+ $ restrictions = $ config ->sniffs ;
131
+ $ exclusions = $ config ->exclude ;
138
132
$ sniffs = [];
139
133
140
134
$ standardPaths = [];
@@ -200,6 +194,12 @@ public function __construct(Config $config)
200
194
$ sniffs = array_merge ($ sniffs , $ this ->processRuleset ($ standard ));
201
195
}//end foreach
202
196
197
+ // Ignore sniff restrictions if caching is on.
198
+ if ($ config ->cache === true ) {
199
+ $ restrictions = [];
200
+ $ exclusions = [];
201
+ }
202
+
203
203
$ sniffRestrictions = [];
204
204
foreach ($ restrictions as $ sniffCode ) {
205
205
$ parts = explode ('. ' , strtolower ($ sniffCode ));
You can’t perform that action at this time.
0 commit comments