Code Duplication    Length = 5-6 lines in 2 locations

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

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

lib/private/legacy/helper.php 1 location

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