Passed
Push — master ( 7976db...0f89d8 )
by Brian
15:01 queued 09:59
created
templates/subscriptions/subscriptions-table-row.php 1 patch
Switch Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -20,35 +20,35 @@
 block discarded – undo
20 20
 
21 21
 		switch ( $column ) :
22 22
 
23
-		case 'subscription':
24
-			$subscription_id = (int) $subscription->get_id();
25
-			$url             = esc_url( $subscription->get_view_url() );
26
-			$id_label        = sprintf(
27
-				esc_attr_x( '#%s', 'subscription id', 'invoicing' ),
28
-				(int) $subscription->get_id()
29
-			);
30
-			echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription );
31
-			break;
32
-
33
-		case 'status':
34
-			echo esc_html( $subscription->get_status_label() );
35
-			break;
36
-
37
-		case 'renewal-date':
38
-			$renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() );
39
-			echo $subscription->is_active() ? esc_html( $renewal ) : '&mdash;';
40
-			break;
41
-
42
-		case 'amount':
43
-			$frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' );
44
-			$amount    = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() );
45
-			echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" );
46
-			break;
47
-
48
-		endswitch;
49
-
50
-		do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription );
51
-
52
-	echo '</td>';
53
-
54
-endforeach;
23
+		    case 'subscription':
24
+			    $subscription_id = (int) $subscription->get_id();
25
+			    $url             = esc_url( $subscription->get_view_url() );
26
+			    $id_label        = sprintf(
27
+				    esc_attr_x( '#%s', 'subscription id', 'invoicing' ),
28
+				    (int) $subscription->get_id()
29
+			    );
30
+			    echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription );
31
+			    break;
32
+
33
+		    case 'status':
34
+			    echo esc_html( $subscription->get_status_label() );
35
+			    break;
36
+
37
+		    case 'renewal-date':
38
+			    $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() );
39
+			    echo $subscription->is_active() ? esc_html( $renewal ) : '&mdash;';
40
+			    break;
41
+
42
+		    case 'amount':
43
+			    $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' );
44
+			    $amount    = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() );
45
+			    echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" );
46
+			    break;
47
+
48
+		    endswitch;
49
+
50
+		    do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription );
51
+
52
+	    echo '</td>';
53
+
54
+    endforeach;
Please login to merge, or discard this patch.
templates/subscriptions/subscription-details.php 1 patch
Switch Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Template that prints a single subscription's details
4 4
  *
@@ -9,19 +9,19 @@  discard block
 block discarded – undo
9 9
  * @var WPInv_Subscriptions_Widget $widget
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+    defined( 'ABSPATH' ) || exit;
13 13
 
14
-do_action( 'getpaid_single_subscription_before_notices', $subscription );
14
+    do_action( 'getpaid_single_subscription_before_notices', $subscription );
15 15
 
16
-// Display errors and notices.
17
-wpinv_print_errors();
16
+    // Display errors and notices.
17
+    wpinv_print_errors();
18 18
 
19
-$subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() );
20
-$subscription_group  = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() );
19
+    $subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() );
20
+    $subscription_group  = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() );
21 21
 
22
-do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups );
22
+    do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups );
23 23
 
24
-?>
24
+    ?>
25 25
 
26 26
 <style>
27 27
 	.entry-header,
@@ -46,59 +46,59 @@  discard block
 block discarded – undo
46 46
 				<td style="width: 65%">
47 47
 					<?php
48 48
 
49
-						switch ( $key ) {
49
+						    switch ( $key ) {
50 50
 
51
-						case 'status':
52
-							echo esc_html( $subscription->get_status_label() );
53
-							break;
51
+						        case 'status':
52
+							        echo esc_html( $subscription->get_status_label() );
53
+							        break;
54 54
 
55
-						case 'start_date':
56
-							echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) );
57
-							break;
55
+						        case 'start_date':
56
+							        echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) );
57
+							        break;
58 58
 
59
-						case 'expiry_date':
60
-							echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) );
61
-							break;
59
+						        case 'expiry_date':
60
+							        echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) );
61
+							        break;
62 62
 
