Completed
Pull Request — master (#229)
by
unknown
02:44
created

UpdateAddress   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 117
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 12
lcom 1
cbo 1
dl 0
loc 117
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A id() 0 4 1
A firstName() 0 4 1
A lastName() 0 4 1
A company() 0 4 1
A street() 0 4 1
A countryCode() 0 4 1
A provinceCode() 0 4 1
A city() 0 4 1
A postcode() 0 4 1
A phoneNumber() 0 4 1
A userEmail() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Sylius\ShopApiPlugin\Command;
6
7
use Sylius\ShopApiPlugin\Model\Address;
8
9
final class UpdateAddress
10
{
11
    /**
12
     * @var Address
13
     */
14
    private $address;
15
16
    /**
17
     * @var string
18
     */
19
    private $userEmail;
20
21
    /**
22
     * @var string
23
     */
24
    private $addressId;
25
26
    /**
27
     * @param Address $address
28
     * @param string $userEmail
29
     * @param string $addressId
30
     */
31
    public function __construct(Address $address, string $userEmail, string $addressId)
32
    {
33
        $this->address = $address;
34
        $this->userEmail = $userEmail;
35
        $this->addressId = $addressId;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function id(): string
42
    {
43
        return $this->addressId;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function firstName(): string
50
    {
51
        return $this->address->firstName();
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function lastName(): string
58
    {
59
        return $this->address->lastName();
60
    }
61
62
    /**
63
     * @return string|null
64
     */
65
    public function company(): ?string
66
    {
67
        return $this->address->company();
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function street(): string
74
    {
75
        return $this->address->street();
76
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function countryCode(): string
82
    {
83
        return $this->address->countryCode();
84
    }
85
86
    /**
87
     * @return string|null
88
     */
89
    public function provinceCode(): ?string
90
    {
91
        return $this->address->provinceCode();
92
    }
93
94
    /**
95
     * @return string
96
     */
97
    public function city(): string
98
    {
99
        return $this->address->city();
100
    }
101
102
    /**
103
     * @return string
104
     */
105
    public function postcode(): string
106
    {
107
        return $this->address->postcode();
108
    }
109
110
    /**
111
     * @return string|null
112
     */
113
    public function phoneNumber(): ?string
114
    {
115
        return $this->address->phoneNumber();
116
    }
117
118
    /**
119
     * @return string
120
     */
121
    public function userEmail(): string
122
    {
123
        return $this->userEmail;
124
    }
125
}
126