Passed
Push — main ( ef112d...d39948 )
by Pieter
03:42
created

Tag::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace Apie\OpenapiSchema\Spec;
5
6
use Apie\OpenapiSchema\Concerns\CompositeValueObjectWithExtension;
7
use Apie\OpenapiSchema\ValueObjects\SpecificationExtension;
8
use Apie\ValueObjects\ValueObjectInterface;
9
10
/**
11
 * @see https://swagger.io/specification/#tag-object
12
 */
13
class Tag implements ValueObjectInterface
14
{
15
    use CompositeValueObjectWithExtension;
16
17
    /**
18
     * @var string
19
     */
20
    private $name;
21
22
    /**
23
     * @var string|null
24
     */
25
    private $description;
26
27
    /**
28
     * @var ExternalDocs|null
29
     */
30
    private $externalDocs;
31
32
    public function __construct(string $name)
33
    {
34
        $this->name = $name;
35
        $this->specificationExtension = new SpecificationExtension([]);
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getName(): string
42
    {
43
        return $this->name;
44
    }
45
46
    /**
47
     * @return string|null
48
     */
49
    public function getDescription(): ?string
50
    {
51
        return $this->description;
52
    }
53
54
    /**
55
     * @return ExternalDocs|null
56
     */
57
    public function getExternalDocs(): ?ExternalDocs
58
    {
59
        return $this->externalDocs;
60
    }
61
}