Passed
Push — master ( 9f060d...75dadc )
by Brian
04:41
created
templates/payment-forms/variations/select.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  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
 // Prepare the selectable items.
13 13
 $selectable = array();
14
-foreach ( $form->get_items() as $item ) {
15
-    if ( ! $item->is_required ) {
16
-        $selectable[$item->get_id()] = strip_tags( $item->get_name() . ' — ' . wpinv_price( wpinv_format_amount( $item->get_initial_price() ) ) );
14
+foreach ($form->get_items() as $item) {
15
+    if (!$item->is_required) {
16
+        $selectable[$item->get_id()] = strip_tags($item->get_name() . ' — ' . wpinv_price(wpinv_format_amount($item->get_initial_price())));
17 17
     }
18 18
 }
19 19
 
20
-if ( empty( $selectable ) ) {
20
+if (empty($selectable)) {
21 21
     return;
22 22
 }
23 23
 
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 echo aui()->select(
28 28
     array(
29 29
         'name'       => 'getpaid-payment-form-selected-item',
30
-        'id'         => 'getpaid-payment-form-selected-item' . uniqid( '_' ),
30
+        'id'         => 'getpaid-payment-form-selected-item' . uniqid('_'),
31 31
         'required'   => true,
32
-        'label'      => __( 'Select Item', 'invoicing' ),
32
+        'label'      => __('Select Item', 'invoicing'),
33 33
         'label_type' => 'vertical',
34 34
         'inline'     => false,
35 35
         'options'    => $selectable,
Please login to merge, or discard this patch.
includes/payments/class-getpaid-form-item.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
 	exit;
4 4
 }
5 5
 
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 	 * @param  string $context View or edit context.
88 88
 	 * @return string
89 89
 	 */
90
-	public function get_name( $context = 'view' ) {
91
-		$name = parent::get_name( $context );
92
-		return $name . wpinv_get_item_suffix( $this );
90
+	public function get_name($context = 'view') {
91
+		$name = parent::get_name($context);
92
+		return $name . wpinv_get_item_suffix($this);
93 93
 	}
94 94
 
95 95
 	/**
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	 * @param  string $context View or edit context.
100 100
 	 * @return string
101 101
 	 */
102
-	public function get_raw_name( $context = 'view' ) {
103
-		return parent::get_name( $context );
102
+	public function get_raw_name($context = 'view') {
103
+		return parent::get_name($context);
104 104
 	}
105 105
 
106 106
 	/**
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
 	 * @param  string $context View or edit context.
111 111
 	 * @return string
112 112
 	 */
113
-	public function get_description( $context = 'view' ) {
113
+	public function get_description($context = 'view') {
114 114
 
115
-		if ( isset( $this->custom_description ) ) {
115
+		if (isset($this->custom_description)) {
116 116
 			return $this->custom_description;
117 117
 		}
118 118
 
119
-		return parent::get_description( $context );
119
+		return parent::get_description($context);
120 120
 	}
121 121
 
122 122
 	/**
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 	 * @param  string $context View or edit context.
127 127
 	 * @return float
128 128
 	 */
129
-	public function get_sub_total( $context = 'view' ) {
130
-		return $this->get_quantity( $context ) * $this->get_initial_price( $context );
129
+	public function get_sub_total($context = 'view') {
130
+		return $this->get_quantity($context) * $this->get_initial_price($context);
131 131
 	}
132 132
 
133 133
 	/**
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 	 * @param  string $context View or edit context.
138 138
 	 * @return float
139 139
 	 */
140
-	public function get_recurring_sub_total( $context = 'view' ) {
140
+	public function get_recurring_sub_total($context = 'view') {
141 141
 
142
-		if ( $this->is_recurring() ) {
143
-			return $this->get_quantity( $context ) * $this->get_price( $context );
142
+		if ($this->is_recurring()) {
143
+			return $this->get_quantity($context) * $this->get_price($context);
144 144
 		}
145 145
 
146 146
 		return 0;
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	/**
150 150
 	 * @deprecated
151 151
 	 */
152
-	public function get_qantity( $context = 'view' ) {
153
-		return $this->get_quantity( $context );
152
+	public function get_qantity($context = 'view') {
153
+		return $this->get_quantity($context);
154 154
 	}
155 155
 
156 156
 	/**
@@ -160,15 +160,15 @@  discard block
 block discarded – undo
160 160
 	 * @param  string $context View or edit context.
161 161
 	 * @return int
162 162
 	 */
163
-	public function get_quantity( $context = 'view' ) {
163
+	public function get_quantity($context = 'view') {
164 164
 		$quantity = (int) $this->quantity;
165 165
 
166
-		if ( empty( $quantity ) || 1 > $quantity ) {
166
+		if (empty($quantity) || 1 > $quantity) {
167 167
 			$quantity = 1;
168 168
 		}
169 169
 
170
-		if ( 'view' == $context ) {
171
-			return apply_filters( 'getpaid_payment_form_item_quantity', $quantity, $this );
170
+		if ('view' == $context) {
171
+			return apply_filters('getpaid_payment_form_item_quantity', $quantity, $this);
172 172
 		}
173 173
 
174 174
 		return $quantity;
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
 	 * @param  string $context View or edit context.
183 183
 	 * @return meta
184 184
 	 */
185
-	public function get_item_meta( $context = 'view' ) {
185
+	public function get_item_meta($context = 'view') {
186 186
 		$meta = $this->meta;
187 187
 
188
-		if ( 'view' == $context ) {
189
-			return apply_filters( 'getpaid_payment_form_item_meta', $meta, $this );
188
+		if ('view' == $context) {
189
+			return apply_filters('getpaid_payment_form_item_meta', $meta, $this);
190 190
 		}
191 191
 
192 192
 		return $meta;
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 	 * @param  string $context View or edit context.
201 201
 	 * @return bool
202 202
 	 */
203
-	public function get_allow_quantities( $context = 'view' ) {
203
+	public function get_allow_quantities($context = 'view') {
204 204
 		$allow_quantities = (bool) $this->allow_quantities;
205 205
 
206
-		if ( 'view' == $context ) {
207
-			return apply_filters( 'getpaid_payment_form_item_allow_quantities', $allow_quantities, $this );
206
+		if ('view' == $context) {
207
+			return apply_filters('getpaid_payment_form_item_allow_quantities', $allow_quantities, $this);
208 208
 		}
209 209
 
210 210
 		return $allow_quantities;
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
 	 * @param  string $context View or edit context.
219 219
 	 * @return bool
220 220
 	 */
221
-	public function get_is_required( $context = 'view' ) {
221
+	public function get_is_required($context = 'view') {
222 222
 		$is_required = (bool) $this->is_required;
223 223
 
224
-		if ( 'view' == $context ) {
225
-			return apply_filters( 'getpaid_payment_form_item_is_required', $is_required, $this );
224
+		if ('view' == $context) {
225
+			return apply_filters('getpaid_payment_form_item_is_required', $is_required, $this);
226 226
 		}
227 227
 
228 228
 		return $is_required;
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 	 * @since 1.0.19
236 236
 	 * @return array
237 237
 	 */
238
-	public function prepare_data_for_use( $required = null ) {
238
+	public function prepare_data_for_use($required = null) {
239 239
 
240
-		$required = is_null( $required ) ? $this->is_required() : $required;
240
+		$required = is_null($required) ? $this->is_required() : $required;
241 241
 		return array(
242
-			'title'            => strip_tags( $this->get_name() ),
242
+			'title'            => strip_tags($this->get_name()),
243 243
 			'id'               => $this->get_id(),
244 244
 			'price'            => $this->get_price(),
245 245
 			'recurring'        => $this->is_recurring(),
@@ -256,28 +256,28 @@  discard block
 block discarded – undo
256 256
 	 * @since 1.0.19
257 257
 	 * @return array
258 258
 	 */
259
-	public function prepare_data_for_invoice_edit_ajax( $currency = '' ) {
259
+	public function prepare_data_for_invoice_edit_ajax($currency = '') {
260 260
 
261
-		$description = getpaid_item_recurring_price_help_text( $this, $currency );
261
+		$description = getpaid_item_recurring_price_help_text($this, $currency);
262 262
 
263
-		if ( $description ) {
263
+		if ($description) {
264 264
 			$description = "<div class='getpaid-subscription-help-text'>$description</div>";
265 265
 		}
266 266
 
267 267
 		return array(
268 268
 			'id'     => $this->get_id(),
269 269
 			'texts'  => array(
270
-				'item-name'        => sanitize_text_field( $this->get_name() ),
271
-				'item-description' => wp_kses_post( $this->get_description() ) . $description,
272
-				'item-quantity'    => absint( $this->get_quantity() ),
273
-				'item-price'       => wpinv_price( wpinv_format_amount ( $this->get_price() ), $currency ),
274
-				'item-total'       => wpinv_price( wpinv_format_amount( $this->get_sub_total() ), $currency ),
270
+				'item-name'        => sanitize_text_field($this->get_name()),
271
+				'item-description' => wp_kses_post($this->get_description()) . $description,
272
+				'item-quantity'    => absint($this->get_quantity()),
273
+				'item-price'       => wpinv_price(wpinv_format_amount($this->get_price()), $currency),
274
+				'item-total'       => wpinv_price(wpinv_format_amount($this->get_sub_total()), $currency),
275 275
 			),
276 276
 			'inputs' => array(
277 277
 				'item-id'          => $this->get_id(),
278
-				'item-name'        => sanitize_text_field( $this->get_name() ),
279
-				'item-description' => wp_kses_post( $this->get_description() ),
280
-				'item-quantity'    => absint( $this->get_quantity() ),
278
+				'item-name'        => sanitize_text_field($this->get_name()),
279
+				'item-description' => wp_kses_post($this->get_description()),
280
+				'item-quantity'    => absint($this->get_quantity()),
281 281
 				'item-price'       => $this->get_price(),
282 282
 			)
283 283
 		);
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 		return array(
296 296
 			'post_id'           => $this->invoice_id,
297 297
 			'item_id'           => $this->get_id(),
298
-			'item_name'         => sanitize_text_field( $this->get_raw_name() ),
298
+			'item_name'         => sanitize_text_field($this->get_raw_name()),
299 299
 			'item_description'  => $this->get_description(),
300 300
 			'tax'               => $this->item_tax,
301 301
 			'item_price'        => $this->get_price(),
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
 	 * @since 1.0.19
325 325
 	 * @param  int $quantity The item quantity.
326 326
 	 */
327
-	public function set_quantity( $quantity ) {
327
+	public function set_quantity($quantity) {
328 328
 
329
-		if ( empty( $quantity ) || ! is_numeric( $quantity ) ) {
329
+		if (empty($quantity) || !is_numeric($quantity)) {
330 330
 			$quantity = 1;
331 331
 		}
332 332
 
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
 	 * @since 1.0.19
341 341
 	 * @param  array $meta The item meta data.
342 342
 	 */
343
-	public function set_item_meta( $meta ) {
344
-		$this->meta = maybe_unserialize( $meta );
343
+	public function set_item_meta($meta) {
344
+		$this->meta = maybe_unserialize($meta);
345 345
 	}
346 346
 
347 347
 	/**
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 * @since 1.0.19
351 351
 	 * @param  bool $allow_quantities
352 352
 	 */
353
-	public function set_allow_quantities( $allow_quantities ) {
353
+	public function set_allow_quantities($allow_quantities) {
354 354
 		$this->allow_quantities = (bool) $allow_quantities;
355 355
 	}
356 356
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	 * @since 1.0.19
361 361
 	 * @param  bool $is_required
362 362
 	 */
363
-	public function set_is_required( $is_required ) {
363
+	public function set_is_required($is_required) {
364 364
 		$this->is_required = (bool) $is_required;
365 365
 	}
366 366
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 	 * @since 1.0.19
371 371
 	 * @param  string $description
372 372
 	 */
373
-	public function set_custom_description( $description ) {
373
+	public function set_custom_description($description) {
374 374
 		$this->custom_description = $description;
375 375
 	}
376 376
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
      * 
380 380
 	 * @return int item id
381 381
      */
382
-    public function save( $data = array() ) {
382
+    public function save($data = array()) {
383 383
         return $this->get_id();
384 384
 	}
385 385
 
Please login to merge, or discard this patch.
templates/invoice/details-top.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,18 +7,18 @@  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
-$watermark = wpinv_watermark( $invoice->get_id() )
12
+$watermark = wpinv_watermark($invoice->get_id())
13 13
 
14 14
 ?>
15 15
 
16
-        <?php do_action( 'getpaid_before_invoice_details_top', $invoice ); ?>
16
+        <?php do_action('getpaid_before_invoice_details_top', $invoice); ?>
17 17
 
18
-        <?php if ( ! empty( $watermark ) ) : ?>
18
+        <?php if (!empty($watermark)) : ?>
19 19
 
20 20
             <div class="getpaid-watermark no-print">
21
-                <p><?php echo sanitize_text_field( $watermark ) ?></p>
21
+                <p><?php echo sanitize_text_field($watermark) ?></p>
22 22
             </div>
23 23
 
24 24
         <?php endif; ?>
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
         <div class="getpaid-invoice-details-top mb-5">
27 27
             <div class="row">
28 28
                 <div class="col-12 col-sm-6 text-left">
29
-                    <?php do_action( 'getpaid_invoice_details_top_left', $invoice ); ?>
29
+                    <?php do_action('getpaid_invoice_details_top_left', $invoice); ?>
30 30
                 </div>
31 31
 
32 32
                 <div class="col-12 col-sm-6 text-right">
33
-                    <?php do_action( 'getpaid_invoice_details_top_right', $invoice ); ?>
33
+                    <?php do_action('getpaid_invoice_details_top_right', $invoice); ?>
34 34
                 </div>
35 35
             </div>
36 36
         </div>
37 37
 
38
-        <?php do_action( 'getpaid_after_invoice_details_top', $invoice ); ?>
38
+        <?php do_action('getpaid_after_invoice_details_top', $invoice); ?>
39 39
 
40 40
 <?php
Please login to merge, or discard this patch.
templates/invoice/invoice-meta.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,51 +7,51 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$class = ! is_singular( 'page' ) ? 'table-sm' : '';
12
+$class = !is_singular('page') ? 'table-sm' : '';
13 13
 ?>
14 14
 
15
-        <?php do_action( 'getpaid_before_invoice_meta', $invoice ); ?>
15
+        <?php do_action('getpaid_before_invoice_meta', $invoice); ?>
16 16
         <div class="getpaid-invoice-meta-data">
17 17
 
18 18
 
19
-            <?php do_action( 'getpaid_before_invoice_meta_table', $invoice ); ?>
19
+            <?php do_action('getpaid_before_invoice_meta_table', $invoice); ?>
20 20
             <table class="table <?php echo $class; ?> table-bordered">
21 21
                 <tbody>
22 22
 
23
-                    <?php do_action( "getpaid_before_invoice_meta_rows", $invoice ); ?>
24
-                    <?php foreach ( $meta as $key => $data ) : ?>
23
+                    <?php do_action("getpaid_before_invoice_meta_rows", $invoice); ?>
24
+                    <?php foreach ($meta as $key => $data) : ?>
25 25
 
26
-                        <?php if ( ! empty( $data['value'] ) ) : ?>
26
+                        <?php if (!empty($data['value'])) : ?>
27 27
 
28
-                            <?php do_action( "getpaid_before_invoice_meta_$key", $invoice, $data ); ?>
28
+                            <?php do_action("getpaid_before_invoice_meta_$key", $invoice, $data); ?>
29 29
 
30
-                            <tr class="getpaid-invoice-meta-<?php echo sanitize_html_class( $key ); ?>">
30
+                            <tr class="getpaid-invoice-meta-<?php echo sanitize_html_class($key); ?>">
31 31
 
32 32
                                 <th>
33
-                                    <?php echo sanitize_text_field( $data['label'] ); ?>
33
+                                    <?php echo sanitize_text_field($data['label']); ?>
34 34
                                 </th>
35 35
 
36 36
                                 <td>
37
-                                    <span class="getpaid-invoice-meta-<?php echo sanitize_html_class( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span>
37
+                                    <span class="getpaid-invoice-meta-<?php echo sanitize_html_class($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span>
38 38
                                 </td>
39 39
 
40 40
                             </tr>
41 41
 
42
-                            <?php do_action( "getpaid_after_invoice_meta_$key", $invoice, $data ); ?>
42
+                            <?php do_action("getpaid_after_invoice_meta_$key", $invoice, $data); ?>
43 43
 
44 44
                         <?php endif; ?>
45 45
                     
46 46
                     <?php endforeach; ?>
47
-                    <?php do_action( "getpaid_after_invoice_meta_rows", $invoice ); ?>
47
+                    <?php do_action("getpaid_after_invoice_meta_rows", $invoice); ?>
48 48
 
49 49
                 </tbody>
50 50
             </table>
51
-            <?php do_action( 'getpaid_after_invoice_meta_table', $invoice ); ?>
51
+            <?php do_action('getpaid_after_invoice_meta_table', $invoice); ?>
52 52
 
53 53
 
54 54
         </div>
55
-        <?php do_action( 'getpaid_after_invoice_meta', $invoice ); ?>
55
+        <?php do_action('getpaid_after_invoice_meta', $invoice); ?>
56 56
 
57 57
 <?php
Please login to merge, or discard this patch.
templates/invoice/fee-item.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
  * @var array $fee
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14
-do_action( 'getpaid_before_invoice_fee_item', $invoice, $fee );
14
+do_action('getpaid_before_invoice_fee_item', $invoice, $fee);
15 15
 
16 16
 ?>
17 17
 
@@ -19,61 +19,61 @@  discard block
 block discarded – undo
19 19
 
20 20
     <div class="form-row">
21 21
 
22
-        <?php foreach ( array_keys( $columns ) as $column ): ?>
22
+        <?php foreach (array_keys($columns) as $column): ?>
23 23
 
24
-            <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-item-<?php echo sanitize_html_class( $column ); ?>">
24
+            <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-item-<?php echo sanitize_html_class($column); ?>">
25 25
 
26 26
                 <?php
27 27
 
28 28
                     // Fires before printing a fee item column.
29
-                    do_action( "getpaid_invoice_fee_item_before_$column", $fee, $invoice );
29
+                    do_action("getpaid_invoice_fee_item_before_$column", $fee, $invoice);
30 30
 
31 31
                     // Item name.
32
-                    if ( 'name' == $column ) {
32
+                    if ('name' == $column) {
33 33
 
34 34
                         // Display the name.
35
-                        echo '<div class="mb-1">' . sanitize_text_field( $fee['name'] ) . '</div>';
35
+                        echo '<div class="mb-1">' . sanitize_text_field($fee['name']) . '</div>';
36 36
 
37 37
                         // And an optional description.
38
-                        $description = esc_html__( 'Fee', 'invoicing' );
38
+                        $description = esc_html__('Fee', 'invoicing');
39 39
                         echo "<small class='form-text text-muted pr-2 m-0'>$description</small>";
40 40
 
41 41
                     }
42 42
 
43 43
                     // Item price.
44
-                    if ( 'price' == $column ) {
44
+                    if ('price' == $column) {
45 45
 
46 46
                         // Display the item price (or recurring price if this is a renewal invoice)
47
-                        if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
48
-                            echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
47
+                        if ($invoice->is_recurring() && $invoice->is_renewal()) {
48
+                            echo wpinv_price($fee['recurring_fee'], $invoice->get_currency());
49 49
                         } else {
50
-                            echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
50
+                            echo wpinv_price($fee['initial_fee'], $invoice->get_currency());
51 51
                         }
52 52
 
53 53
                     }
54 54
 
55 55
                     // Item quantity.
56
-                    if ( 'quantity' == $column ) {
56
+                    if ('quantity' == $column) {
57 57
                         echo "&mdash;";
58 58
                     }
59 59
 
60 60
                     // Item sub total.
61
-                    if ( 'subtotal' == $column ) {
61
+                    if ('subtotal' == $column) {
62 62
 
63 63
                         // Display the item price (or recurring price if this is a renewal invoice)
64
-                        if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
65
-                            echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
64
+                        if ($invoice->is_recurring() && $invoice->is_renewal()) {
65
+                            echo wpinv_price($fee['recurring_fee'], $invoice->get_currency());
66 66
                         } else {
67
-                            echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
67
+                            echo wpinv_price($fee['initial_fee'], $invoice->get_currency());
68 68
                         }
69 69
 
70 70
                     }
71 71
 
72 72
                     // Fires when printing a fee item column.
73
-                    do_action( "getpaid_invoice_fee_item_$column", $fee, $invoice );
73
+                    do_action("getpaid_invoice_fee_item_$column", $fee, $invoice);
74 74
 
75 75
                     // Fires after printing a fee item column.
76
-                    do_action( "getpaid_invoice_fee_item_after_$column", $fee, $invoice );
76
+                    do_action("getpaid_invoice_fee_item_after_$column", $fee, $invoice);
77 77
 
78 78
                 ?>
79 79
 
Please login to merge, or discard this patch.
templates/invoice/line-totals.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,26 +9,26 @@  discard block
 block discarded – undo
9 9
  * @var WPInv_Invoice $invoice
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14 14
 // Totals rows.
15
-$totals = getpaid_invoice_totals_rows( $invoice );
15
+$totals = getpaid_invoice_totals_rows($invoice);
16 16
 
17
-do_action( 'getpaid_before_invoice_line_totals', $invoice, $totals );
17
+do_action('getpaid_before_invoice_line_totals', $invoice, $totals);
18 18
 
19 19
 ?>
20 20
 <div class='getpaid-invoice-line-totals'>
21 21
     <div class="row">
22 22
         <div class="col-12 offset-sm-6 col-sm-6 border-left pl-0">
23 23
 
24
-            <?php foreach ( $totals as $key => $label ) : ?>
24
+            <?php foreach ($totals as $key => $label) : ?>
25 25
 
26
-                <div class="getpaid-invoice-line-totals-col <?php echo sanitize_html_class( $key ); ?>">
26
+                <div class="getpaid-invoice-line-totals-col <?php echo sanitize_html_class($key); ?>">
27 27
 
28 28
                     <div class="row">
29 29
 
30 30
                         <div class="col-12 col-sm-8 getpaid-invoice-line-totals-label">
31
-                            <?php echo sanitize_text_field( $label ); ?>
31
+                            <?php echo sanitize_text_field($label); ?>
32 32
                         </div>
33 33
 
34 34
                         <div class="col-12 col-sm-2 getpaid-invoice-line-totals-value">
@@ -36,32 +36,32 @@  discard block
 block discarded – undo
36 36
                             <?php
37 37
 
38 38
                                 // Total tax.
39
-                                if ( 'tax' == $key ) {
40
-                                    echo wpinv_price( wpinv_format_amount( $invoice->get_total_tax() ), $invoice->get_currency() );
39
+                                if ('tax' == $key) {
40
+                                    echo wpinv_price(wpinv_format_amount($invoice->get_total_tax()), $invoice->get_currency());
41 41
                                 }
42 42
 
43 43
                                 // Total Fee.
44
-                                if ( 'fee' == $key ) {
45
-                                    echo wpinv_price( wpinv_format_amount( $invoice->get_total_fees() ), $invoice->get_currency() );
44
+                                if ('fee' == $key) {
45
+                                    echo wpinv_price(wpinv_format_amount($invoice->get_total_fees()), $invoice->get_currency());
46 46
                                 }
47 47
 
48 48
                                 // Total discount.
49
-                                if ( 'discount' == $key ) {
50
-                                    echo wpinv_price( wpinv_format_amount( $invoice->get_total_discount() ), $invoice->get_currency() );
49
+                                if ('discount' == $key) {
50
+                                    echo wpinv_price(wpinv_format_amount($invoice->get_total_discount()), $invoice->get_currency());
51 51
                                 }
52 52
 
53 53
                                 // Sub total.
54
-                                if ( 'subtotal' == $key ) {
55
-                                    echo wpinv_price( wpinv_format_amount( $invoice->get_subtotal() ), $invoice->get_currency() );
54
+                                if ('subtotal' == $key) {
55
+                                    echo wpinv_price(wpinv_format_amount($invoice->get_subtotal()), $invoice->get_currency());
56 56
                                 }
57 57
 
58 58
                                 // Total.
59
-                                if ( 'total' == $key ) {
60
-                                    echo wpinv_price( wpinv_format_amount( $invoice->get_total() ), $invoice->get_currency() );
59
+                                if ('total' == $key) {
60
+                                    echo wpinv_price(wpinv_format_amount($invoice->get_total()), $invoice->get_currency());
61 61
                                 }
62 62
  
63 63
                                 // Fires when printing a cart total.
64
-                                do_action( "getpaid_invoice_cart_totals_$key", $invoice );
64
+                                do_action("getpaid_invoice_cart_totals_$key", $invoice);
65 65
 
66 66
                             ?>
67 67
 
@@ -75,4 +75,4 @@  discard block
 block discarded – undo
75 75
     </div>
76 76
 </div> <!-- end .getpaid-invoice-line-totals -->
77 77
 
78
-<?php do_action(  'getpaid_after_invoice_line_totals', $invoice, $totals ); ?>
78
+<?php do_action('getpaid_after_invoice_line_totals', $invoice, $totals); ?>
Please login to merge, or discard this patch.
templates/invoice/line-items.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,21 +8,21 @@  discard block
 block discarded – undo
8 8
  * @var WPInv_Invoice $invoice
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 ?>
14 14
 
15
-<?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?>
15
+<?php do_action('getpaid_invoice_before_line_items', $invoice); ?>
16 16
 
17
-    <h2 class="mt-5 mb-1 h4"><?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), ucfirst( $invoice->get_type() )); ?></h2>
17
+    <h2 class="mt-5 mb-1 h4"><?php echo sprintf(esc_html__('%s Items', 'invoicing'), ucfirst($invoice->get_type())); ?></h2>
18 18
     <div class="getpaid-invoice-items mb-4 border">
19 19
 
20 20
 
21
-        <div class="getpaid-invoice-items-header <?php echo sanitize_html_class( $invoice->get_template() ); ?>">
21
+        <div class="getpaid-invoice-items-header <?php echo sanitize_html_class($invoice->get_template()); ?>">
22 22
             <div class="form-row">
23
-                <?php foreach ( $columns as $key => $label ) : ?>
24
-                    <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-line-item-col-<?php echo esc_attr( $key ); ?>">
25
-                        <?php echo sanitize_text_field( $label ); ?>
23
+                <?php foreach ($columns as $key => $label) : ?>
24
+                    <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-line-item-col-<?php echo esc_attr($key); ?>">
25
+                        <?php echo sanitize_text_field($label); ?>
26 26
                     </div>
27 27
                 <?php endforeach; ?>
28 28
             </div>
@@ -32,20 +32,20 @@  discard block
 block discarded – undo
32 32
         <?php
33 33
 
34 34
             // Display the item totals.
35
-            foreach ( $invoice->get_items() as $item ) {
36
-                wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) );
35
+            foreach ($invoice->get_items() as $item) {
36
+                wpinv_get_template('invoice/line-item.php', compact('invoice', 'item', 'columns'));
37 37
             }
38 38
 
39 39
             // Display the fee totals.
40
-            foreach ( $invoice->get_fees() as $fee ) {
41
-                wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) );
40
+            foreach ($invoice->get_fees() as $fee) {
41
+                wpinv_get_template('invoice/fee-item.php', compact('invoice', 'fee', 'columns'));
42 42
             }
43 43
 
44 44
             // Display the cart totals.
45
-            wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) );
45
+            wpinv_get_template('invoice/line-totals.php', compact('invoice'));
46 46
 
47 47
         ?>
48 48
 
49 49
     </div>
50 50
 
51
-<?php do_action( 'getpaid_invoice_after_line_items', $invoice ); ?>
51
+<?php do_action('getpaid_invoice_after_line_items', $invoice); ?>
Please login to merge, or discard this patch.
templates/invoice/invoice-type.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
 ?>
13 13
 <h2 class="h3 text-dark">
14
-    <?php echo apply_filters( 'getpaid_invoice_type_label', ucfirst( $invoice->get_type() ), $invoice ); ?>
14
+    <?php echo apply_filters('getpaid_invoice_type_label', ucfirst($invoice->get_type()), $invoice); ?>
15 15
 </h2>
16 16
 
17 17
 <?php
Please login to merge, or discard this patch.
templates/invoice/invoice-logo.php 1 patch
Spacing   +5 added lines, -5 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
-<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
13
+<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>">
14 14
 
15
-    <?php if ( $logo = wpinv_get_business_logo() ) { ?>
16
-        <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>">
15
+    <?php if ($logo = wpinv_get_business_logo()) { ?>
16
+        <img class="logo" style="max-width:100%;" src="<?php echo esc_url($logo); ?>">
17 17
     <?php } else { ?>
18
-        <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1>
18
+        <h1 class="h3"><?php echo esc_html(wpinv_get_business_name()); ?></h1>
19 19
     <?php } ?>
20 20
 
21 21
 </a>
Please login to merge, or discard this patch.