52eed70f04
There's a number of places in the WooCommerce codebase where the built-in function 'round' is executed passing a non-numeric value (not a number and not a string that can be parsed as a number), for example round(''). In PHP 7 this yields a value of 0, but in PHP 8 this throws an error. This commit adds a 'NumberUtil' class with a static 'round' method, this method checks if the passed value is numeric and if so it just executes the built-in function, otherwise it returns 0. And all the calls to 'round' in the codebase are replaced with 'NumberUtil::round'. |
||
---|---|---|
.. | ||
trait-wc-item-totals.php |