Total Complexity | 12 |
Total Lines | 91 |
Duplicated Lines | 0 % |
Coverage | 65% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
18 | class Customer implements CustomerInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var integer |
||
22 | */ |
||
23 | protected $id; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $login; |
||
29 | |||
30 | /** |
||
31 | * @var CustomerInterface |
||
32 | */ |
||
33 | protected $seller; |
||
34 | |||
35 | /** |
||
36 | * @var Customer[] |
||
37 | */ |
||
38 | protected $sellers = []; |
||
39 | |||
40 | 40 | /** |
|
41 | * @var string|null |
||
42 | 40 | */ |
|
43 | 40 | protected ?string $state = null; |
|
44 | 40 | ||
45 | 40 | public function __construct($id, $login, CustomerInterface $seller = null, ?string $state = null) |
|
46 | { |
||
47 | 1 | $this->id = $id; |
|
48 | $this->login = $login; |
||
49 | 1 | $this->seller = $seller; |
|
50 | $this->state = $state; |
||
51 | } |
||
52 | |||
53 | public function getId() |
||
54 | { |
||
55 | 1 | return $this->id; |
|
56 | } |
||
57 | 1 | ||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function getUniqueId() |
||
62 | { |
||
63 | 6 | return $this->getId() ?: $this->getLogin(); |
|
64 | } |
||
65 | 6 | ||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function getLogin() |
||
72 | } |
||
73 | 5 | ||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function getSeller() |
||
78 | { |
||
79 | return $this->seller; |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function getState(): ?string |
||
88 | } |
||
89 | |||
90 | public function isDeleted(): bool |
||
91 | { |
||
92 | return CustomerState::isDeleted($this); |
||
93 | } |
||
94 | |||
95 | public static function fromArray(array $info) |
||
104 | } |
||
105 | |||
106 | public function jsonSerialize(): array |
||
107 | { |
||
111 |