Passed
Pull Request — master (#236)
by Patrik
03:27
created
includes/gateways/manual.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly
3
-if ( ! defined( 'ABSPATH' ) ) exit;
3
+if ( ! defined( 'ABSPATH' ) ) {
4
+    exit;
5
+}
4 6
 
5 7
 add_action( 'wpinv_manual_cc_form', '__return_false' );
6 8
 
Please login to merge, or discard this patch.
includes/gateways/bank_transfer.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly
3
-if ( ! defined( 'ABSPATH' ) ) exit;
3
+if ( ! defined( 'ABSPATH' ) ) {
4
+    exit;
5
+}
4 6
 
5 7
 add_action( 'wpinv_bank_transfer_cc_form', '__return_false' );
6 8
 
Please login to merge, or discard this patch.
includes/gateways/paypal.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly
3
-if ( ! defined( 'ABSPATH' ) ) exit;
3
+if ( ! defined( 'ABSPATH' ) ) {
4
+    exit;
5
+}
4 6
 
5 7
 add_action( 'wpinv_paypal_cc_form', '__return_false' );
6 8
 add_filter( 'wpinv_paypal_support_subscription', '__return_true' );
@@ -307,8 +309,9 @@  discard block
 block discarded – undo
307 309
 	}
308 310
 
309 311
 	// Check if $post_data_array has been populated
310
-	if ( !is_array( $encoded_data_array ) && !empty( $encoded_data_array ) )
311
-		return;
312
+	if ( !is_array( $encoded_data_array ) && !empty( $encoded_data_array ) ) {
313
+			return;
314
+	}
312 315
 
313 316
 	$defaults = array(
314 317
 		'txn_type'       => '',
Please login to merge, or discard this patch.
includes/wpinv-address-functions.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -95,20 +95,24 @@
 block discarded – undo
95 95
     }
96 96
 
97 97
     if ( !empty( $user_info ) ) {
98
-        if( empty( $address['first_name'] ) )
99
-            $address['first_name'] = $user_info->first_name;
98
+        if( empty( $address['first_name'] ) ) {
99
+                    $address['first_name'] = $user_info->first_name;
100
+        }
100 101
         
101
-        if( empty( $address['last_name'] ) )
102
-            $address['last_name'] = $user_info->last_name;
102
+        if( empty( $address['last_name'] ) ) {
103
+                    $address['last_name'] = $user_info->last_name;
104
+        }
103 105
     }
104 106
     
105 107
     $address['name'] = trim( trim( $address['first_name'] . ' ' . $address['last_name'] ), "," );
106 108
     
107
-    if( empty( $address['state'] ) && $with_default )
108
-        $address['state'] = wpinv_get_default_state();
109
+    if( empty( $address['state'] ) && $with_default ) {
110
+            $address['state'] = wpinv_get_default_state();
111
+    }
109 112
 
110
-    if( empty( $address['country'] ) && $with_default )
111
-        $address['country'] = wpinv_get_default_country();
113
+    if( empty( $address['country'] ) && $with_default ) {
114
+            $address['country'] = wpinv_get_default_country();
115
+    }
112 116
 
113 117
 
114 118
     return $address;
Please login to merge, or discard this patch.
includes/wpinv-item-functions.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // Exit if accessed directly
3
-if ( ! defined( 'ABSPATH' ) ) exit;
3
+if ( ! defined( 'ABSPATH' ) ) {
4
+    exit;
5
+}
4 6
 