63
-						case 'initial_amount':
64
-							echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() );
63
+						        case 'initial_amount':
64
+							        echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() );
65 65
 
66
-							if ( $subscription->has_trial_period() ) {
66
+							        if ( $subscription->has_trial_period() ) {
67 67
 
68
-								echo "<small class='text-muted'>&nbsp;";
69
-								printf(
70
-									_x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ),
71
-									esc_html( $subscription->get_trial_period() )
72
-								);
73
-								echo '</small>';
68
+								        echo "<small class='text-muted'>&nbsp;";
69
+								        printf(
70
+									        _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ),
71
+									        esc_html( $subscription->get_trial_period() )
72
+								        );
73
+								        echo '</small>';
74 74
 
75
-							}
75
+							        }
76 76
 
77
-							break;
77
+							        break;
78 78
 
79
-						case 'recurring_amount':
80
-							$frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' );
81
-							$amount    = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() );
82
-							echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) );
83
-							break;
79
+						        case 'recurring_amount':
80
+							        $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' );
81
+							        $amount    = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() );
82
+							        echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) );
83
+							        break;
84 84
 
85
-						case 'item':
86
-							if ( empty( $subscription_group ) ) {
87
-								echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) );
88
-								} else {
89
-								$markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) );
90
-								echo wp_kses_post( implode( ' | ', $markup ) );
91
-								}
85
+						        case 'item':
86
+							        if ( empty( $subscription_group ) ) {
87
+								        echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) );
88
+								        } else {
89
+								        $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) );
90
+								        echo wp_kses_post( implode( ' | ', $markup ) );
91
+								        }
92 92
 
93
-							break;
93
+							        break;
94 94
 
95
-						case 'payments':
96
-							$max_activations = (int) $subscription->get_bill_times();
97
-							echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '&infin;' : (int) $max_activations );
95
+						        case 'payments':
96
+							        $max_activations = (int) $subscription->get_bill_times();
97
+							        echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '&infin;' : (int) $max_activations );
98 98
 
99
-							break;
99
+							        break;
100 100
 
101
-						}
101
+						    }
102 102
 						do_action( "getpaid_render_single_subscription_column_$key", $subscription );
103 103
 
104 104
 					?>
Please login to merge, or discard this patch.
includes/admin/subscriptions.php 1 patch
Switch Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -512,37 +512,37 @@  discard block
 block discarded – undo
512 512
 
513 513
 								switch ( $key ) {
514 514
 
515
-								case 'total':
516
-										echo '<strong>' . wpinv_price( $payment->get_total(), $payment->get_currency() ) . '</strong>';
517
-									break;
518
-
519
-								case 'relationship':
520
-											echo $payment->is_renewal() ? __( 'Renewal Invoice', 'invoicing' ) : __( 'Initial Invoice', 'invoicing' );
521
-									break;
522
-
523
-								case 'date':
524
-									echo getpaid_format_date_value( $payment->get_date_created() );
525
-									break;
526
-
527
-								case 'status':
528
-										$status = $payment->get_status_nicename();
529
-										if ( is_admin() ) {
530
-										$status = $payment->get_status_label_html();
531
-										}
515
+								    case 'total':
516
+										    echo '<strong>' . wpinv_price( $payment->get_total(), $payment->get_currency() ) . '</strong>';
517
+									    break;
532 518
 
533
-										echo wp_kses_post( $status );
534
-									break;
519
+								    case 'relationship':
520
+											    echo $payment->is_renewal() ? __( 'Renewal Invoice', 'invoicing' ) : __( 'Initial Invoice', 'invoicing' );
521
+									    break;
535 522
 
536
-								case 'invoice':
537
-										$link    = esc_url( get_edit_post_link( $payment->get_id() ) );
523
+								    case 'date':
524
+									    echo getpaid_format_date_value( $payment->get_date_created() );
525
+									    break;
538 526
 
539
-										if ( ! is_admin() ) {
540
-										$link = esc_url( $payment->get_view_url() );
541
-										}
527
+								    case 'status':
528
+										    $status = $payment->get_status_nicename();
529
+										    if ( is_admin() ) {
530
+										    $status = $payment->get_status_label_html();
531
+										    }
532
+
533
+										    echo wp_kses_post( $status );
534
+									    break;
535
+
536
+								    case 'invoice':
537
+										    $link    = esc_url( get_edit_post_link( $payment->get_id() ) );
538
+
539
+										    if ( ! is_admin() ) {
540
+										    $link = esc_url( $payment->get_view_url() );
541
+										    }
542 542
 
543
-										$invoice = esc_html( $payment->get_number() );
544
-										echo "<a href='$link'>$invoice</a>";
545
-									break;
543
+										    $invoice = esc_html( $payment->get_number() );
544
+										    echo "<a href='$link'>$invoice</a>";
545
+									    break;
546 546
 										}
