lint/style/prefer-random-int
In the modernize set. Unsafe fix: it can change behaviour.
What it does
Replaces rand, srand, getrandmax functions calls with their mt_* analogs or random_int.
Configuration
[lint.rules]
"style/prefer-random-int" = "error"
To skip it in some files, add an override or a @pun-ignore-file comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
replacements |
map |
Any | { "getrandmax" = "mt_getrandmax", "rand" = "mt_rand", "srand" = "mt_srand" } |
replacements |
Replaces
random_api_migration(php-cs-fixer, risky)