Code Duplication    Length = 7-7 lines in 3 locations

SwaggerGen/Swagger/Parameter.php 1 location

@@ 98-104 (lines=7) @@
95
		$match = array();
96
		$count = preg_match('/^([a-z]+)/i', $definition, $match);
97
		$format = strtolower($match[1]);
98
		if (isset(self::$classTypes[$format])) {
99
			$type = self::$classTypes[$format];
100
			$class = "SwaggerGen\\Swagger\\Type\\{$type}Type";
101
			$this->Type = new $class($this, $definition);
102
		} else {
103
			throw new \SwaggerGen\Exception("Type format not recognized: '{$format}'");
104
		}
105
	}
106
107
	public function handleCommand($command, $data = null)

SwaggerGen/Swagger/Schema.php 1 location

@@ 61-67 (lines=7) @@
58
		$match = array();
59
		preg_match('/^([a-z]+)/i', $definition, $match);
60
		$format = strtolower($match[1]);
61
		if (isset(self::$classTypes[$format])) {
62
			$type = self::$classTypes[$format];
63
			$class = "SwaggerGen\\Swagger\\Type\\{$type}Type";
64
			$this->type = new $class($this, $definition);
65
		} else {
66
			$this->type = new Type\ReferenceObjectType($this, $definition);
67
		}
68
69
		$this->description = $description;
70
	}

SwaggerGen/Swagger/Type/Property.php 1 location

@@ 68-74 (lines=7) @@
65
			throw new \SwaggerGen\Exception("Not a property: '{$definition}'");
66
		}
67
		$format = strtolower($match[1]);
68
		if (isset(self::$classTypes[$format])) {
69
			$type = self::$classTypes[$format];
70
			$class = "SwaggerGen\\Swagger\\Type\\{$type}Type";
71
			$this->Type = new $class($this, $definition);
72
		} else {
73
			throw new \SwaggerGen\Exception("Property format not recognized: '{$format}'");
74
		}
75
76
		$this->description = $description;
77
	}