Skip to content

Commit 11c5706

Browse files
authored
Enhancement: Enable random_api_migration fixer
Co-authored-by: Mathias Reker <[email protected]> Closes GH-699.
1 parent 9752e1b commit 11c5706

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.php-cs-fixer.php

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
'no_extra_blank_lines' => true,
3636
'no_trailing_whitespace' => true,
3737
'ordered_class_elements' => true,
38+
'random_api_migration' => true,
3839
'single_space_after_construct' => true,
3940
'strict_param' => true,
4041
'switch_case_space' => true,

download-logos.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function print_star(): void
2222
function random_bgcolor($min, $max): void
2323
{
2424
echo "style=\"background-color: #" .
25-
sprintf('%02x%02x%02x', rand($min, $max) * 51, rand($min, $max) * 51, rand($min, $max) * 51) .
25+
sprintf('%02x%02x%02x', mt_rand($min, $max) * 51, mt_rand($min, $max) * 51, mt_rand($min, $max) * 51) .
2626
";\"";
2727
}
2828
?>

manual/spam_challenge.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ function plus($a, $b) {
88
}
99

1010
function gen_plus($a) {
11-
return rand(0, 9 - $a);
11+
return mt_rand(0, 9 - $a);
1212
}
1313

1414
function minus($a, $b) {
1515
return $a - $b;
1616
}
1717

1818
function gen_minus($a) {
19-
return rand(0, $a);
19+
return mt_rand(0, $a);
2020
}
2121

2222
function print_infix($name, $a, $b) {
@@ -37,11 +37,11 @@ function print_prefix($name, $a, $b) {
3737

3838
// generate a challenge
3939
function gen_challenge() {
40-
$c = CHALLENGES[rand(0, count(CHALLENGES) - 1)];
40+
$c = CHALLENGES[mt_rand(0, count(CHALLENGES) - 1)];
4141

42-
$a = rand(0, 9);
42+
$a = mt_rand(0, 9);
4343
$an = NUMS[$a];
44-
$b = isset($c[2]) ? $c[2]($a) : rand(0, 9);
44+
$b = isset($c[2]) ? $c[2]($a) : mt_rand(0, 9);
4545
$bn = NUMS[$b];
4646

4747
return [$c[0], $an, $bn, $c[1]($c[0], $an, $bn)];

0 commit comments

Comments
 (0)