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

Tag   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 47
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getExternalDocs() 0 3 1
A getName() 0 3 1
A __construct() 0 4 1
A getDescription() 0 3 1
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
}