It seems like $seed can also be of type null; however, parameter $seed of mt_srand() does only seem to accept integer, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
14
mt_srand(/** @scrutinizer ignore-type */ $seed);
Loading history...
15
16
3
$terrainCost = [];
17
18
3
foreach (range(0, $rows - 1) as $row) {
19
3
foreach (range(0, $columns - 1) as $column) {
20
3
$terrainCost[$row][$column] = mt_rand(1, 10);
21
}
22
}
23
24
3
return new TerrainCost($terrainCost);
25
}
26
27
7
private function validatePositiveInteger(int $number): void
28
{
29
7
if ($number < 1) {
30
4
throw new \InvalidArgumentException("Invalid positive integer: $number");