Repository navigation
Commit f470162
committed
Code Quality: Resolve the identical.alwaysFalse PHPStan errors.
In `wp_rand()` the `3000000000 === 2147483647` comparison was added in r21685 to detect misconfigured 32-bit PHP builds (Entropy PHP, for example) that truncate integer literals larger than `PHP_INT_MAX` instead of overflowing them to floats, so that `0xffffffff` could be built from a string cast to a float on them. PHPStan evaluates the literals as a 64-bit build does, so it reported the comparison as always false. It is replaced with a `PHP_INT_SIZE` check, which uses the explicit float on every 32-bit build. Behavior is unchanged, since on a correctly configured 32-bit build the literal already overflows to the same float. This empties the baseline, so it is removed.
The `identical.alwaysFalse` ignore for `WP_HTML_Processor::step()` in `phpstan.neon.dist` remains, since that report is a false positive for the bookmark exhaustion guards added in r61755, which are intentional.
Developed in #13782.
Follow-up to r21685, r63023.
Props arshidkv12, westonruter, mukesh27.
See #66739.
git-svn-id: https://develop.svn.wordpress.org/trunk@65792 602fd350-edb4-49c9-b593-d223f7449a821 parent 5601a21 commit f470162
2 files changed
Lines changed: 4 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3054 | 3054 | | |
3055 | 3055 | | |
3056 | 3056 | | |
3057 | | - | |
3058 | | - | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
3059 | 3060 | | |
3060 | | - | |
| 3061 | + | |
3061 | 3062 | | |
3062 | 3063 | | |
3063 | 3064 | | |
| |||
This file was deleted.
0 commit comments