|
13 | 13 | | `numericOperandsInArithmeticOperators` | Require numeric operand in `+$var`, `-$var`, `$var++`, `$var--`, `++$var` and `--$var`. |
|
14 | 14 | | `numericOperandsInArithmeticOperators` | Require numeric operand in `$var++`, `$var--`, `++$var`and `--$var`. |
|
15 | 15 | | `strictFunctionCalls` | These functions contain a `$strict` parameter for better type safety, it must be set to `true`:<br>* `in_array` (3rd parameter)<br>* `array_search` (3rd parameter)<br>* `array_keys` (3rd parameter; only if the 2nd parameter `$search_value` is provided)<br>* `base64_decode` (2nd parameter). |
|
16 | | -| `overwriteVariablesWithLoop` | Variables assigned in `while` loop condition and `for` loop initial assignment cannot be used after the loop. | |
17 | | -| `overwriteVariablesWithLoop` | Variables set in foreach that's always looped thanks to non-empty arrays cannot be used after the loop. | |
| 16 | +| `overwriteVariablesWithLoop` | * Variables assigned in `while` loop condition and `for` loop initial assignment cannot be used after the loop. <br>* Variables set in `foreach` that's always looped thanks to non-empty arrays cannot be used after the loop.<br>* Disallow overwriting variables with `foreach` key and value variables. | |
18 | 17 | | `switchConditionsMatchingType` | Types in `switch` condition and `case` value must match. PHP compares them loosely by default and that can lead to unexpected results. |
|
19 | 18 | | `dynamicCallOnStaticMethod` | Check that statically declared methods are called statically. |
|
20 | 19 | | `disallowedEmpty` | Disallow `empty()` - it's a very loose comparison (see [manual](https://php.net/empty)), it's recommended to use more strict one. |
|
21 | 20 | | `disallowedShortTernary` | Disallow short ternary operator (`?:`) - implies weak comparison, it's recommended to use null coalesce operator (`??`) or ternary operator with strict condition. |
|
22 | 21 | | `noVariableVariables` | Disallow variable variables (`$$foo`, `$this->$method()` etc.). |
|
23 | | -| `overwriteVariablesWithLoop` | Disallow overwriting variables with foreach key and value variables. | |
24 | 22 | | `checkAlwaysTrueInstanceof`, `checkAlwaysTrueCheckTypeFunctionCall`, `checkAlwaysTrueStrictComparison` | Always true `instanceof`, type-checking `is_*` functions and strict comparisons `===`/`!==`. These checks can be turned off by setting `checkAlwaysTrueInstanceof`, `checkAlwaysTrueCheckTypeFunctionCall` and `checkAlwaysTrueStrictComparison` to false. |
|
25 | 23 | | | Correct case for referenced and called function names. |
|
26 | 24 | | `matchingInheritedMethodNames` | Correct case for inherited and implemented method names. |
|
|
0 commit comments