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

ExampleBuilder::getSummary()   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
use Aweapi\Openapi\Objects\ExampleAggregate;
9
10
final class ExampleBuilder implements Objects\ExampleFactory
11
{
12
    use Properties\OptionalExtensions;
13
14
    private $description;
15
16
    private $externalValue;
17
18
    private $summary;
19
20
    private $value;
21
22
    public function createExample(): Objects\Example
23
    {
24
        return new Objects\Example(
25
            $this->getSummary(),
26
            $this->getDescription(),
27
            $this->getValue(),
28
            $this->getExternalValue(),
29
            $this->getExtensions()
30
        );
31
    }
32
33
    public function createExampleAggregate(): ExampleAggregate
34
    {
35
        return $this->createExample();
36
    }
37
38
    public function setDescription(string $description): self
39
    {
40
        $this->description = $description;
41
42
        return $this;
43
    }
44
45
    public function setExternalValue(string $externalValue): self
46
    {
47
        $this->externalValue = $externalValue;
48
49
        return $this;
50
    }
51
52
    public function setSummary(string $summary): self
53
    {
54
        $this->summary = $summary;
55
56
        return $this;
57
    }
58
59
    public function setValue($value): self
60
    {
61
        $this->value = $value;
62
63
        return $this;
64
    }
65
66
    private function getDescription(): ?string
67
    {
68
        return $this->description;
69
    }
70
71
    private function getExternalValue(): ?string
72
    {
73
        return $this->externalValue;
74
    }
75
76
    private function getSummary(): ?string
77
    {
78
        return $this->summary;
79
    }
80
81
    private function getValue()
82
    {
83
        return $this->value;
84
    }
85
}
86