Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 261-264 (lines=4) @@
258
259
			$date = new \DateTime();
260
			$date->setTime(0, 0, 0);
261
			if ($date >= $expirationDate) {
262
				$message = $this->l->t('Expiration date is in the past');
263
				throw new GenericShareException($message, $message, 404);
264
			}
265
		}
266
267
		// If expiredate is empty set a default one if there is a default
@@ 290-293 (lines=4) @@
287
			$date = new \DateTime();
288
			$date->setTime(0, 0, 0);
289
			$date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D'));
290
			if ($date < $expirationDate) {
291
				$message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]);
292
				throw new GenericShareException($message, $message, 404);
293
			}
294
		}
295
296
		$accepted = true;