Passed
Push — master ( 65a14e...d7390a )
by Stephen
50s queued 11s
created

AddressAccessors::getAddress2Attribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Sfneal\Address\Models\Traits;
4
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
33
    {
34
        return $this->address->address_2 ?? null;
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
53
    {
54
        return $this->address->state ?? null;
55
    }
56
57
    /**
58
     * Retrieve the User's 'zip' attribute.
59
     *
60
     * @return null|string
61
     */
62
    public function getZipAttribute(): ?string
63
    {
64
        return $this->address->zip ?? null;
65
    }
66
}
67