X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FuserOptions.php;h=4c9dcb4667373ba8d0fa38706494f90a51621825;hb=fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6;hp=eb8da57e86a860672c738ef3dd1eb0acc898caba;hpb=9bf44d08f938cc9a85dc647b8a00665d5bd01fb6;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/userOptions.php b/maintenance/userOptions.php index eb8da57e86..2f8941f3da 100644 --- a/maintenance/userOptions.php +++ b/maintenance/userOptions.php @@ -107,16 +107,13 @@ The new option is NOT validated.' ); $userValue = $user->getOption( $option ); if ( $userValue <> $defaultOptions[$option] ) { - // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged - @$ret[$option][$userValue]++; + $ret[$option][$userValue] = ( $ret[$option][$userValue] ?? 0 ) + 1; } } else { - foreach ( $defaultOptions as $name => $defaultValue ) { $userValue = $user->getOption( $name ); if ( $userValue != $defaultValue ) { - // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged - @$ret[$name][$userValue]++; + $ret[$name][$userValue] = ( $ret[$name][$userValue] ?? 0 ) + 1; } } } @@ -199,5 +196,5 @@ WARN } } -$maintClass = 'UserOptionsMaintenance'; +$maintClass = UserOptionsMaintenance::class; require RUN_MAINTENANCE_IF_MAIN;