You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a190602
Browse filesBrowse the repository at this point in the historyBrowse files
Code Quality: Use decimal-int-string for integer strings.
PHPStan 2.2.0 introduced the `decimal-int-string` type for a string in canonical decimal integer form, such as `'123'` or `'-5'`, which is exactly what casting an integer to a string produces. For historical reasons, WordPress passes many integers around as strings, since that is what MySQL returns for integer columns. These had been typed as `numeric-string`, which also admits floats, exponents, and leading zeros or whitespace. The narrower `decimal-int-string` type is now used for object IDs, `COUNT(*)` results, and the integer columns exposed on the core object classes. The `numeric-string` type is kept where a value can be zero-padded or fractional, such as date parts and EXIF image metadata, and for now in `wp_unique_id()` and `wp_unique_prefixed_id()` due to a PHPStan issue.
Developed in WordPress#16013.
Follow-up to r62437, r62640, r62717, r62822, r63488, r63618, r65269, r65527.
See #65817.
git-svn-id: https://develop.svn.wordpress.org/trunk@65534 602fd350-edb4-49c9-b593-d223f7449a82
0 commit comments