Total Complexity | 4 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
13 | class ValidVariableNameSniff implements Sniff |
||
14 | { |
||
15 | /** @var array */ |
||
16 | public $allowedNames = [ |
||
17 | '_GET', |
||
18 | '_POST', |
||
19 | '_COOKIE', |
||
20 | '_FILES', |
||
21 | '_REQUEST', |
||
22 | '_SERVER', |
||
23 | '_SESSION' |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * Listen to variable name tokens. |
||
28 | * |
||
29 | * @return int[] |
||
30 | */ |
||
31 | public function register() |
||
32 | { |
||
33 | return [T_VARIABLE]; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Check variable names to make sure no underscores are used. |
||
38 | * |
||
39 | * @param File $phpcsFile |
||
40 | * @param int $stackPtr |
||
41 | * |
||
42 | * @return void |
||
43 | */ |
||
44 | public function process(File $phpcsFile, $stackPtr) |
||
57 | ); |
||
58 | } |
||
61 |