GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

LobAddress   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 135
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 0
dl 0
loc 135
ccs 0
cts 51
cp 0
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A __construct() 0 6 1
A line2() 0 6 1
A country() 0 6 1
A city() 0 6 1
A state() 0 6 1
A zip() 0 6 1
A name() 0 6 1
A toArray() 0 12 1
1
<?php
2
3
namespace NotificationChannels\Lob;
4
5
class LobAddress
6
{
7
    /** @var string */
8
    protected $line1 = 'postcards';
9
10
    /** @var string */
11
    protected $line2;
12
13
    /** @var string */
14
    protected $country;
15
16
    /** @var string */
17
    protected $city;
18
19
    /** @var string */
20
    protected $state;
21
22
    /** @var string */
23
    protected $zip;
24
25
    /** @var string */
26
    protected $name = 'name';
27
28
    /**
29
     * @param string $line1
30
     * @param string $country
31
     *
32
     * @return static
33
     */
34
    public static function create($line1, $country = 'US')
35
    {
36
        return new static($line1, $country);
37
    }
38
39
    /**
40
     * @param string $line1
41
     * @param string $country
42
     */
43
    public function __construct($line1, $country = 'US')
44
    {
45
        $this->line1 = $line1;
46
47
        $this->country = $country;
48
    }
49
50
    /**
51
     * @param string $line2
52
     *
53
     * @return $this
54
     */
55
    public function line2($line2)
56
    {
57
        $this->line2 = $line2;
58
59
        return $this;
60
    }
61
62
    /**
63
     * @param string $country
64
     *
65
     * @return $this
66
     */
67
    public function country($country)
68
    {
69
        $this->country = $country;
70
71
        return $this;
72
    }
73
74
    /**
75
     * @param string $city
76
     *
77
     * @return $this
78
     */
79
    public function city($city)
80
    {
81
        $this->city = $city;
82
83
        return $this;
84
    }
85
86
    /**
87
     * @param string $state
88
     *
89
     * @return $this
90
     */
91
    public function state($state)
92
    {
93
        $this->state = $state;
94
95
        return $this;
96
    }
97
98
    /**
99
     * @param string $zip
100
     *
101
     * @return $this
102
     */
103
    public function zip($zip)
104
    {
105
        $this->zip = $zip;
106
107
        return $this;
108
    }
109
110
    /**
111
     * @param string $name
112
     *
113
     * @return $this
114
     */
115
    public function name($name)
116
    {
117
        $this->name = $name;
118
119
        return $this;
120
    }
121
122
    /**
123
     * Get an array representation of the address.
124
     *
125
     * @return array
126
     */
127
    public function toArray()
128
    {
129
        return array_filter([
130
            'address_line1' => $this->line1,
131
            'address_country' => $this->country,
132
            'address_line2' => $this->line2,
133
            'address_city' => $this->city,
134
            'address_state' => $this->state,
135
            'address_zip' => $this->zip,
136
            'name' => $this->name,
137
        ]);
138
    }
139
}
140