547 547
 
548 548
 								echo '</td>';
@@ -641,37 +641,37 @@  discard block
 block discarded – undo
641 641
 
642 642
 								switch ( $key ) {
643 643
 
644
-								case 'item_name':
645
-										$item_name = get_the_title( $subscription_group_item['item_id'] );
646
-										$item_name = empty( $item_name ) ? $subscription_group_item['item_name'] : $item_name;
644
+								    case 'item_name':
645
+										    $item_name = get_the_title( $subscription_group_item['item_id'] );
646
+										    $item_name = empty( $item_name ) ? $subscription_group_item['item_name'] : $item_name;
647 647
 
648
-										if ( $invoice->get_template() == 'amount' || 1 == (float) $subscription_group_item['quantity'] ) {
649
-										echo esc_html( $item_name );
650
-										} else {
651
-										printf( '%1$s x %2$d', esc_html( $item_name ), (float) $subscription_group_item['quantity'] );
652
-											}
648
+										    if ( $invoice->get_template() == 'amount' || 1 == (float) $subscription_group_item['quantity'] ) {
649
+										    echo esc_html( $item_name );
650
+										    } else {
651
+										    printf( '%1$s x %2$d', esc_html( $item_name ), (float) $subscription_group_item['quantity'] );
652
+											    }
653 653
 
654
-									break;
654
+									    break;
655 655
 
656
-								case 'price':
657
-											echo wpinv_price( $subscription_group_item['item_price'], $invoice->get_currency() );
658
-									break;
656
+								    case 'price':
657
+											    echo wpinv_price( $subscription_group_item['item_price'], $invoice->get_currency() );
658
+									    break;
659 659
 
660
-								case 'tax':
661
-									echo wpinv_price( $subscription_group_item['tax'], $invoice->get_currency() );
662
-									break;
660
+								    case 'tax':
661
+									    echo wpinv_price( $subscription_group_item['tax'], $invoice->get_currency() );
662
+									    break;
663 663
 
664
-								case 'discount':
665
-										echo wpinv_price( $subscription_group_item['discount'], $invoice->get_currency() );
666
-									break;
664
+								    case 'discount':
665
+										    echo wpinv_price( $subscription_group_item['discount'], $invoice->get_currency() );
666
+									    break;
667 667
 
668
-								case 'initial':
669
-										echo wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() );
670
-									break;
668
+								    case 'initial':
669
+										    echo wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() );
670
+									    break;
671 671
 
672
-								case 'recurring':
673
-										echo '<strong>' . wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ) . '</strong>';
674
-									break;
672
+								    case 'recurring':
673
+										    echo '<strong>' . wpinv_price( $subscription_group_item['price'] * $subscription_group_item['quantity'], $invoice->get_currency() ) . '</strong>';
674
+									    break;
675 675
 
676 676
 										}
677 677
 
@@ -695,29 +695,29 @@  discard block
 block discarded – undo
695 695
 
696 696
 								switch ( $key ) {
697 697
 
698
-								case 'item_name':
699
-										echo esc_html( $subscription_group_fee['name'] );
700
-									break;
698
+								    case 'item_name':
699
+										    echo esc_html( $subscription_group_fee['name'] );
700
+									    break;
701 701
 
702
-								case 'price':
703
-											echo wpinv_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() );
704
-									break;
702
+								    case 'price':
703
+											    echo wpinv_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() );
704
+									    break;
705 705
 
706
-								case 'tax':
707
-									echo '&mdash;';
708
-									break;
706
+								    case 'tax':
707
+									    echo '&mdash;';
708
+									    break;
709 709
 
