Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 297-300 (lines=4) @@
294
295
			$date = new \DateTime();
296
			$date->setTime(0, 0, 0);
297
			if ($date >= $expirationDate) {
298
				$message = $this->l->t('Expiration date is in the past');
299
				throw new GenericShareException($message, $message, 404);
300
			}
301
		}
302
303
		// If expiredate is empty set a default one if there is a default
@@ 326-329 (lines=4) @@
323
			$date = new \DateTime();
324
			$date->setTime(0, 0, 0);
325
			$date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D'));
326
			if ($date < $expirationDate) {
327
				$message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]);
328
				throw new GenericShareException($message, $message, 404);
329
			}
330
		}
331
332
		$accepted = true;