Passed
Push — master ( 5452c3...c16653 )
by Brian
04:51 queued 19s
created

GetPaid_Meta_Box_Invoice_Subscription   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 11
c 1
b 0
f 0
dl 0
loc 37
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A output_invoices() 0 11 1
A output() 0 11 1
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( $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( $subscription );
51
        echo '</div>';
52
53
    }
54
55
}
56