710
-								case 'discount':
711
-										echo '&mdash;';
712
-									break;
710
+								    case 'discount':
711
+										    echo '&mdash;';
712
+									    break;
713 713
 
714
-								case 'initial':
715
-										echo wpinv_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() );
716
-									break;
714
+								    case 'initial':
715
+										    echo wpinv_price( $subscription_group_fee['initial_fee'], $invoice->get_currency() );
716
+									    break;
717 717
 
718
-								case 'recurring':
719
-										echo '<strong>' . wpinv_price( $subscription_group_fee['recurring_fee'], $invoice->get_currency() ) . '</strong>';
720
-									break;
718
+								    case 'recurring':
719
+										    echo '<strong>' . wpinv_price( $subscription_group_fee['recurring_fee'], $invoice->get_currency() ) . '</strong>';
720
+									    break;
721 721
 
722 722
 										}
723 723
 
@@ -826,39 +826,39 @@  discard block
 block discarded – undo
826 826
 
827 827
 								switch ( $key ) {
828 828
 
829
-								case 'status':
830
-										echo wp_kses_post( $_suscription->get_status_label_html() );
831
-									break;
832
-
833
-								case 'item':
834
-											$markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) );
835
-											echo implode( ' | ', $markup );
836
-									break;
837
-
838
-								case 'renewals':
839
-									$max_bills = $_suscription->get_bill_times();
840
-									echo ( (int) $_suscription->get_times_billed() ) . ' / ' . ( empty( $max_bills ) ? '&infin;' : (int) $max_bills );
841
-									break;
842
-
843
-								case 'renewal_date':
844
-										echo $_suscription->is_active() ? getpaid_format_date_value( $_suscription->get_expiration() ) : '&mdash;';
845
-									break;
846
-
847
-								case 'start_date':
848
-										echo 'pending' == $_suscription->get_status() ? '&mdash;' : getpaid_format_date_value( $_suscription->get_date_created() );
849
-									break;
850
-
851
-								case 'subscription':
852
-										$url = is_admin() ? admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $_suscription->get_id() ) ) : $_suscription->get_view_url();
853
-										printf(
854
-                                            '%1$s#%2$s%3$s',
855
-                                            '<a href="' . esc_url( $url ) . '">',
856
-                                            '<strong>' . intval( $_suscription->get_id() ) . '</strong>',
857
-											'</a>'
858
-                                        );
859
-
860
-											echo WPInv_Subscriptions_List_Table::column_amount( $_suscription );
861
-									break;
829
+								    case 'status':
830
+										    echo wp_kses_post( $_suscription->get_status_label_html() );
831
+									    break;
832
+
833
+								    case 'item':
834
+											    $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) );
835
+											    echo implode( ' | ', $markup );
836
+									    break;
837
+
838
+								    case 'renewals':
839
+									    $max_bills = $_suscription->get_bill_times();
840
+									    echo ( (int) $_suscription->get_times_billed() ) . ' / ' . ( empty( $max_bills ) ? '&infin;' : (int) $max_bills );
841
+									    break;
842
+
843
+								    case 'renewal_date':
844
+										    echo $_suscription->is_active() ? getpaid_format_date_value( $_suscription->get_expiration() ) : '&mdash;';
845
+									    break;
846
+
847
+								    case 'start_date':
848
+										    echo 'pending' == $_suscription->get_status() ? '&mdash;' : getpaid_format_date_value( $_suscription->get_date_created() );
849
+									    break;
850
+
851
+								    case 'subscription':
852
+										    $url = is_admin() ? admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $_suscription->get_id() ) ) : $_suscription->get_view_url();
853
+										    printf(
854
+                                                '%1$s#%2$s%3$s',
855
+                                                '<a href="' . esc_url( $url ) . '">',
856
+                                                '<strong>' . intval( $_suscription->get_id() ) . '</strong>',
857
+											    '</a>'
858
+                                            );
859
+
860
+											    echo WPInv_Subscriptions_List_Table::column_amount( $_suscription );
861
+									    break;
862 862
 
863 863
 										}
864 864
 
Please login to merge, or discard this patch.