Completed
Pull Request — master (#6)
by Veaceslav
02:38 queued 01:30
created

createExternalDocumentation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

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