1 | <?php |
||
21 | class Swagger extends AbstractModel implements Arrayable { |
||
22 | |||
23 | use SchemesPart; |
||
24 | use ConsumesPart; |
||
25 | use ProducesPart; |
||
26 | use TagsPart; |
||
27 | use ParametersPart; |
||
28 | use ResponsesPart; |
||
29 | use ExternalDocsPart; |
||
30 | use ExtensionPart; |
||
31 | |||
32 | const T_INTEGER = 'integer'; |
||
33 | const T_NUMBER = 'number'; |
||
34 | const T_BOOLEAN = 'boolean'; |
||
35 | const T_STRING = 'string'; |
||
36 | const T_FILE = 'file'; |
||
37 | |||
38 | const F_INT32 = 'int32'; |
||
39 | const F_INT64 = 'int64'; |
||
40 | const F_FLOAT = 'float'; |
||
41 | const F_DOUBLE = 'double'; |
||
42 | const F_STRING = 'string'; |
||
43 | const F_BYTE = 'byte'; |
||
44 | const F_BINARY = 'binary'; |
||
45 | const F_DATE = 'date'; |
||
46 | const F_DATETIME = 'date-time'; |
||
47 | const F_PASSWORD = 'password'; |
||
48 | |||
49 | public static $METHODS = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head']; |
||
50 | |||
51 | /** @var string */ |
||
52 | private $swagger = '2.0'; |
||
53 | |||
54 | /** @var Info */ |
||
55 | private $info; |
||
56 | |||
57 | /** @var string */ |
||
58 | private $host; |
||
59 | |||
60 | /** @var string */ |
||
61 | private $basePath; |
||
62 | |||
63 | /** @var Paths */ |
||
64 | private $paths; |
||
65 | |||
66 | /** @var Definitions */ |
||
67 | private $definitions; |
||
68 | |||
69 | /** @var Map */ |
||
70 | private $securityDefinitions; |
||
71 | |||
72 | /** |
||
73 | * |
||
74 | * @param string $filename |
||
75 | * @throws FileNotFoundException |
||
76 | * @throws JsonException |
||
77 | * @return static |
||
78 | */ |
||
79 | 6 | public static function fromFile($filename) { |
|
90 | |||
91 | 10 | public function __construct($contents = []) { |
|
94 | |||
95 | 10 | private function parse($contents) { |
|
121 | |||
122 | 7 | public function toArray() { |
|
127 | |||
128 | /** |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | 2 | public function getVersion() { |
|
135 | |||
136 | /** |
||
137 | * |
||
138 | * @param string $version |
||
139 | * @return $this |
||
140 | */ |
||
141 | 1 | public function setVersion($version) { |
|
145 | |||
146 | /** |
||
147 | * |
||
148 | * @return Info |
||
149 | */ |
||
150 | 1 | public function getInfo() { |
|
153 | |||
154 | /** |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | 1 | public function getHost() { |
|
161 | |||
162 | /** |
||
163 | * |
||
164 | * @param string $host |
||
165 | * @return $this |
||
166 | */ |
||
167 | 1 | public function setHost($host) { |
|
171 | |||
172 | /** |
||
173 | * |
||
174 | * @return string |
||
175 | */ |
||
176 | 1 | public function getBasePath() { |
|
179 | |||
180 | /** |
||
181 | * |
||
182 | * @param string $basePath |
||
183 | * @return $this |
||
184 | */ |
||
185 | 1 | public function setBasePath($basePath) { |
|
189 | |||
190 | /** |
||
191 | * |
||
192 | * @return Paths |
||
193 | */ |
||
194 | 2 | public function getPaths() { |
|
197 | |||
198 | /** |
||
199 | * |
||
200 | * @return Map |
||
201 | */ |
||
202 | 1 | public function getDefinitions() { |
|
205 | |||
206 | /** |
||
207 | * |
||
208 | * @return Map |
||
209 | */ |
||
210 | public function getSecurityDefinitions() { |
||
213 | |||
214 | // /** |
||
215 | // * |
||
216 | // * @param Map $securityDefinitions |
||
217 | // */ |
||
218 | // public function setSecurityDefinitions(Map $securityDefinitions) { |
||
219 | // $this->securityDefinitions = $securityDefinitions; |
||
220 | // return $this; |
||
221 | // } |
||
222 | |||
223 | |||
224 | } |