Completed
Push — master ( 577afb...c783ca )
by WEBEWEB
01:44
created

AddressTrait::setPostalCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2017 NdC/WBW
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\Model\Traits;
13
14
/**
15
 * AddressTrait.
16
 *
17
 * @author NdC/WBW <https://github.com/webeweb/>
18
 * @package WBW\Library\Core\Model\Traits
19
 */
20
trait AddressTrait {
21
22
	/**
23
	 * Address.
24
	 *
25
	 * @var string
26
	 */
27
	private $address;
28
29
	/**
30
	 * City.
31
	 *
32
	 * @var string
33
	 */
34
	private $city;
35
36
	/**
37
	 * Company.
38
	 *
39
	 * @var string
40
	 */
41
	private $company;
42
43
	/**
44
	 * Country.
45
	 *
46
	 * @var string
47
	 */
48
	private $country;
49
50
	/**
51
	 * Firstname.
52
	 *
53
	 * @var string
54
	 */
55
	private $firstname;
56
57
	/**
58
	 * Lastname.
59
	 *
60
	 * @var string
61
	 */
62
	private $lastname;
63
64
	/**
65
	 * Postal code.
66
	 *
67
	 * @var string
68
	 */
69
	private $postalCode;
70
71
	/**
72
	 * Get the address.
73
	 *
74
	 * @return string Returns the address.
75
	 */
76
	public function getAddress() {
77
		return $this->address;
78
	}
79
80
	/**
81
	 * Get the city.
82
	 *
83
	 * @return string Retuns the city.
84
	 */
85
	public function getCity() {
86
		return $this->city;
87
	}
88
89
	/**
90
	 * Get the company.
91
	 *
92
	 * @return string Returns the company.
93
	 */
94
	public function getCompany() {
95
		return $this->company;
96
	}
97
98
	/**
99
	 * Get the country.
100
	 *
101
	 * @return string Returns the country.
102
	 */
103
	public function getCountry() {
104
		return $this->country;
105
	}
106
107
	/**
108
	 * Get the firstname.
109
	 *
110
	 * @return string Returns the firstname.
111
	 */
112
	public function getFirstname() {
113
		return $this->firstname;
114
	}
115
116
	/**
117
	 * Get the lastname.
118
	 *
119
	 * @return string Returns the lastname.
120
	 */
121
	public function getLastname() {
122
		return $this->lastname;
123
	}
124
125
	/**
126
	 * Get the postal code.
127
	 *
128
	 * @return string Returns the postal code.
129
	 */
130
	public function getPostalCode() {
131
		return $this->postalCode;
132
	}
133
134
	/**
135
	 * Set the address.
136
	 *
137
	 * @param string $address The address
138
	 * @return AddressTrait Returns the address.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type AddressTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
139
	 */
140
	public function setAddress($address) {
141
		$this->address = $address;
142
		return $this;
143
	}
144
145
	/**
146
	 * Set the city.
147
	 *
148
	 * @param string $city The city.
149
	 * @return AddressTrait Returns the address.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type AddressTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
150
	 */
151
	public function setCity($city) {
152
		$this->city = $city;
153
		return $this;
154
	}
155
156
	/**
157
	 * Set the company.
158
	 *
159
	 * @param string $company The company.
160
	 * @return AddressTrait Returns the address.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type AddressTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
161
	 */
162
	public function setCompany($company) {
163
		$this->company = $company;
164
		return $this;
165
	}
166
167
	/**
168
	 * Set the country.
169
	 *
170
	 * @param string $country The country.
171
	 * @return AddressTrait Returns the address.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type AddressTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
172
	 */
173
	public function setCountry($country) {
174
		$this->country = $country;
175
		return $this;
176
	}
177
178
	/**
179
	 * Set the firstname.
180
	 *
181
	 * @param string $firstname The firstname.
182
	 * @return AddressTrait Returns the address.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type AddressTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
183
	 */
184
	public function setFirstname($firstname) {
185
		$this->firstname = $firstname;
186
		return $this;
187
	}
188
189
	/**
190
	 * Set the lastname.
191
	 *
192
	 * @param string $lastname The lastname.
193
	 * @return AddressTrait Returns the address.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type AddressTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
194
	 */
195
	public function setLastname($lastname) {
196
		$this->lastname = $lastname;
197
		return $this;
198
	}
199
200
	/**
201
	 * Set the postal code.
202
	 *
203
	 * @param string $postalCode The postal code.
204
	 * @return AddressTrait Returns the address.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type AddressTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
205
	 */
206
	public function setPostalCode($postalCode) {
207
		$this->postalCode = $postalCode;
208
		return $this;
209
	}
210
211
}
212