Info::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 11
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1
crap 1
1
<?php
2
3
namespace erasys\OpenApi\Spec\v3;
4
5
/**
6
 * The object provides metadata about the API. The metadata MAY be used by the clients if needed,
7
 * and MAY be presented in editing or documentation generation tools for convenience.
8
 *
9
 * @see https://swagger.io/specification/#infoObject
10
 */
11
class Info extends AbstractObject implements ExtensibleInterface
12
{
13
    /**
14
     * REQUIRED. The title of the application.
15
     *
16
     * @var string
17
     */
18
    public $title;
19
20
    /**
21
     * REQUIRED. The version of this OpenAPI document
22
     * (which is distinct from the OpenAPI Specification version or the API implementation version).
23
     *
24
     *
25
     * @var string
26
     */
27
    public $version;
28
29
    /**
30
     * A short description of the application. CommonMark syntax MAY be used for rich text representation.
31
     *
32
     * @var string
33
     */
34
    public $description;
35
36
    /**
37
     * A URL to the Terms of Service for the API. MUST be in the format of a URL.
38
     *
39
     * @var string
40
     */
41
    public $termsOfService;
42
43
    /**
44
     * The contact information for the exposed API.
45
     *
46
     * @var Contact
47
     */
48
    public $contact;
49
50
    /**
51
     * The license information for the exposed API.
52
     *
53
     * @var License
54
     */
55
    public $license;
56
57
    /**
58
     * @param string      $title
59
     * @param string      $version
60
     * @param string|null $description
61
     * @param array       $additionalProperties
62
     */
63 12
    public function __construct(
64
        string $title,
65
        string $version,
66
        string $description = null,
67
        array $additionalProperties = []
68
    ) {
69 12
        parent::__construct($additionalProperties);
70
71 12
        $this->title       = $title;
72 12
        $this->version     = $version;
73 12
        $this->description = $description;
74 12
    }
75
}
76