Completed
Pull Request — master (#1)
by Tim
65:22
created

ChangeAddressRequest::setAddress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\AddressChange\UseCases\ChangeAddress;
6
7
use WMDE\FreezableValueObject\FreezableValueObject;
8
use WMDE\Fundraising\AddressChange\Domain\Model\AddressChange;
9
10
class ChangeAddressRequest {
11
	use FreezableValueObject;
12
13
	private $salutation;
14
15
	private $company;
16
17
	private $title;
18
19
	private $firstName;
20
21
	private $lastName;
22
23
	private $address;
24
25
	private $postcode;
26
27
	private $city;
28
29
	private $country;
30
31
	private $addressType;
32
33
	private $identifier;
34
35
	public function getSalutation(): string {
36
		return $this->salutation;
37
	}
38
39
	public function setSalutation( string $salutation ): self {
40
		$this->assertIsWritable();
41
		$this->salutation = $salutation;
42
		return $this;
43
	}
44
45
	public function getCompany(): string {
46
		return $this->company;
47
	}
48
49
	public function setCompany( string $company ): self {
50
		$this->assertIsWritable();
51
		$this->company = $company;
52
		return $this;
53
	}
54
55
	public function getTitle(): string {
56
		return $this->title;
57
	}
58
59
	public function setTitle( string $title ): self {
60
		$this->assertIsWritable();
61
		$this->title = $title;
62
		return $this;
63
	}
64
65
	public function getFirstName(): string {
66
		return $this->firstName;
67
	}
68
69
	public function setFirstName( string $firstName ): self {
70
		$this->assertIsWritable();
71
		$this->firstName = $firstName;
72
		return $this;
73
	}
74
75
	public function getLastName(): string {
76
		return $this->lastName;
77
	}
78
79
	public function setLastName( string $lastName ): self {
80
		$this->assertIsWritable();
81
		$this->lastName = $lastName;
82
		return $this;
83
	}
84
85
	public function getAddress(): string {
86
		return $this->address;
87
	}
88
89
	public function setAddress( string $address ): self {
90
		$this->assertIsWritable();
91
		$this->address = $address;
92
		return $this;
93
	}
94
95
	public function getPostcode(): string {
96
		return $this->postcode;
97
	}
98
99
	public function setPostcode( string $postcode ): self {
100
		$this->assertIsWritable();
101
		$this->postcode = $postcode;
102
		return $this;
103
	}
104
105
	public function getCity(): string {
106
		return $this->city;
107
	}
108
109
	public function setCity( string $city ): self {
110
		$this->assertIsWritable();
111
		$this->city = $city;
112
		return $this;
113
	}
114
115
	public function getCountry(): string {
116
		return $this->country;
117
	}
118
119
	public function setCountry( string $country ): self {
120
		$this->assertIsWritable();
121
		$this->country = $country;
122
		return $this;
123
	}
124
125
	public function getAddressType(): string {
126
		return $this->addressType;
127
	}
128
129
	public function isPersonal(): bool {
130
		return $this->addressType === AddressChange::ADDRESS_TYPE_PERSON;
131
	}
132
133
	public function isCompany(): bool {
134
		return $this->addressType === AddressChange::ADDRESS_TYPE_COMPANY;
135
	}
136
137
	public function setAddressType( string $addressType ): self {
138
		$this->assertIsWritable();
139
		$this->addressType = $addressType;
140
		return $this;
141
	}
142
143
	public function getIdentifier(): string {
144
		return $this->identifier;
145
	}
146
147
	public function setIdentifier( string $identifier ): self {
148
		$this->assertIsWritable();
149
		$this->identifier = $identifier;
150
		return $this;
151
	}
152
153
}