Subscription::addShipTo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace CommerceGuys\AuthNet\DataTypes;
4
5
class Subscription extends BaseDataType
6
{
7
    protected $propertyMap = [
8
        'name',
9
        'paymentSchedule',
10
        'amount',
11
        'trialAmount',
12
        'payment',
13
        'order',
14
        'billTo',
15
        'shipTo',
16
        'profile',
17
    ];
18
19 1
    public function addPaymentSchedule(PaymentSchedule $paymentSchedule)
20
    {
21 1
        $this->properties['paymentSchedule'] = $paymentSchedule->toArray();
22 1
    }
23
24
    public function addPayment(PaymentMethodInterface $payment)
25
    {
26
        $this->properties['payment'] = $payment->toArray();
27
    }
28
29
    public function addOrder(Order $order)
30
    {
31
        $this->addDataType($order);
32
    }
33
34
    public function addBillTo(BillTo $billTo)
35
    {
36
        $this->addDataType($billTo);
37
    }
38
39
    public function addShipTo(ShipTo $shipTo)
40
    {
41
        $this->addDataType($shipTo);
42
    }
43
44 1
    public function addProfile(CustomerProfileId $profile)
45
    {
46 1
        $this->properties['profile'] = $profile->toArray();
47 1
    }
48
}
49