Passed
Pull Request — master (#29)
by Stephen
08:13 queued 05:26
created

AddressAccessors   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 50
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getAddress2Attribute() 0 3 1
A getStateAttribute() 0 3 1
A getZipAttribute() 0 3 1
A getCityAttribute() 0 3 1
A getAddress1Attribute() 0 3 1
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