|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* It's free open-source software released under the MIT License. |
|
5
|
|
|
* |
|
6
|
|
|
* @author Anatoly Fenric <[email protected]> |
|
7
|
|
|
* @copyright Copyright (c) 2018, Anatoly Fenric |
|
8
|
|
|
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE |
|
9
|
|
|
* @link https://github.com/sunrise-php/http-router |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Sunrise\Http\Router\OpenApi; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* OAS Info Object |
|
16
|
|
|
* |
|
17
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#info-object |
|
18
|
|
|
*/ |
|
19
|
|
|
class Info extends AbstractObject |
|
20
|
|
|
{ |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @var string |
|
24
|
|
|
* |
|
25
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-infotitle |
|
26
|
|
|
*/ |
|
27
|
|
|
protected $title; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @var string |
|
31
|
|
|
* |
|
32
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-infodescription |
|
33
|
|
|
*/ |
|
34
|
|
|
protected $description; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var string |
|
38
|
|
|
* |
|
39
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-infotermsofservice |
|
40
|
|
|
*/ |
|
41
|
|
|
protected $termsOfService; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @var Contact |
|
45
|
|
|
* |
|
46
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-infocontact |
|
47
|
|
|
*/ |
|
48
|
|
|
protected $contact; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @var License |
|
52
|
|
|
* |
|
53
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-infolicense |
|
54
|
|
|
*/ |
|
55
|
|
|
protected $license; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @var string |
|
59
|
|
|
* |
|
60
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-infoversion |
|
61
|
|
|
*/ |
|
62
|
|
|
protected $version; |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @param string $title |
|
66
|
|
|
* @param string $version |
|
67
|
|
|
*/ |
|
68
|
|
|
public function __construct(string $title, string $version) |
|
69
|
|
|
{ |
|
70
|
|
|
$this->title = $title; |
|
71
|
|
|
$this->version = $version; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @param string $description |
|
76
|
|
|
* |
|
77
|
|
|
* @return void |
|
78
|
|
|
*/ |
|
79
|
|
|
public function setDescription(string $description) : void |
|
80
|
|
|
{ |
|
81
|
|
|
$this->description = $description; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @param string $termsOfService |
|
86
|
|
|
* |
|
87
|
|
|
* @return void |
|
88
|
|
|
*/ |
|
89
|
|
|
public function setTermsOfService(string $termsOfService) : void |
|
90
|
|
|
{ |
|
91
|
|
|
$this->termsOfService = $termsOfService; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @param Contact $contact |
|
96
|
|
|
* |
|
97
|
|
|
* @return void |
|
98
|
|
|
*/ |
|
99
|
|
|
public function setContact(Contact $contact) : void |
|
100
|
|
|
{ |
|
101
|
|
|
$this->contact = $contact; |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* @param License $license |
|
106
|
|
|
* |
|
107
|
|
|
* @return void |
|
108
|
|
|
*/ |
|
109
|
|
|
public function setLicense(License $license) : void |
|
110
|
|
|
{ |
|
111
|
|
|
$this->license = $license; |
|
112
|
|
|
} |
|
113
|
|
|
} |
|
114
|
|
|
|