Code Duplication    Length = 4-4 lines in 2 locations

lib/private/share20/manager.php 2 locations

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