5 7
 function wpinv_get_item_by( $field = '', $value = '', $type = '' ) {
6 8
     if( empty( $field ) || empty( $value ) ) {
@@ -118,8 +120,9 @@  discard block
 block discarded – undo
118 120
 function wpinv_get_item( $item = 0 ) {
119 121
     if ( is_numeric( $item ) ) {
120 122
         $item = get_post( $item );
121
-        if ( ! $item || 'wpi_item' !== $item->post_type )
122
-            return null;
123
+        if ( ! $item || 'wpi_item' !== $item->post_type ) {
124
+                    return null;
125
+        }
123 126
         return $item;
124 127
     }
125 128
 
@@ -283,8 +286,9 @@  discard block
 block discarded – undo
283 286
 }
284 287
 
285 288
 function wpinv_remove_item_logs_on_delete( $item_id = 0 ) {
286
-    if ( 'wpi_item' !== get_post_type( $item_id ) )
287
-        return;
289
+    if ( 'wpi_item' !== get_post_type( $item_id ) ) {
290
+            return;
291
+    }
288 292
 
289 293
     global $wpinv_logs;
290 294
     
Please login to merge, or discard this patch.
includes/wpinv-invoice-functions.php 1 patch
Braces   +21 added lines, -16 removed lines patch added patch discarded remove patch
@@ -83,8 +83,9 @@  discard block
 block discarded – undo
83 83
 
84 84
     $invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_transaction_id' AND meta_value = %s LIMIT 1", $key ) );
85 85
 
86
-    if ( $invoice_id != NULL )
87
-        return $invoice_id;
86
+    if ( $invoice_id != NULL ) {
87
+            return $invoice_id;
88
+    }
88 89
 
89 90
     return 0;
90 91
 }
@@ -750,8 +751,9 @@  discard block
 block discarded – undo
750 751
 function wpinv_checkout_validate_cc_zip( $zip = 0, $country_code = '' ) {
751 752
     $ret = false;
752 753
 
753
-    if ( empty( $zip ) || empty( $country_code ) )
754
-        return $ret;
754
+    if ( empty( $zip ) || empty( $country_code ) ) {
755
+            return $ret;
756
+    }
755 757
 
756 758
     $country_code = strtoupper( $country_code );
757 759
 
@@ -913,8 +915,9 @@  discard block
 block discarded – undo
913 915
         "ZM" => "\d{5}"
914 916
     );
915 917
 
916
-    if ( ! isset ( $zip_regex[ $country_code ] ) || preg_match( "/" . $zip_regex[ $country_code ] . "/i", $zip ) )
917
-        $ret = true;
918
+    if ( ! isset ( $zip_regex[ $country_code ] ) || preg_match( "/" . $zip_regex[ $country_code ] . "/i", $zip ) ) {
919
+            $ret = true;
920
+    }
918 921
 
919 922
     return apply_filters( 'wpinv_is_zip_valid', $ret, $zip, $country_code );
920 923
 }
@@ -1238,14 +1241,15 @@  discard block
 block discarded – undo
1238 1241
         }
1239 1242
     }
1240 1243
     
1241
-    if ( get_query_var( 'paged' ) )
1242
-        $args['page'] = get_query_var('paged');
1243
-    else if ( get_query_var( 'page' ) )
1244
-        $args['page'] = get_query_var( 'page' );
1245
-    else if ( !empty( $args[ 'page' ] ) )
1246
-        $args['page'] = $args[ 'page' ];
1247
-    else
1248
-        $args['page'] = 1;
1244
+    if ( get_query_var( 'paged' ) ) {
1245
+            $args['page'] = get_query_var('paged');
1246
+    } else if ( get_query_var( 'page' ) ) {
1247
+            $args['page'] = get_query_var( 'page' );
1248
+    } else if ( !empty( $args[ 'page' ] ) ) {
1249
+            $args['page'] = $args[ 'page' ];
1250
+    } else {
1251
+            $args['page'] = 1;
1252
+    }
1249 1253
 
1250 1254
     /**
1251 1255
      * Generate WP_Query args. This logic will change if orders are moved to
@@ -1380,8 +1384,9 @@  discard block
 block discarded – undo
1380 1384
 
1381 1385
 	$invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_key' AND meta_value = %s LIMIT 1", $key ) );
1382 1386
 
1383
-	if ( $invoice_id != NULL )
1384
-		return $invoice_id;
1387
+	if ( $invoice_id != NULL ) {
1388
+			return $invoice_id;
1389
+	}
1385 1390
 
1386 1391
 	return 0;
1387 1392
 }
Please login to merge, or discard this patch.
templates/emails/wpinv-email-user_note.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 // don't load directly
3
-if ( !defined('ABSPATH') )
3
+if ( !defined('ABSPATH') ) {
4 4
     die('-1');
5
+}
5 6
 
6 7
 do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
7 8
 
Please login to merge, or discard this patch.
templates/emails/wpinv-email-overdue.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 // don't load directly
3
-if ( !defined('ABSPATH') )
3
+if ( !defined('ABSPATH') ) {
4 4
     die('-1');
5
+}
5 6
 
6 7
 do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
7 8
 
Please login to merge, or discard this patch.
templates/wpinv-invoice-history.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -93,12 +93,13 @@
 block discarded – undo
93 93
 			<?php
94 94
 			$big = 999999;
95 95
 
96
-			if (get_query_var('paged'))
97
-				$current_page = get_query_var('paged');
98
-			elseif (get_query_var('page'))
99
-				$current_page = get_query_var('page');
100
-			else
101
-				$current_page = 1;
96
+			if (get_query_var('paged')) {
97
+							$current_page = get_query_var('paged');
98
+			} elseif (get_query_var('page')) {
99
+							$current_page = get_query_var('page');
100
+			} else {
101
+							$current_page = 1;
102
+			}
102 103
 
103 104
 			echo paginate_links( array(
104 105
 				'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
Please login to merge, or discard this patch.