Completed
Push — update_docs ( 6b821b )
by Laurent
128:10 queued 119:52
created

Contact   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 66
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Tests package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Domain\Model;
15
16
use Domain\Model\Common\VO\ContactAddress;
17
use Domain\Model\Common\VO\EmailField;
18
use Domain\Model\Common\VO\NameField;
19
use Domain\Model\Common\VO\PhoneField;
20
21
class Contact
22
{
23
    protected string $uuid;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
24
    protected string $name;
25
    protected string $address;
26
    protected string $phone;
27
    protected string $facsimile;
28
    protected string $email;
29
    protected string $contact;
30
    protected string $cellphone;
31
    protected string $slug;
32
33
    public function __construct(
34
        ContactUuid $uuid,
35
        NameField $name,
36
        ContactAddress $address,
37
        PhoneField $phone,
38
        PhoneField $facsimile,
39
        EmailField $email,
40
        string $contact,
41
        PhoneField $cellphone
42
    ) {
43
        $this->uuid = $uuid->toString();
44
        $this->name = $name->getValue();
45
        $this->address = $address->getValue();
46
        $this->phone = $phone->getValue();
47
        $this->facsimile = $facsimile->getValue();
48
        $this->email = $email->getValue();
49
        $this->contact = $contact;
50
        $this->cellphone = $cellphone->getValue();
51
    }
52
53
    public function name(): string
54
    {
55
        return $this->name;
56
    }
57
58
    public function renameContact(NameField $name): void
59
    {
60
        $this->name = $name->getValue();
61
        $this->slug = $name->slugify();
62
    }
63
64
    public function address(): string
65
    {
66
        return $this->address;
67
    }
68
69
    public function rewriteAddress(ContactAddress $address): void
70
    {
71
        $this->address = $address->getValue();
72
    }
73
74
    public function phone(): string
75
    {
76
        return $this->phone;
77
    }
78
79
    public function changePhoneNumber(string $phone): void
80
    {
81
        $this->phone = $phone;
82
    }
83
84
    public function facsimile(): string
85
    {
86
        return $this->facsimile;
87
    }
88
89
    public function changeFacsimileNumber(string $facsimile): void
90
    {
91
        $this->facsimile = $facsimile;
92
    }
93
94
    public function email(): string
95
    {
96
        return $this->email;
97
    }
98
99
    public function rewriteEmail(EmailField $email): void
100
    {
101
        $this->email = $email->getValue();
102
    }
103
104
    public function contact(): string
105
    {
106
        return $this->contact;
107
    }
108
109
    public function setContact(string $contact): void
110
    {
111
        $this->contact = $contact;
112
    }
113
114
    public function cellphone(): string
115
    {
116
        return $this->cellphone;
117
    }
118
119
    public function changeCellphoneNumber(string $cellphone): void
120
    {
121
        $this->cellphone = $cellphone;
122
    }
123
124
    public function slug(): string
125
    {
126
        return $this->slug;
127
    }
128
}
129