Qual: Fix PHPStan warning (undefined variable $s) in bank.lib.php (#38770)
PHPStan level 9 (apstats config) reports at htdocs/core/lib/bank.lib.php:465: "Variable $s might not be defined." The variable $s was initialized inside the for() init expression (for ($i = 0, $s = 0; ...)). As the apstats ruleset sets polluteScopeWithLoopInitialAssignments: false, the assignment is not seen as defined after the loop, where $s is used to compute the RIB key. Moved the $s = 0 initialization just before the loop. No behaviour change. Co-authored-by: Muvikx <kilyan.cotten@epitech.eu>
This commit is contained in:
parent
65b95df114
commit
d0197ea460
1 changed files with 2 additions and 1 deletions
|
|
@ -456,7 +456,8 @@ function checkBanForAccount($account)
|
|||
// Separation du rib en 3 groups de 7 + 1 group de 2.
|
||||
// Multiplication of each group by the coefficients in the array.
|
||||
|
||||
for ($i = 0, $s = 0; $i < 3; $i++) {
|
||||
$s = 0;
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$code = substr($rib, 7 * $i, 7);
|
||||
$s += ((int) $code) * $coef[$i];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue