rectorphp / rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
https://getrector.com
MIT License
8.73k stars 686 forks source link

rand() replaced by random_int() instead of mt_rand() #7929

Closed zshuzh closed 1 year ago

zshuzh commented 1 year ago

Bug Report

Subject Details
Rector version e.g. v0.11.5 (invoke vendor/bin/rector --version)

Minimal PHP Code Causing Issue

Reproduction

Expected Behaviour

I would expect rand() to be replaced by mt_rand() since that's what the documentation says, but it is actually replaced with random_int().

samsonasik commented 1 year ago

The documentation seems invalid, feel free to provide patch PR to update this

https://github.com/rectorphp/rector-src/blob/d87113675bbaaf8de972069779b48f706d2c73d6/rules/Php70/Rector/FuncCall/RandomFunctionRector.php#L37

then run composer docs to regenerate documentation.