| @@ 131-142 (lines=12) @@ | ||
| 128 | public function handleCommand($command, $data = null) |
|
| 129 | { |
|
| 130 | switch (strtolower($command)) { |
|
| 131 | case 'header': |
|
| 132 | $type = self::wordShift($data); |
|
| 133 | if (empty($type)) { |
|
| 134 | throw new \SwaggerGen\Exception("Missing type for header"); |
|
| 135 | } |
|
| 136 | $name = self::wordShift($data); |
|
| 137 | if (empty($name)) { |
|
| 138 | throw new \SwaggerGen\Exception("Missing name for header type '{$type}'"); |
|
| 139 | } |
|
| 140 | $Header = new Header($this, $type, $data); |
|
| 141 | $this->Headers[$name] = $Header; |
|
| 142 | return $Header; |
|
| 143 | } |
|
| 144 | ||
| 145 | return parent::handleCommand($command, $data); |
|
| @@ 202-213 (lines=12) @@ | ||
| 199 | } |
|
| 200 | return $this->Paths[$path]; |
|
| 201 | ||
| 202 | case 'security': |
|
| 203 | $name = self::wordShift($data); |
|
| 204 | if (empty($name)) { |
|
| 205 | throw new \SwaggerGen\Exception('Missing security name'); |
|
| 206 | } |
|
| 207 | $type = self::wordShift($data); |
|
| 208 | if (empty($type)) { |
|
| 209 | throw new \SwaggerGen\Exception('Missing security type'); |
|
| 210 | } |
|
| 211 | $SecurityScheme = new SecurityScheme($this, $type, $data); |
|
| 212 | $this->securityDefinitions[$name] = $SecurityScheme; |
|
| 213 | return $SecurityScheme; |
|
| 214 | ||
| 215 | case 'require': |
|
| 216 | $name = self::wordShift($data); |
|