Passed
Pull Request — master (#419)
by Brian
04:58
created
templates/payment-forms-admin/previews/items.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 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
 ?>
13 13
 
14 14
 <div v-if='!is_default'>
15
-    <div v-if='! canCheckoutSeveralSubscriptions(form_element)' class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here. Click to set items.', 'invoicing' ) ?></div>
16
-    <div v-if='canCheckoutSeveralSubscriptions(form_element)' class='alert alert-danger' role='alert'><?php _e( 'Your form allows customers to buy several recurring items. This is not supported and might lead to unexpected behaviour.', 'invoicing' ); ?></div>
15
+    <div v-if='! canCheckoutSeveralSubscriptions(form_element)' class='alert alert-info' role='alert'><?php _e('Item totals will appear here. Click to set items.', 'invoicing') ?></div>
16
+    <div v-if='canCheckoutSeveralSubscriptions(form_element)' class='alert alert-danger' role='alert'><?php _e('Your form allows customers to buy several recurring items. This is not supported and might lead to unexpected behaviour.', 'invoicing'); ?></div>
17 17
 </div>
18 18
 
19 19
 <div v-if='is_default'>
20
-    <div class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here.', 'invoicing' ) ?></div>
20
+    <div class='alert alert-info' role='alert'><?php _e('Item totals will appear here.', 'invoicing') ?></div>
21 21
 </div>
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/address.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 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
 ?>
13 13
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/total_payable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 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
 echo aui()->alert(
13 13
     array(
14
-        'content'     => esc_html__( 'The total payable amount will appear here', 'invoicing' ),
14
+        'content'     => esc_html__('The total payable amount will appear here', 'invoicing'),
15 15
         'type'        => 'info',
16 16
     )
17 17
 );
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/discount.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 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
 ?>
13 13
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/paragraph.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 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
 ?>
13 13
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/ip_address.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@
 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
 ?>
13 13
 <span>{{form_element.text}}</span>
14 14
 <a target='_blank' href="#">
15
-    <?php echo sanitize_text_field( wpinv_get_ip() ); ?>&nbsp;&nbsp;<i class='fa fa-external-link-square' aria-hidden='true'></i>
15
+    <?php echo sanitize_text_field(wpinv_get_ip()); ?>&nbsp;&nbsp;<i class='fa fa-external-link-square' aria-hidden='true'></i>
16 16
 </a>
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/pay_button.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 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
 ?>
13 13
 
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/gateway_select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 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
 echo aui()->alert(
13 13
     array(
14
-        'content'     => esc_html__( 'The gateway select box will appear here', 'invoicing' ),
14
+        'content'     => esc_html__('The gateway select box will appear here', 'invoicing'),
15 15
         'type'        => 'info',
16 16
     )
17 17
 );
Please login to merge, or discard this patch.
includes/class-wpinv-payment-form-elements.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
     exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
 
14 14
     public function __construct() {
15 15
 
16
-        foreach( $this->get_elements() as $element ) {
16
+        foreach ($this->get_elements() as $element) {
17 17
             $element = $element['type'];
18 18
 
19
-            if ( method_exists( $this, "render_{$element}_template" ) ) {
20
-                add_action( 'wpinv_payment_form_render_element_template', array( $this, "render_{$element}_template" ), 10, 2 );
19
+            if (method_exists($this, "render_{$element}_template")) {
20
+                add_action('wpinv_payment_form_render_element_template', array($this, "render_{$element}_template"), 10, 2);
21 21
             }
22 22
 
23 23
         }
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function get_elements() {
31 31
 
32
-        if ( ! empty( $this->elements ) ) {
32
+        if (!empty($this->elements)) {
33 33
             return $this->elements;
34 34
         }
35 35
 
36
-        $this->elements = wpinv_get_data( 'payment-form-elements' );
36
+        $this->elements = wpinv_get_data('payment-form-elements');
37 37
 
38
-        $this->elements = apply_filters( 'wpinv_filter_core_payment_form_elements', $this->elements );
38
+        $this->elements = apply_filters('wpinv_filter_core_payment_form_elements', $this->elements);
39 39
         return $this->elements;
40 40
     }
41 41
 
42 42
     /**
43 43
      * Returns the restrict markup.
44 44
      */
45
-    public function get_restrict_markup( $field, $field_type ) {
45
+    public function get_restrict_markup($field, $field_type) {
46 46
         $restrict = "$field.type=='$field_type'";
47 47
         return "v-if=\"$restrict\"";
48 48
     }
@@ -50,39 +50,39 @@  discard block
 block discarded – undo
50 50
     /**
51 51
      * Returns an array of items for the currently being edited form.
52 52
      */
53
-    public function get_form_items( $id = false ) {
54
-        $form = new GetPaid_Payment_Form( $id );
53
+    public function get_form_items($id = false) {
54
+        $form = new GetPaid_Payment_Form($id);
55 55
 
56 56
         // Is this a default form?
57
-        if ( $form->is_default() ) {
57
+        if ($form->is_default()) {
58 58
             return array();
59 59
         }
60 60
 
61
-        return $form->get_items( 'view', 'arrays' );
61
+        return $form->get_items('view', 'arrays');
62 62
     }
63 63
 
64 64
     /**
65 65
      * Converts form items for use.
66 66
      */
67
-    public function convert_checkout_items( $items, $invoice ) {
67
+    public function convert_checkout_items($items, $invoice) {
68 68
 
69 69
         $converted = array();
70
-        foreach ( $items as $item ) {
70
+        foreach ($items as $item) {
71 71
 
72 72
             $item_id = $item['id'];
73
-            $_item   = new WPInv_Item( $item_id );
73
+            $_item   = new WPInv_Item($item_id);
74 74
 
75
-            if( ! $_item ) {
75
+            if (!$_item) {
76 76
                 continue;
77 77
             }
78 78
 
79 79
             $converted[] = array(
80
-                'title'            => esc_html( wpinv_get_cart_item_name( $item ) ) . wpinv_get_item_suffix( $_item ),
80
+                'title'            => esc_html(wpinv_get_cart_item_name($item)) . wpinv_get_item_suffix($_item),
81 81
                 'id'               => $item['id'],
82 82
                 'price'            => $item['subtotal'],
83 83
                 'custom_price'     => $_item->get_is_dynamic_pricing(),
84 84
                 'recurring'        => $_item->is_recurring(),
85
-                'description'      => apply_filters( 'wpinv_checkout_cart_line_item_summary', '', $item, $_item, $invoice ),
85
+                'description'      => apply_filters('wpinv_checkout_cart_line_item_summary', '', $item, $_item, $invoice),
86 86
                 'minimum_price'    => $_item->get_minimum_price(),
87 87
                 'allow_quantities' => false,
88 88
                 'quantity'         => $item['quantity'],
@@ -96,27 +96,27 @@  discard block
 block discarded – undo
96 96
     /**
97 97
      * Converts an array of id => quantity for use.
98 98
      */
99
-    public function convert_normal_items( $items ) {
99
+    public function convert_normal_items($items) {
100 100
 
101 101
         $converted = array();
102
-        foreach ( $items as $item_id => $quantity ) {
102
+        foreach ($items as $item_id => $quantity) {
103 103
 
104
-            $item   = new WPInv_Item( $item_id );
104
+            $item = new WPInv_Item($item_id);
105 105
 
106
-            if( ! $item ) {
106
+            if (!$item) {
107 107
                 continue;
108 108
             }
109 109
 
110 110
             $converted[] = array(
111
-                'title'            => esc_html( $item->get_name() ) . wpinv_get_item_suffix( $item ),
111
+                'title'            => esc_html($item->get_name()) . wpinv_get_item_suffix($item),
112 112
                 'id'               => $item_id,
113 113
                 'price'            => $item->get_price(),
114 114
                 'custom_price'     => $item->get_is_dynamic_pricing(),
115 115
                 'recurring'        => $item->is_recurring(),
116 116
                 'description'      => $item->get_summary(),
117 117
                 'minimum_price'    => $item->get_minimum_price(),
118
-                'allow_quantities' => ! empty( $quantity ),
119
-                'quantity'         => empty( $quantity ) ? 1 : $quantity,
118
+                'allow_quantities' => !empty($quantity),
119
+                'quantity'         => empty($quantity) ? 1 : $quantity,
120 120
                 'required'         => true,
121 121
             );
122 122
 
@@ -129,19 +129,19 @@  discard block
 block discarded – undo
129 129
     /**
130 130
      * Returns an array of elements for the currently being edited form.
131 131
      */
132
-    public function get_form_elements( $id = false ) {
132
+    public function get_form_elements($id = false) {
133 133
 
134
-        if ( empty( $id ) ) {
135
-            return wpinv_get_data( 'sample-payment-form' );
134
+        if (empty($id)) {
135
+            return wpinv_get_data('sample-payment-form');
136 136
         }
137 137
         
138
-        $form_elements = get_post_meta( $id, 'wpinv_form_elements', true );
138
+        $form_elements = get_post_meta($id, 'wpinv_form_elements', true);
139 139
 
140
-        if ( is_array( $form_elements ) ) {
140
+        if (is_array($form_elements)) {
141 141
             return $form_elements;
142 142
         }
143 143
 
144
-        return wpinv_get_data( 'sample-payment-form' );
144
+        return wpinv_get_data('sample-payment-form');
145 145
     }
146 146
 
147 147
 }
Please login to merge, or discard this patch.