Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

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