AccountingInvoice   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 55
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A addLineItem() 0 4 1
1
<?php
2
3
namespace MacsiDigital\Xero;
4
5
use MacsiDigital\Xero\Support\Model;
6
7
class AccountingInvoice extends Model
8
{
9
    const ENDPOINT = 'Invoices';
10
    const NODE_NAME = 'Invoice';
11
    const KEY_FIELD = 'InvoiceID';
12
13
    protected $methods = ['get', 'post', 'put'];
14
15
    protected $attributes = [
16
        'Type' => 'ACCREC',
17
        'Contact' => '',
18
        'LineItems' => [],
19
        'Date' => '',
20
        'DueDate' => '',
21
        'LineAmountTypes' => '',
22
        'InvoiceNumber' => '',
23
        'Reference' => '',
24
        'BrandingThemeID' => '',
25
        'Url' => '',
26
        'CurrencyCode' => '',
27
        'CurrencyRate' => '',
28
        'Status' => '',
29
        'SentToContact' => '',
30
        'ExpectedPaymentDate' => '',
31
        'PlannedPaymentDate' => '',
32
        'SubTotal' => '',
33
        'TotalTax' => '',
34
        'Total' => '',
35
        'TotalDiscount' => '',
36
        'InvoiceID' => '',
37
        'HasAttachments' => '',
38
        'Payments' => [],
39
        'Prepayments' => [],
40
        'Overpayments' => [],
41
        'AmountDue' => '',
42
        'AmountPaid' => '',
43
        'FullyPaidOnDate' => '',
44
        'AmountCredited' => '',
45
        'UpdatedDateUTC' => '',
46
        'CreditNotes' => [],
47
    ];
48
49
    protected $relationships = [
50
        'Contact' => '\MacsiDigital\Xero\AccountingContact',
51
        'LineItems' => '\MacsiDigital\Xero\AccountingLineItem',
52
        'Payments' => '\MacsiDigital\Xero\AccountingPayment',
53
        'Prepayments' => '\MacsiDigital\Xero\AccountingPrepayment',
54
        'Overpayments' => '\MacsiDigital\Xero\AccountingOverpayment',
55
    ];
56
57
    public function addLineItem($item)
58
    {
59
        $this->attributes['LineItems'][] = $item;
60
    }
61
}
62