Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 348-351 (lines=4) @@
345
346
			$date = new \DateTime();
347
			$date->setTime(0, 0, 0);
348
			if ($date >= $expirationDate) {
349
				$message = $this->l->t('Expiration date is in the past');
350
				throw new GenericShareException($message, $message, 404);
351
			}
352
		}
353
354
		// If expiredate is empty set a default one if there is a default
@@ 377-380 (lines=4) @@
374
			$date = new \DateTime();
375
			$date->setTime(0, 0, 0);
376
			$date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D'));
377
			if ($date < $expirationDate) {
378
				$message = $this->l->t('Can’t set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]);
379
				throw new GenericShareException($message, $message, 404);
380
			}
381
		}
382
383
		$accepted = true;