Skip to content

Commit ebfb056

Browse files
authored
Merge pull request #270 from rebeccahum/rebecca/fix-114
Hide catching exceptions
2 parents 801fb45 + cb86c2c commit ebfb056

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

WordPressVIPMinimum/Tests/Variables/VariableAnalysisUnitTest.inc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ trait bar {
1010
$this->bar(); // Undefined $this in trait OK.
1111
}
1212
function bar() {}
13-
}
13+
}
14+
15+
function test() {
16+
try {
17+
do_something_silly();
18+
} catch ( Exception $e ) {} // OK.
19+
}

WordPressVIPMinimum/Tests/Variables/VariableAnalysisUnitTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ public function getErrorList() {
3131
* @return array <int line number> => <int number of warnings>
3232
*/
3333
public function getWarningList() {
34-
return array(
34+
return [
3535
5 => 2,
36-
);
36+
18 => 2,
37+
];
3738
}
3839

3940
}

WordPressVIPMinimum/ruleset.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,10 @@
176176
<severity>0</severity>
177177
</rule>
178178

179+
<rule ref="WordPressVIPMinimum.Variables.VariableAnalysis">
180+
<properties>
181+
<property name="allowUnusedCaughtExceptions" value="1"/>
182+
</properties>
183+
</rule>
184+
179185
</ruleset>

0 commit comments

Comments
 (0)