Address   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 55
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A serialize() 0 8 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: WilliamWard
5
 * Date: 8/6/2018
6
 * Time: 8:46 AM
7
 */
8
9
namespace GivePay\Gateway\Transactions;
10
11
final class Address
12
{
13
    /**
14
     * @var string Billing address line 1
15
     */
16
    private $address_line_1;
17
18
    /**
19
     * @var string Billing address line 2
20
     */
21
    private $address_line_2;
22
23
    /**
24
     * @var string Billing city
25
     */
26
    private $city;
27
28
    /**
29
     * @var string Billing state
30
     */
31
    private $state;
32
33
    /**
34
     * @var string Billind postal code
35
     */
36
    private $postal_code;
37
38
    /**
39
     * Address constructor.
40
     * @param string $address_line_1
41
     * @param string $address_line_2
42
     * @param string $city
43
     * @param string $state
44
     * @param string $postal_code
45
     */
46 3
    public function __construct($address_line_1, $address_line_2, $city, $state, $postal_code)
47
    {
48 3
        $this->address_line_1 = $address_line_1;
49 3
        $this->address_line_2 = $address_line_2;
50 3
        $this->city = $city;
51 3
        $this->state = $state;
52 3
        $this->postal_code = $postal_code;
53 3
    }
54
55
    /**
56
     * @return array Serializes the Address into a address request object for GPG
57
     */
58 2
    public function serialize()
59
    {
60
        return array(
61 2
            'line_1' => $this->address_line_1,
62 2
            'line_2' => $this->address_line_2,
63 2
            'city' => $this->city,
64 2
            'state' => $this->state,
65 2
            'postal_code' => $this->postal_code
66
        );
67
    }
68
}