Commit Graph

5 Commits

Author SHA1 Message Date
Claudio Sanches 74bb66dc6d
Merge pull request #27671 from mahmoudsaeed/master
Make WC_Tax::get_tax_rate_classes() public
2021-02-15 14:31:25 -03:00
Mahmoud Saeed ad0eff11de Add unit test for WC_Tax::get_tax_rate_classes() 2020-10-15 07:34:20 +02:00
Nestor Soriano 52eed70f04 Add a 'NumberUtil' class with a 'round' method.
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'.
2020-10-01 11:08:51 +02:00
Nestor Soriano b1e81d02da Fix code style/sniffer errors in a few files. 2020-10-01 11:08:51 +02:00
Christopher Allford b5bd8225e8 Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00