📌 | Drupal core | Replace intval(), strval(), .. *val() functions with their relevant type casting operators
🇱🇰Sri Lanka Ayesh Everywhere
Added a CS rule forbid said casting functions, but emit a warning and not an error. I don't know PHPCS enough to see if it can add a warning message instead of a function suggestion. The two instance of intval
calls are explicitly allowed with a PHPCS toggle.
The reason why I thought to use a warning instead of an error is because none of these functions are deprecated, and especially in intval
case, there is a parameter for base conversion. If you think we are better off with an error, I'll happily change it too.
Thank you.