Completed
Pull Request — master (#3)
by Tonina
64:44
created

isOnlyOptInDonationReceiptRequest()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 5
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
	private $donationReceipt;
36
37
	public function getSalutation(): string {
38
		return $this->salutation;
39
	}
40
41
	public function setSalutation( string $salutation ): self {
42
		$this->assertIsWritable();
43
		$this->salutation = $salutation;
44
		return $this;
45
	}
46
47
	public function getCompany(): string {
48
		return $this->company;
49
	}
50
51
	public function setCompany( string $company ): self {
52
		$this->assertIsWritable();
53
		$this->company = $company;
54
		return $this;
55
	}
56
57
	public function getTitle(): string {
58
		return $this->title;
59
	}
60
61
	public function setTitle( string $title ): self {
62
		$this->assertIsWritable();
63
		$this->title = $title;
64
		return $this;
65
	}
66
67
	public function getFirstName(): string {
68
		return $this->firstName;
69
	}
70
71
	public function setFirstName( string $firstName ): self {
72
		$this->assertIsWritable();
73
		$this->firstName = $firstName;
74
		return $this;
75
	}
76
77
	public function getLastName(): string {
78
		return $this->lastName;
79
	}
80
81
	public function setLastName( string $lastName ): self {
82
		$this->assertIsWritable();
83
		$this->lastName = $lastName;
84
		return $this;
85
	}
86
87
	public function getAddress(): string {
88
		return $this->address;
89
	}
90
91
	public function setAddress( string $address ): self {
92
		$this->assertIsWritable();
93
		$this->address = $address;
94
		return $this;
95
	}
96
97
	public function getPostcode(): string {
98
		return $this->postcode;
99
	}
100
101
	public function setPostcode( string $postcode ): self {
102
		$this->assertIsWritable();
103
		$this->postcode = $postcode;
104
		return $this;
105
	}
106
107
	public function getCity(): string {
108
		return $this->city;
109
	}
110
111
	public function setCity( string $city ): self {
112
		$this->assertIsWritable();
113
		$this->city = $city;
114
		return $this;
115
	}
116
117
	public function getCountry(): string {
118
		return $this->country;
119
	}
120
121
	public function setCountry( string $country ): self {
122
		$this->assertIsWritable();
123
		$this->country = $country;
124
		return $this;
125
	}
126
127
	public function getAddressType(): string {
128
		return $this->addressType;
129
	}
130
131
	public function isPersonal(): bool {
132
		return $this->addressType === AddressChange::ADDRESS_TYPE_PERSON;
133
	}
134
135
	public function isCompany(): bool {
136
		return $this->addressType === AddressChange::ADDRESS_TYPE_COMPANY;
137
	}
138
139
	public function setAddressType( string $addressType ): self {
140
		$this->assertIsWritable();
141
		$this->addressType = $addressType;
142
		return $this;
143
	}
144
145
	public function getIdentifier(): string {
146
		return $this->identifier;
147
	}
148
149
	public function setIdentifier( string $identifier ): self {
150
		$this->assertIsWritable();
151
		$this->identifier = $identifier;
152
		return $this;
153
	}
154
155
	public function isOptedIntoDonationReceipt(): bool {
156
		return $this->donationReceipt;
157
	}
158
159
	public function setDonationReceipt( bool $donationReceipt ): self {
160
		$this->assertIsWritable();
161
		$this->donationReceipt = $donationReceipt;
162
		return $this;
163
	}
164
165
	public function isOnlyOptInDonationReceiptRequest(): bool {
166
		if ( $this->address == '' ) {
167
			return true;
168
		}
169
		return false;
170
	}
171
172
}