Total Complexity | 6 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
5 | trait AddressAccessors |
||
6 | { |
||
7 | /** |
||
8 | * Get the 'city_state' attribute. |
||
9 | * |
||
10 | * @return null|string |
||
11 | */ |
||
12 | public function getCityStateAttribute(): ?string |
||
13 | { |
||
14 | return $this->address->city_state ?? null; |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Retrieve the User's 'address1' attribute. |
||
19 | * |
||
20 | * @return null|string |
||
21 | */ |
||
22 | public function getAddress1Attribute(): ?string |
||
23 | { |
||
24 | return $this->address->address_1 ?? null; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Retrieve the User's 'address2' attribute. |
||
29 | * |
||
30 | * @return null|string |
||
31 | */ |
||
32 | public function getAddress2Attribute(): ?string |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Retrieve the User's 'city' attribute. |
||
39 | * |
||
40 | * @return null|string |
||
41 | */ |
||
42 | public function getCityAttribute(): ?string |
||
43 | { |
||
44 | return $this->address->city ?? null; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Retrieve the User's 'state' attribute. |
||
49 | * |
||
50 | * @return null|string |
||
51 | */ |
||
52 | public function getStateAttribute(): ?string |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Retrieve the User's 'zip' attribute. |
||
59 | * |
||
60 | * @return null|string |
||
61 | */ |
||
62 | public function getZipAttribute(): ?string |
||
65 | } |
||
66 | } |
||
67 |