Skip to content

Commit

Permalink
PHPCS thinks that's not a Yoda condition.
Browse files Browse the repository at this point in the history
This is why requiring Yoda conditions is dumb.
  • Loading branch information
joedolson committed Jan 26, 2023
1 parent b5ef46e commit ff03a0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/gateways/offline.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function mt_offline_processor() {
$amount = (float) $_POST['mt_amount'];
$shipping = (float) $_POST['mt_shipping'];
// Check whether the total value for the cart matches the amounts submitted.
if ( (float) $total !== ( $amount + $shipping ) ) {
if ( ( $amount + $shipping ) !== (float) $total ) {
wp_die( 'My Tickets: Amount submitted to cart does not match payment.', 'my-tickets' );
}

Expand All @@ -144,7 +144,6 @@ function mt_offline_processor() {
'code' => isset( $_POST['zip'] ) ? sanitize_text_field( $_POST['zip'] ) : '',
);


// if the total price on this transaction is zero, mark as completed.
$payment_status = ( '0' === (string) $total || '0.00' === (string) $total ) ? 'Completed' : 'Pending';

Expand Down

0 comments on commit ff03a0a

Please sign in to comment.