Passed
Pull Request — master (#378)
by Brian
07:38 queued 02:10
created
templates/payment-forms/elements/gateway_select.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -7,27 +7,27 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // The payment methods select title.
13
-if ( empty( $text ) ) {
14
-    $text = __( 'Select Payment Method', 'invoicing' );
13
+if (empty($text)) {
14
+    $text = __('Select Payment Method', 'invoicing');
15 15
 }
16 16
 
17 17
 // An array of active payment methods.
18
-$gateways = wpinv_get_enabled_payment_gateways( true );
18
+$gateways = wpinv_get_enabled_payment_gateways(true);
19 19
 
20 20
 // Make it possible to filter active gateways.
21
-$gateways = apply_filters( 'getpaid_payment_form_gateways', $gateways, $form );
21
+$gateways = apply_filters('getpaid_payment_form_gateways', $gateways, $form);
22 22
 
23 23
 //@deprecated
24
-$gateways = apply_filters( 'wpinv_payment_gateways_on_cart', $gateways );
24
+$gateways = apply_filters('wpinv_payment_gateways_on_cart', $gateways);
25 25
 
26 26
 // The current invoice id.
27 27
 $invoice_id     = 0;
28 28
 $chosen_gateway = wpinv_get_default_gateway();
29 29
 
30
-if ( ! empty( $form->invoice ) ) {
30
+if (!empty($form->invoice)) {
31 31
     $invoice_id = $form->invoice->get_id();
32 32
     $chosen_gateway = $form->invoice->get_gateway();
33 33
 }
@@ -36,36 +36,36 @@  discard block
 block discarded – undo
36 36
 
37 37
     <div class="mt-4 mb-4">
38 38
 
39
-        <?php do_action( 'wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
39
+        <?php do_action('wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form); ?>
40 40
 
41 41
         <div class="getpaid-gateways-select-title-div">
42
-            <h6><?php echo sanitize_text_field( $text ); ?></h6>
42
+            <h6><?php echo sanitize_text_field($text); ?></h6>
43 43
         </div>
44 44
 
45 45
         
46 46
         <div class="getpaid-gateways-select-gateways-div">
47 47
 
48
-            <?php foreach ( array_keys( $gateways ) as $gateway ) : ?>
48
+            <?php foreach (array_keys($gateways) as $gateway) : ?>
49 49
 
50
-                <div class="pt-2 pb-2 getpaid-gateways-select-gateway getpaid-gateways-select-gateway-<?php echo sanitize_html_class( $gateway ) ;?>">
50
+                <div class="pt-2 pb-2 getpaid-gateways-select-gateway getpaid-gateways-select-gateway-<?php echo sanitize_html_class($gateway); ?>">
51 51
 
52 52
                     <div class="getpaid-gateway-radio-div">
53 53
                         <label>
54
-                            <input type="radio" value="<?php echo esc_attr( $gateway ) ;?>" <?php checked( $gateway, $chosen_gateway ) ;?> name="wpi-gateway">
55
-                            <span><?php echo sanitize_text_field( wpinv_get_gateway_checkout_label( $gateway ) ); ?></span>
54
+                            <input type="radio" value="<?php echo esc_attr($gateway); ?>" <?php checked($gateway, $chosen_gateway); ?> name="wpi-gateway">
55
+                            <span><?php echo sanitize_text_field(wpinv_get_gateway_checkout_label($gateway)); ?></span>
56 56
                         </label>
57 57
                     </div>
58 58
 
59 59
                     <div class="getpaid-gateway-description-div" style="display: none;">
60 60
 
61
-                        <?php if ( wpinv_get_gateway_description( $gateway ) ) : ?>
61
+                        <?php if (wpinv_get_gateway_description($gateway)) : ?>
62 62
                             <div class="getpaid-gateway-description">
63
-                                <?php echo wpinv_get_gateway_description( $gateway ); ?>
63
+                                <?php echo wpinv_get_gateway_description($gateway); ?>
64 64
                             </div>
65 65
                         <?php endif; ?>
66 66
 
67
-                        <?php do_action( 'getpaid_after_gateway_description', $invoice_id, $gateway ) ;?>
68
-                        <?php do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id ) ;?>
67
+                        <?php do_action('getpaid_after_gateway_description', $invoice_id, $gateway); ?>
68
+                        <?php do_action('wpinv_' . $gateway . '_cc_form', $invoice_id); ?>
69 69
 
70 70
                     </div>
71 71
 
@@ -76,16 +76,16 @@  discard block
 block discarded – undo
76 76
             <?php
77 77
 
78 78
 
79
-                if ( empty( $gateways ) ) {
79
+                if (empty($gateways)) {
80 80
 
81
-                    $enabled_gateways = wpinv_get_enabled_payment_gateways( true );
81
+                    $enabled_gateways = wpinv_get_enabled_payment_gateways(true);
82 82
 
83
-                    if ( ! empty( $enabled_gateways ) && $form->is_recurring() ) {
83
+                    if (!empty($enabled_gateways) && $form->is_recurring()) {
84 84
 
85 85
 
86 86
                         echo aui()->alert(
87 87
                             array(
88
-                                'content'     => __( 'Non of the available payment gateways support subscriptions.', 'invoicing' ),
88
+                                'content'     => __('Non of the available payment gateways support subscriptions.', 'invoicing'),
89 89
                                 'type'        => 'danger',
90 90
                             )
91 91
                         );
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
                         echo aui()->alert(
97 97
                             array(
98
-                                'content'     => __( 'No active payment gateway available.', 'invoicing' ),
98
+                                'content'     => __('No active payment gateway available.', 'invoicing'),
99 99
                                 'type'        => 'danger',
100 100
                             )
101 101
                         );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         </div>
112 112
 
113
-        <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
113
+        <?php do_action('wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form); ?>
114 114
 
115 115
     </div>
116 116
 
Please login to merge, or discard this patch.
templates/invoice/company-address.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 global $wpinv_euvat;
13 13
 
14 14
 // Prepare the company name.
15 15
 $company_name = $wpinv_euvat->get_company_name();
16 16
 
17
-if ( empty( $company_name ) ) {
17
+if (empty($company_name)) {
18 18
     $company_name = wpinv_get_business_name();
19 19
 }
20 20
 
@@ -24,30 +24,30 @@  discard block
 block discarded – undo
24 24
         <div class="row">
25 25
 
26 26
             <div class="invoice-company-address-label col-2">
27
-                <strong><?php _e( 'From:', 'invoicing' ) ?></strong>
27
+                <strong><?php _e('From:', 'invoicing') ?></strong>
28 28
             </div>
29 29
 
30 30
             <div class="invoice-company-address-value col-10">
31 31
 
32
-                <?php do_action( 'getpaid_company_address_top' ); ?>
32
+                <?php do_action('getpaid_company_address_top'); ?>
33 33
 
34 34
                 <div class="name">
35
-                    <a target="_blank" class="text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
36
-                        <?php echo esc_html( wpinv_get_business_name() ); ?>
35
+                    <a target="_blank" class="text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>">
36
+                        <?php echo esc_html(wpinv_get_business_name()); ?>
37 37
                     </a>
38 38
                 </div>
39 39
 
40
-                <?php if ( $address = wpinv_get_business_address() ) { ?>
41
-                    <?php echo $address;?>
40
+                <?php if ($address = wpinv_get_business_address()) { ?>
41
+                    <?php echo $address; ?>
42 42
                 <?php } ?>
43 43
 
44
-                <?php if ( $email_from = wpinv_mail_get_from_address() ) { ?>
44
+                <?php if ($email_from = wpinv_mail_get_from_address()) { ?>
45 45
                     <div class="email_from">
46
-                        <?php echo wp_sprintf( __( 'Email: %s', 'invoicing' ), $email_from );?>
46
+                        <?php echo wp_sprintf(__('Email: %s', 'invoicing'), $email_from); ?>
47 47
                     </div>
48 48
                 <?php } ?>
49 49
 
50
-                <?php do_action( 'getpaid_company_address_bottom' ); ?>
50
+                <?php do_action('getpaid_company_address_bottom'); ?>
51 51
 
52 52
             </div>
53 53
 
Please login to merge, or discard this patch.
templates/invoice/line-item.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,68 +7,68 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-do_action( 'getpaid_before_invoice_line_item', $invoice, $item );
12
+do_action('getpaid_before_invoice_line_item', $invoice, $item);
13 13
 
14 14
 ?>
15 15
 
16
-<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo sanitize_html_class( $item->get_type() ); ?>'>
16
+<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo sanitize_html_class($item->get_type()); ?>'>
17 17
 
18 18
     <div class="form-row">
19 19
 
20
-        <?php foreach ( array_keys( $columns ) as $column ): ?>
20
+        <?php foreach (array_keys($columns) as $column): ?>
21 21
 
22
-            <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-item-<?php echo sanitize_html_class( $column ); ?>">
22
+            <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-item-<?php echo sanitize_html_class($column); ?>">
23 23
 
24 24
                 <?php
25 25
 
26 26
                     // Fires before printing a line item column.
27
-                    do_action( "getpaid_invoice_line_item_before_$column", $item, $invoice );
27
+                    do_action("getpaid_invoice_line_item_before_$column", $item, $invoice);
28 28
 
29 29
                     // Item name.
30
-                    if ( 'name' == $column ) {
30
+                    if ('name' == $column) {
31 31
 
32 32
                         // Display the name.
33
-                        echo '<div class="mb-1">' . sanitize_text_field( $item->get_name() ) . '</div>';
33
+                        echo '<div class="mb-1">' . sanitize_text_field($item->get_name()) . '</div>';
34 34
 
35 35
                         // And an optional description.
36 36
                         $description = $item->get_description();
37 37
 
38
-                        if ( ! empty( $description ) ) {
39
-                            $description = wp_kses_post( $description );
38
+                        if (!empty($description)) {
39
+                            $description = wp_kses_post($description);
40 40
                             echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
41 41
                         }
42 42
 
43 43
                     }
44 44
 
45 45
                     // Item price.
46
-                    if ( 'price' == $column ) {
46
+                    if ('price' == $column) {
47 47
 
48 48
                         // Display the item price (or recurring price if this is a renewal invoice)
49
-                        if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
50
-                            echo wpinv_price( wpinv_format_amount( $item->get_price() ), $invoice->get_currency() );
49
+                        if ($invoice->is_recurring() && $invoice->is_renewal()) {
50
+                            echo wpinv_price(wpinv_format_amount($item->get_price()), $invoice->get_currency());
51 51
                         } else {
52
-                            echo wpinv_price( wpinv_format_amount( $item->get_initial_price() ), $invoice->get_currency() );
52
+                            echo wpinv_price(wpinv_format_amount($item->get_initial_price()), $invoice->get_currency());
53 53
                         }
54 54
 
55 55
                     }
56 56
 
57 57
                     // Item quantity.
58
-                    if ( 'quantity' == $column ) {
58
+                    if ('quantity' == $column) {
59 59
                         echo (int) $item->get_qantity();
60 60
                     }
61 61
 
62 62
                     // Item sub total.
63
-                    if ( 'subtotal' == $column ) {
64
-                        echo wpinv_price( wpinv_format_amount( $item->get_sub_total() ), $invoice->get_currency() );
63
+                    if ('subtotal' == $column) {
64
+                        echo wpinv_price(wpinv_format_amount($item->get_sub_total()), $invoice->get_currency());
65 65
                     }
66 66
 
67 67
                     // Fires when printing a line item column.
68
-                    do_action( "getpaid_invoice_line_item_$column", $item, $invoice );
68
+                    do_action("getpaid_invoice_line_item_$column", $item, $invoice);
69 69
 
70 70
                     // Fires after printing a line item column.
71
-                    do_action( "getpaid_invoice_line_item_after_$column", $item, $invoice );
71
+                    do_action("getpaid_invoice_line_item_after_$column", $item, $invoice);
72 72
 
73 73
                 ?>
74 74
 
Please login to merge, or discard this patch.
widgets/checkout.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -45,17 +45,17 @@
 block discarded – undo
45 45
         parent::__construct( $options );
46 46
     }
47 47
 
48
-	/**
49
-	 * The Super block output function.
50
-	 *
51
-	 * @param array $args
52
-	 * @param array $widget_args
53
-	 * @param string $content
54
-	 *
55
-	 * @return mixed|string|bool
56
-	 */
48
+    /**
49
+     * The Super block output function.
50
+     *
51
+     * @param array $args
52
+     * @param array $widget_args
53
+     * @param string $content
54
+     *
55
+     * @return mixed|string|bool
56
+     */
57 57
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
58
-	    return wpinv_checkout_form();
58
+        return wpinv_checkout_form();
59 59
     }
60 60
 
61 61
 }
Please login to merge, or discard this patch.