Code Duplication    Length = 9-10 lines in 4 locations

SwaggerGen/Swagger/Type/ArrayType.php 2 locations

@@ 116-124 (lines=9) @@
113
		}
114
115
		switch (strtolower($command)) {
116
			case 'min':
117
				$this->minItems = intval($data);
118
				if ($this->minItems < 0) {
119
					throw new \SwaggerGen\Exception("Minimum less than zero: '{$data}'");
120
				}
121
				if ($this->maxItems !== null && $this->minItems > $this->maxItems) {
122
					throw new \SwaggerGen\Exception("Minimum greater than maximum: '{$data}'");
123
				}
124
				return $this;
125
126
			case 'max':
127
				$this->maxItems = intval($data);
@@ 126-134 (lines=9) @@
123
				}
124
				return $this;
125
126
			case 'max':
127
				$this->maxItems = intval($data);
128
				if ($this->minItems !== null && $this->minItems > $this->maxItems) {
129
					throw new \SwaggerGen\Exception("Maximum less than minimum: '{$data}'");
130
				}
131
				if ($this->maxItems < 0) {
132
					throw new \SwaggerGen\Exception("Maximum less than zero: '{$data}'");
133
				}
134
				return $this;
135
136
			case 'items':
137
				$this->Items = $this->validateItems($data);

SwaggerGen/Swagger/Type/ObjectType.php 2 locations

@@ 116-125 (lines=10) @@
113
				}
114
				return $this;
115
116
			case 'min':
117
				$this->minProperties = intval($data);
118
				if ($this->minProperties < 0) {
119
					throw new \SwaggerGen\Exception("Minimum less than zero: '{$data}'");
120
				}
121
				if ($this->maxProperties !== null && $this->minProperties > $this->maxProperties) {
122
					throw new \SwaggerGen\Exception("Minimum greater than maximum: '{$data}'");
123
				}
124
				$this->minProperties = intval($data);
125
				return $this;
126
127
			case 'max':
128
				$this->maxProperties = intval($data);
@@ 127-135 (lines=9) @@
124
				$this->minProperties = intval($data);
125
				return $this;
126
127
			case 'max':
128
				$this->maxProperties = intval($data);
129
				if ($this->minProperties !== null && $this->minProperties > $this->maxProperties) {
130
					throw new \SwaggerGen\Exception("Maximum less than minimum: '{$data}'");
131
				}
132
				if ($this->maxProperties < 0) {
133
					throw new \SwaggerGen\Exception("Maximum less than zero: '{$data}'");
134
				}
135
				return $this;
136
		}
137
138
		return parent::handleCommand($command, $data);