Completed
Push — master ( 05e61d...3e4a75 )
by Luke
02:05
created

PafAddressObject::getOrganisationKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ZpgRtf\Objects;
4
5
/**
6
 * Royal Mail's addressing scheme is known as Postcode Address File (PAF). Many third-party systems use this to
7
 * facilitate the selection of an address from an initial postcode. Per Royal Mail's specification: "Each address on
8
 * PAF® has an eight-digit number associated with it - the Address Key. This number in conjunction with the
9
 * Organisation Key and Postcode Type identifies the address."
10
 */
11
class PafAddressObject implements \JsonSerializable
12
{
13
    /** @var string */
14
    private $addressKey;
15
16
    /** @var string */
17
    private $organisationKey;
18
19
    /** @var string */
20
    private $postcodeType;
21
22
    /**
23
     * @return string
24
     */
25 2
    public function getAddressKey()
26
    {
27 2
        return $this->addressKey;
28
    }
29
30
    /**
31
     * @param string $addressKey
32
     *
33
     * @return PafAddressObject
34
     */
35 1
    public function setAddressKey($addressKey)
36
    {
37 1
        $this->addressKey = $addressKey;
38
39 1
        return $this;
40
    }
41
42
    /**
43
     * @return string
44
     */
45 2
    public function getOrganisationKey()
46
    {
47 2
        return $this->organisationKey;
48
    }
49
50
    /**
51
     * @param string $organisationKey
52
     *
53
     * @return PafAddressObject
54
     */
55 1
    public function setOrganisationKey($organisationKey)
56
    {
57 1
        $this->organisationKey = $organisationKey;
58
59 1
        return $this;
60
    }
61
62
    /**
63
     * @return string
64
     */
65 2
    public function getPostcodeType()
66
    {
67 2
        return $this->postcodeType;
68
    }
69
70
    /**
71
     * @param string $postcodeType
72
     *
73
     * @return PafAddressObject
74
     */
75 1
    public function setPostcodeType($postcodeType)
76
    {
77 1
        $this->postcodeType = $postcodeType;
78
79 1
        return $this;
80
    }
81
82
    /** {@inheritDoc} */
83 1
    public function jsonSerialize()
84
    {
85
        return [
86 1
            'address_key' => $this->getAddressKey(),
87 1
            'organisation_key' => $this->getOrganisationKey(),
88 1
            'postcode_type' => $this->getPostcodeType(),
89
        ];
90
    }
91
}
92