Passed
Pull Request — master (#29)
by Stephen
08:13 queued 05:26
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
     * Retrieve the User's 'address1' attribute.
9
     *
10
     * @return mixed
11
     */
12
    public function getAddress1Attribute()
13
    {
14
        return $this->address->address_1 ?? null;
15
    }
16
17
    /**
18
     * Retrieve the User's 'address2' attribute.
19
     *
20
     * @return mixed
21
     */
22
    public function getAddress2Attribute()
23
    {
24
        return $this->address->address_2 ?? null;
25
    }
26
27
    /**
28
     * Retrieve the User's 'city' attribute.
29
     *
30
     * @return mixed
31
     */
32
    public function getCityAttribute()
33
    {
34
        return $this->address->city ?? null;
35
    }
36
37
    /**
38
     * Retrieve the User's 'state' attribute.
39
     *
40
     * @return mixed
41
     */
42
    public function getStateAttribute()
43
    {
44
        return $this->address->state ?? null;
45
    }
46
47
    /**
48
     * Retrieve the User's 'zip' attribute.
49
     *
50
     * @return mixed
51
     */
52
    public function getZipAttribute()
53
    {
54
        return $this->address->zip ?? null;
55
    }
56
}
57