Code Duplication    Length = 12-12 lines in 2 locations

SwaggerGen/Swagger/Response.php 1 location

@@ 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);

SwaggerGen/Swagger/Swagger.php 1 location

@@ 227-238 (lines=12) @@
224
				}
225
				return $this->paths[$path];
226
227
			case 'security':
228
				$name = self::wordShift($data);
229
				if (empty($name)) {
230
					throw new \SwaggerGen\Exception('Missing security name');
231
				}
232
				$type = self::wordShift($data);
233
				if (empty($type)) {
234
					throw new \SwaggerGen\Exception('Missing security type');
235
				}
236
				$SecurityScheme = new SecurityScheme($this, $type, $data);
237
				$this->securityDefinitions[$name] = $SecurityScheme;
238
				return $SecurityScheme;
239
240
			case 'require':
241
				$name = self::wordShift($data);