| @@ 79-88 (lines=10) @@ | ||
| 76 | $this->deprecated = true; |
|
| 77 | return $this; |
|
| 78 | ||
| 79 | case 'error': |
|
| 80 | $code = self::wordShift($data); |
|
| 81 | $reasoncode = Response::getCode($code); |
|
| 82 | if ($reasoncode === null) { |
|
| 83 | throw new \SwaggerGen\Exception("Invalid error code: '$code'"); |
|
| 84 | } |
|
| 85 | $description = $data; |
|
| 86 | $Error = new Error($this, $reasoncode, $description); |
|
| 87 | $this->responses[$reasoncode] = $Error; |
|
| 88 | return $Error; |
|
| 89 | ||
| 90 | case 'errors': |
|
| 91 | foreach (self::wordSplit($data) as $code) { |
|
| @@ 167-176 (lines=10) @@ | ||
| 164 | $this->definitions[$name] = $definition; |
|
| 165 | return $definition; |
|
| 166 | ||
| 167 | case 'response': |
|
| 168 | $name = self::wordShift($data); |
|
| 169 | $definition = self::wordShift($data); |
|
| 170 | $description = $data; |
|
| 171 | if (empty($description)) { |
|
| 172 | throw new \SwaggerGen\Exception('Response definition missing description'); |
|
| 173 | } |
|
| 174 | $Response = new Response($this, $name, $definition === 'null' ? null : $definition, $description); |
|
| 175 | $this->responses[$name] = $Response; |
|
| 176 | return $Response; |
|
| 177 | ||
| 178 | case 'api': // alias |
|
| 179 | case 'tag': |
|