Tag::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 10
rs 10
ccs 5
cts 5
cp 1
crap 1
1
<?php
2
3
namespace erasys\OpenApi\Spec\v3;
4
5
/**
6
 * Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag
7
 * defined in the Operation Object instances.
8
 *
9
 * @see https://swagger.io/specification/#tagObject
10
 */
11
class Tag extends AbstractObject implements ExtensibleInterface
12
{
13
14
    /**
15
     * REQUIRED. The name of the tag.
16
     *
17
     *
18
     * @var string
19
     */
20
    public $name;
21
22
    /**
23
     * A short description for the tag. CommonMark syntax MAY be used for rich text representation.
24
     *
25
     * @var string
26
     */
27
    public $description;
28
29
    /**
30
     * Additional external documentation for this tag.
31
     *
32
     * @var ExternalDocumentation
33
     */
34
    public $externalDocs;
35
36
    /**
37
     * Tag constructor.
38
     *
39
     * @param string                     $name
40
     * @param string|null                $description
41
     * @param ExternalDocumentation|null $externalDocs
42
     * @param array                      $additionalProperties
43
     */
44 6
    public function __construct(
45
        string $name,
46
        string $description = null,
47
        ExternalDocumentation $externalDocs = null,
48
        array $additionalProperties = []
49
    ) {
50 6
        parent::__construct($additionalProperties);
51 6
        $this->name         = $name;
52 6
        $this->description  = $description;
53 6
        $this->externalDocs = $externalDocs;
54 6
    }
55
}
56