Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 284-287 (lines=4) @@
281
282
			$date = new \DateTime();
283
			$date->setTime(0, 0, 0);
284
			if ($date >= $expirationDate) {
285
				$message = $this->l->t('Expiration date is in the past');
286
				throw new GenericShareException($message, $message, 404);
287
			}
288
		}
289
290
		// If expiredate is empty set a default one if there is a default
@@ 313-316 (lines=4) @@
310
			$date = new \DateTime();
311
			$date->setTime(0, 0, 0);
312
			$date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D'));
313
			if ($date < $expirationDate) {
314
				$message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]);
315
				throw new GenericShareException($message, $message, 404);
316
			}
317
		}
318
319
		$accepted = true;