forked from illusori/PHP_Codesniffer-VariableAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruleset.xml
64 lines (61 loc) · 2.67 KB
/
ruleset.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0"?>
<ruleset name="PHP_Codesniffer Plugins Generic">
<description>Run ./install.sh and choose from the following rules to your standrd's ruleset.xml.</description>
<!-- If you want everything, with the defaults, just include this line -->
<rule ref="Generic.CodeAnalysis.VariableAnalysis"/>
<!--
You can also refer to these policy codes to customize them:
Generic.CodeAnalysis.VariableAnalysis.UndefinedVariable
Generic.CodeAnalysis.VariableAnalysis.UnusedVariable
Generic.CodeAnalysis.VariableAnalysis.VariableRedeclaration
Generic.CodeAnalysis.VariableAnalysis.SelfOutsideClass
-->
<!-- Include this block to customize VariableAnalysis behaviour -->
<rule ref="Generic.CodeAnalysis.VariableAnalysis">
<properties>
<!--
Include the following property if you want to include your own list of pass-by-reference
functions defined in your codebase.
Format is "function:argnum" or "function:argnum1,argnum2" etc.
Whitespace delimits function definitions.
Argument numbers start at 1 and an elipsis '...' means all argument numbers
after the previous should be considered pass-by-reference.
-->
<property name="sitePassByRefFunctions" value="
function_with_first_arg_by_ref:1
function_with_second_and_third_arg_by_ref:2,3
function_with_third_and_remaining_args_by_ref:3,...
"/>
<!--
Include the following property if you want to prevent exception variables declared
in a catch block from causing an unused variable warning, this supports the common
(but not always wanted) pattern of:
try {
// stuff here
} catch (Exception $e) {
// Do something without ever using $e
}
-->
<property name="allowUnusedCaughtExceptions" value="1"/>
<!--
Include the following property if you want to prevent function parametets from causing an
unused variable warning, this supports the common pattern of defining callback functions that
demand a fixed parameter list without actually using all the paramets.
function foo ($a, $b, $c) {
// Do something without ever using some of $a, $b and/or $c
}
-->
<property name="allowUnusedFunctionParameters" value="1"/>
<!--
Include the following property if you want to have a whitelist of variable names
that are commonly used for placeholder "junk" values that ignored and that you
don't want to provoke an unused variable warning for.
Format is "variableName" without a leading $ with whitespace delimiting names.
-->
<property name="validUnusedVariableNames" value="
junk
dummy
"/>
</properties>
</rule>
</ruleset>