Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0435aeb

Browse files
thePanzondrejmirtes
authored andcommitted
Consolidate overwriteVariablesWithLoop rule details
The `overwriteVariablesWithLoop` parameter was mentioned in 3 different rows. Consolidating their descriptions into a single raw and with bullet-points
1 parent e861638 commit 0435aeb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

‎README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@
1313
| `numericOperandsInArithmeticOperators` | Require numeric operand in `+$var`, `-$var`, `$var++`, `$var--`, `++$var` and `--$var`. |
1414
| `numericOperandsInArithmeticOperators` | Require numeric operand in `$var++`, `$var--`, `++$var`and `--$var`. |
1515
| `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. |
1817
| `switchConditionsMatchingType` | Types in `switch` condition and `case` value must match. PHP compares them loosely by default and that can lead to unexpected results. |
1918
| `dynamicCallOnStaticMethod` | Check that statically declared methods are called statically. |
2019
| `disallowedEmpty` | Disallow `empty()` - it's a very loose comparison (see [manual](https://php.net/empty)), it's recommended to use more strict one. |
2120
| `disallowedShortTernary` | Disallow short ternary operator (`?:`) - implies weak comparison, it's recommended to use null coalesce operator (`??`) or ternary operator with strict condition. |
2221
| `noVariableVariables` | Disallow variable variables (`$$foo`, `$this->$method()` etc.). |
23-
| `overwriteVariablesWithLoop` | Disallow overwriting variables with foreach key and value variables. |
2422
| `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. |
2523
| | Correct case for referenced and called function names. |
2624
| `matchingInheritedMethodNames` | Correct case for inherited and implemented method names. |

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /