Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 302-305 (lines=4) @@
299
300
			$date = new \DateTime();
301
			$date->setTime(0, 0, 0);
302
			if ($date >= $expirationDate) {
303
				$message = $this->l->t('Expiration date is in the past');
304
				throw new GenericShareException($message, $message, 404);
305
			}
306
		}
307
308
		// If expiredate is empty set a default one if there is a default
@@ 331-334 (lines=4) @@
328
			$date = new \DateTime();
329
			$date->setTime(0, 0, 0);
330
			$date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D'));
331
			if ($date < $expirationDate) {
332
				$message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]);
333
				throw new GenericShareException($message, $message, 404);
334
			}
335
		}
336
337
		$accepted = true;