| @@ 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); |
|
| @@ 232-243 (lines=12) @@ | ||
| 229 | } |
|
| 230 | return $this->paths[$path]; |
|
| 231 | ||
| 232 | case 'security': |
|
| 233 | $name = self::wordShift($data); |
|
| 234 | if (empty($name)) { |
|
| 235 | throw new \SwaggerGen\Exception('Missing security name'); |
|
| 236 | } |
|
| 237 | $type = self::wordShift($data); |
|
| 238 | if (empty($type)) { |
|
| 239 | throw new \SwaggerGen\Exception('Missing security type'); |
|
| 240 | } |
|
| 241 | $SecurityScheme = new SecurityScheme($this, $type, $data); |
|
| 242 | $this->securityDefinitions[$name] = $SecurityScheme; |
|
| 243 | return $SecurityScheme; |
|
| 244 | ||
| 245 | case 'require': |
|
| 246 | $name = self::wordShift($data); |
|