Completed
Push — master ( 00d376...cc54a0 )
by Veaceslav
01:15
created

ExampleBuilder::setDescription()   A

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;
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 4
    public function createExample(): Objects\Example
23
    {
24 4
        return new Objects\Example(
25 4
            $this->getSummary(),
26 4
            $this->getDescription(),
27 4
            $this->getValue(),
28 4
            $this->getExternalValue(),
29 4
            $this->getExtensions()
30
        );
31
    }
32
33 2
    public function createExampleAggregate(): ExampleAggregate
34
    {
35 2
        return $this->createExample();
36
    }
37
38 1
    public function setDescription(string $description): self
39
    {
40 1
        $this->description = $description;
41
42 1
        return $this;
43
    }
44
45 1
    public function setExternalValue(string $externalValue): self
46
    {
47 1
        $this->externalValue = $externalValue;
48
49 1
        return $this;
50
    }
51
52 3
    public function setSummary(string $summary): self
53
    {
54 3
        $this->summary = $summary;
55
56 3
        return $this;
57
    }
58
59
    /**
60
     * @param mixed $value
61
     */
62 1
    public function setValue($value): self
63
    {
64 1
        $this->value = $value;
65
66 1
        return $this;
67
    }
68
69 4
    private function getDescription(): ?string
70
    {
71 4
        return $this->description;
72
    }
73
74 4
    private function getExternalValue(): ?string
75
    {
76 4
        return $this->externalValue;
77
    }
78
79 4
    private function getSummary(): ?string
80
    {
81 4
        return $this->summary;
82
    }
83
84
    /**
85
     * @return mixed
86
     */
87 4
    private function getValue()
88
    {
89 4
        return $this->value;
90
    }
91
}
92