Use Yoda condition checks

This commit is contained in:
Filipe Correa 2020-08-17 09:56:01 -03:00
parent 730e00565d
commit 148387ecb9
1 changed files with 1 additions and 1 deletions

View File

@ -1864,7 +1864,7 @@ class WC_AJAX {
$order = wc_get_order( $order_id );
$max_refund = wc_format_decimal( $order->get_total() - $order->get_total_refunded(), wc_get_price_decimals() );
if ( ( ! $refund_amount && ( $refund_amount !== wc_format_decimal( 0, wc_get_price_decimals() ) ) ) || $max_refund < $refund_amount || 0 > $refund_amount ) {
if ( ( ! $refund_amount && ( wc_format_decimal( 0, wc_get_price_decimals() ) !== $refund_amount ) ) || $max_refund < $refund_amount || 0 > $refund_amount ) {
throw new Exception( __( 'Invalid refund amount', 'woocommerce' ) );
}