Code Duplication    Length = 14-14 lines in 2 locations

lib/private/preview.php 2 locations

@@ 233-246 (lines=14) @@
230
	 * @throws \Exception
231
	 * @return \OC\Preview $this
232
	 */
233
	public function setMaxX($maxX = 1) {
234
		if ($maxX <= 0) {
235
			throw new \Exception('Cannot set width of 0 or smaller!');
236
		}
237
		$configMaxX = $this->getConfigMaxX();
238
		if (!is_null($configMaxX)) {
239
			if ($maxX > $configMaxX) {
240
				\OC_Log::write('core', 'maxX reduced from ' . $maxX . ' to ' . $configMaxX, \OC_Log::DEBUG);
241
				$maxX = $configMaxX;
242
			}
243
		}
244
		$this->maxX = $maxX;
245
		return $this;
246
	}
247
248
	/**
249
	 * set the the max height of the preview
@@ 254-267 (lines=14) @@
251
	 * @throws \Exception
252
	 * @return \OC\Preview $this
253
	 */
254
	public function setMaxY($maxY = 1) {
255
		if ($maxY <= 0) {
256
			throw new \Exception('Cannot set height of 0 or smaller!');
257
		}
258
		$configMaxY = $this->getConfigMaxY();
259
		if (!is_null($configMaxY)) {
260
			if ($maxY > $configMaxY) {
261
				\OC_Log::write('core', 'maxX reduced from ' . $maxY . ' to ' . $configMaxY, \OC_Log::DEBUG);
262
				$maxY = $configMaxY;
263
			}
264
		}
265
		$this->maxY = $maxY;
266
		return $this;
267
	}
268
269
	/**
270
	 * set whether or not scalingup is enabled