Code Duplication    Length = 5-6 lines in 2 locations

apps/files_sharing/lib/Controllers/ShareController.php 1 location

@@ 324-328 (lines=5) @@
321
			 * The OC_Util methods require a view. This just uses the node API
322
			 */
323
			$freeSpace = $share->getNode()->getStorage()->free_space($share->getNode()->getInternalPath());
324
			if ($freeSpace < \OCP\Files\FileInfo::SPACE_UNLIMITED) {
325
				$freeSpace = max($freeSpace, 0);
326
			} else {
327
				$freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
328
			}
329
330
			$uploadLimit = Util::uploadLimit();
331
			$maxUploadFilesize = min($freeSpace, $uploadLimit);

lib/private/legacy/helper.php 1 location

@@ 474-479 (lines=6) @@
471
	 */
472
	public static function freeSpace($dir) {
473
		$freeSpace = \OC\Files\Filesystem::free_space($dir);
474
		if ($freeSpace < \OCP\Files\FileInfo::SPACE_UNLIMITED) {
475
			$freeSpace = max($freeSpace, 0);
476
			return $freeSpace;
477
		} else {
478
			return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
479
		}
480
	}
481
482
	/**