Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 308-311 (lines=4) @@
305
306
			$date = new \DateTime();
307
			$date->setTime(0, 0, 0);
308
			if ($date >= $expirationDate) {
309
				$message = $this->l->t('Expiration date is in the past');
310
				throw new GenericShareException($message, $message, 404);
311
			}
312
		}
313
314
		// If expiredate is empty set a default one if there is a default
@@ 337-340 (lines=4) @@
334
			$date = new \DateTime();
335
			$date->setTime(0, 0, 0);
336
			$date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D'));
337
			if ($date < $expirationDate) {
338
				$message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]);
339
				throw new GenericShareException($message, $message, 404);
340
			}
341
		}
342
343
		$accepted = true;