Completed
Pull Request — master (#6)
by Veaceslav
11:19
created

LicenseBuilder::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Aweapi\Openapi\Builders;
6
7
use Aweapi\Openapi\Objects;
8
9
final class LicenseBuilder implements Objects\LicenseFactory
10
{
11
    use Properties\OptionalExtensions;
12
13
    private $name;
14
15
    private $url;
16
17
    public function createLicense(): Objects\License
18
    {
19
        return new Objects\License(
20
            $this->getName(),
21
            $this->getUrl(),
22
            $this->getExtensions()
23
        );
24
    }
25
26
    public function setName(string $name): self
27
    {
28
        $this->name = $name;
29
30
        return $this;
31
    }
32
33
    public function setUrl(string $url): self
34
    {
35
        $this->url = $url;
36
37
        return $this;
38
    }
39
40
    private function getName(): string
41
    {
42
        return $this->name;
43
    }
44
45
    private function getUrl(): ?string
46
    {
47
        return $this->url;
48
    }
49
}
50