diff options
Diffstat (limited to 'apps/files/lib/helper.php')
-rw-r--r-- | apps/files/lib/helper.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index 84b1a0f1662..bcca6f0a276 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -13,21 +13,26 @@ use OCP\Files\FileInfo; /** * Helper class for manipulating file information */ -class Helper -{ +class Helper { + /** + * @param string $dir + * @return array + * @throws \OCP\Files\NotFoundException + */ public static function buildFileStorageStatistics($dir) { // information about storage capacities $storageInfo = \OC_Helper::getStorageInfo($dir); - $l = new \OC_L10N('files'); $maxUploadFileSize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']); $maxHumanFileSize = \OCP\Util::humanFileSize($maxUploadFileSize); $maxHumanFileSize = $l->t('Upload (max. %s)', array($maxHumanFileSize)); - return array('uploadMaxFilesize' => $maxUploadFileSize, - 'maxHumanFilesize' => $maxHumanFileSize, - 'freeSpace' => $storageInfo['free'], - 'usedSpacePercent' => (int)$storageInfo['relative']); + return [ + 'uploadMaxFilesize' => $maxUploadFileSize, + 'maxHumanFilesize' => $maxHumanFileSize, + 'freeSpace' => $storageInfo['free'], + 'usedSpacePercent' => (int)$storageInfo['relative'] + ]; } /** |