Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 325-328 (lines=4) @@
322
323
			$date = new \DateTime();
324
			$date->setTime(0, 0, 0);
325
			if ($date >= $expirationDate) {
326
				$message = $this->l->t('Expiration date is in the past');
327
				throw new GenericShareException($message, $message, 404);
328
			}
329
		}
330
331
		// If expiredate is empty set a default one if there is a default
@@ 354-357 (lines=4) @@
351
			$date = new \DateTime();
352
			$date->setTime(0, 0, 0);
353
			$date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D'));
354
			if ($date < $expirationDate) {
355
				$message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]);
356
				throw new GenericShareException($message, $message, 404);
357
			}
358
		}
359
360
		$accepted = true;