Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

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