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