1 | <?php |
||
22 | class Swagger extends AbstractModel implements Arrayable |
||
23 | { |
||
24 | use SchemesPart; |
||
25 | use ConsumesPart; |
||
26 | use ProducesPart; |
||
27 | use TagsPart; |
||
28 | use ParametersPart; |
||
29 | use ResponsesPart; |
||
30 | use ExternalDocsPart; |
||
31 | use ExtensionPart; |
||
32 | |||
33 | const T_INTEGER = 'integer'; |
||
34 | const T_NUMBER = 'number'; |
||
35 | const T_BOOLEAN = 'boolean'; |
||
36 | const T_STRING = 'string'; |
||
37 | const T_FILE = 'file'; |
||
38 | |||
39 | const F_INT32 = 'int32'; |
||
40 | const F_INT64 = 'int64'; |
||
41 | const F_FLOAT = 'float'; |
||
42 | const F_DOUBLE = 'double'; |
||
43 | const F_STRING = 'string'; |
||
44 | const F_BYTE = 'byte'; |
||
45 | const F_BINARY = 'binary'; |
||
46 | const F_DATE = 'date'; |
||
47 | const F_DATETIME = 'date-time'; |
||
48 | const F_PASSWORD = 'password'; |
||
49 | |||
50 | public static $METHODS = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head']; |
||
51 | |||
52 | /** @var string */ |
||
53 | private $swagger = '2.0'; |
||
54 | |||
55 | /** @var Info */ |
||
56 | private $info; |
||
57 | |||
58 | /** @var string */ |
||
59 | private $host; |
||
60 | |||
61 | /** @var string */ |
||
62 | private $basePath; |
||
63 | |||
64 | /** @var Paths */ |
||
65 | private $paths; |
||
66 | |||
67 | /** @var Definitions */ |
||
68 | private $definitions; |
||
69 | |||
70 | /** @var Map */ |
||
71 | private $securityDefinitions; |
||
72 | |||
73 | /** |
||
74 | * @param string $filename |
||
75 | * |
||
76 | * @throws FileNotFoundException |
||
77 | * @throws JsonException |
||
78 | * |
||
79 | * @return static |
||
80 | */ |
||
81 | 6 | public static function fromFile($filename) |
|
93 | |||
94 | 10 | public function __construct($contents = []) |
|
98 | |||
99 | 10 | private function parse($contents) |
|
126 | |||
127 | 7 | public function toArray() |
|
133 | |||
134 | /** |
||
135 | * @return string |
||
136 | */ |
||
137 | 2 | public function getVersion() |
|
141 | |||
142 | /** |
||
143 | * @param string $version |
||
144 | * |
||
145 | * @return $this |
||
146 | */ |
||
147 | 1 | public function setVersion($version) |
|
153 | |||
154 | /** |
||
155 | * @return Info |
||
156 | */ |
||
157 | 1 | public function getInfo() |
|
161 | |||
162 | /** |
||
163 | * @return string |
||
164 | */ |
||
165 | 1 | public function getHost() |
|
169 | |||
170 | /** |
||
171 | * @param string $host |
||
172 | * |
||
173 | * @return $this |
||
174 | */ |
||
175 | 1 | public function setHost($host) |
|
181 | |||
182 | /** |
||
183 | * @return string |
||
184 | */ |
||
185 | 1 | public function getBasePath() |
|
189 | |||
190 | /** |
||
191 | * @param string $basePath |
||
192 | * |
||
193 | * @return $this |
||
194 | */ |
||
195 | 1 | public function setBasePath($basePath) |
|
201 | |||
202 | /** |
||
203 | * @return Paths |
||
204 | */ |
||
205 | 2 | public function getPaths() |
|
209 | |||
210 | /** |
||
211 | * @return Map |
||
212 | */ |
||
213 | 1 | public function getDefinitions() |
|
217 | |||
218 | /** |
||
219 | * @return Map |
||
220 | */ |
||
221 | public function getSecurityDefinitions() |
||
225 | |||
226 | // /** |
||
227 | // * |
||
228 | // * @param Map $securityDefinitions |
||
229 | // */ |
||
230 | // public function setSecurityDefinitions(Map $securityDefinitions) { |
||
231 | // $this->securityDefinitions = $securityDefinitions; |
||
232 | // return $this; |
||
233 | // } |
||
234 | } |
||
235 |