Passed
Push — master ( f00b0d...869d1f )
by Brian
05:34
created

output_related()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Invoice Subscription Details
4
 *
5
 *
6
 */
7
8
if ( ! defined( 'ABSPATH' ) ) {
9
	exit; // Exit if accessed directly
10
}
11
12
/**
13
 * GetPaid_Meta_Box_Invoice_Subscription Class.
14
 */
15
class GetPaid_Meta_Box_Invoice_Subscription {
16
17
    /**
18
	 * Output the subscription metabox.
19
	 *
20
	 * @param WP_Post $post
21
	 */
22
    public static function output( $post ) {
23
24
        // Fetch the invoice.
25
        $invoice = new WPInv_Invoice( $post );
26
27
        // Fetch the subscription.
28
        $subscription = getpaid_get_invoice_subscription( $invoice );
29
30
        echo '<div class="bsui">';
31
        getpaid_admin_subscription_details_metabox( /** @scrutinizer ignore-type */$subscription );
32
        echo '</div>';
33
34
    }
35
36
    /**
37
	 * Output the subscription invoices.
38
	 *
39
	 * @param WP_Post $post
40
	 */
41
    public static function output_invoices( $post ) {
42
43
        // Fetch the invoice.
44
        $invoice = new WPInv_Invoice( $post );
45
46
        // Fetch the subscription.
47
        $subscription = getpaid_get_invoice_subscription( $invoice );
48
49
        echo '<div class="bsui">';
50
        getpaid_admin_subscription_invoice_details_metabox( /** @scrutinizer ignore-type */$subscription, false );
51
        echo '</div>';
52
53
    }
54
55
    /**
56
	 * Outputs related subscriptions.
57
	 *
58
	 * @param WP_Post $post
59
	 */
60
    public static function output_related( $post ) {
61
62
        // Fetch the invoice.
63
        $invoice = new WPInv_Invoice( $post );
64
65
        // Fetch the subscription.
66
        $subscription = getpaid_get_invoice_subscription( $invoice );
67
68
        echo '<div class="bsui">';
69
        getpaid_admin_subscription_related_subscriptions_metabox( /** @scrutinizer ignore-type */$subscription, false );
70
        echo '</div>';
71
72
    }
73
74
}
75