ContactBuilder::setName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Aweapi\Openapi\Builders;
6
7
use Aweapi\Openapi\Objects\Contact;
8
use Aweapi\Openapi\Objects\ContactFactory;
9
10
final class ContactBuilder implements ContactFactory
11
{
12
    use Properties\OptionalExtensions;
13
14
    private $email;
15
16
    private $name;
17
18
    private $url;
19
20 3
    public function createContact(): Contact
21
    {
22 3
        return new Contact(
23 3
            $this->getName(),
24 3
            $this->getUrl(),
25 3
            $this->getEmail(),
26 3
            $this->getExtensions()
27
        );
28
    }
29
30 1
    public function setEmail(string $email): self
31
    {
32 1
        $this->email = $email;
33
34 1
        return $this;
35
    }
36
37 2
    public function setName(string $name): self
38
    {
39 2
        $this->name = $name;
40
41 2
        return $this;
42
    }
43
44 1
    public function setUrl(string $url): self
45
    {
46 1
        $this->url = $url;
47
48 1
        return $this;
49
    }
50
51 3
    private function getEmail(): ?string
52
    {
53 3
        return $this->email;
54
    }
55
56 3
    private function getName(): ?string
57
    {
58 3
        return $this->name;
59
    }
60
61 3
    private function getUrl(): ?string
62
    {
63 3
        return $this->url;
64
    }
65
}
66