With T232949 and the release of mediawiki/mediawiki-phan-config to 0.9.0 the phan setting scalar_implicit_cast was set to false.
Explaination:
scalar_implicit_cast: as the name would suggest, it considers scalar types to be equivalent. While MW is pretty lax, this could hide bugs, and there are cases where scalars are not equivalent
This makes phan strict about string <-> int mismatches (or all other scalar type mismatches with bool and float) and enforce to add explict cast operator (int) or intval() to ensure that the correct type is used.
One discussion can be read on https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/560430/
- There are some situation where this can help to choose the right function (in context of WebRequest to use getInt or getBool or getVal) and avoids injection when the backend does not escape correctly.
- It can also makes it harder to document function which takes all scalar types or arrays with all scalar types int|string|float|(int|string|float)[]
- When calculate with timestamp, than wfTimestamp( TS_UNIX ) needs a cast, because it returns a string
How to handle this in the future?