diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-10-05 15:12:57 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-10-05 20:25:24 +0200 |
commit | d9015a8c94bfd71fe484618a06d276701d3bf9ff (patch) | |
tree | 3f7a1cd6ec2fd982dd02de71b76076f7f01cef70 /apps/files/lib | |
parent | d357f4b10fe1b59e1e07bb90641d647522c7bfe2 (diff) | |
download | nextcloud-server-d9015a8c94bfd71fe484618a06d276701d3bf9ff.tar.gz nextcloud-server-d9015a8c94bfd71fe484618a06d276701d3bf9ff.zip |
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/AppInfo/Application.php | 2 | ||||
-rw-r--r-- | apps/files/lib/Command/Scan.php | 2 | ||||
-rw-r--r-- | apps/files/lib/Command/ScanAppData.php | 2 | ||||
-rw-r--r-- | apps/files/lib/Controller/ViewController.php | 88 | ||||
-rw-r--r-- | apps/files/lib/Helper.php | 4 |
5 files changed, 49 insertions, 49 deletions
diff --git a/apps/files/lib/AppInfo/Application.php b/apps/files/lib/AppInfo/Application.php index 434fb482aa8..7bd3acdf8e4 100644 --- a/apps/files/lib/AppInfo/Application.php +++ b/apps/files/lib/AppInfo/Application.php @@ -69,7 +69,7 @@ use Psr\Container\ContainerInterface; class Application extends App implements IBootstrap { public const APP_ID = 'files'; - public function __construct(array $urlParams=[]) { + public function __construct(array $urlParams = []) { parent::__construct(self::APP_ID, $urlParams); } diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index 6ca6ba76945..2f96e495018 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -299,7 +299,7 @@ class Scan extends Base { protected function formatExecTime() { $secs = round($this->execTime); # convert seconds into HH:MM:SS form - return sprintf('%02d:%02d:%02d', ($secs/3600), ($secs/60%60), $secs%60); + return sprintf('%02d:%02d:%02d', ($secs / 3600), ($secs / 60 % 60), $secs % 60); } /** diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php index 7b20fb011b0..f67ac7e6d2d 100644 --- a/apps/files/lib/Command/ScanAppData.php +++ b/apps/files/lib/Command/ScanAppData.php @@ -246,7 +246,7 @@ class ScanAppData extends Base { protected function formatExecTime() { $secs = round($this->execTime); # convert seconds into HH:MM:SS form - return sprintf('%02d:%02d:%02d', ($secs/3600), ($secs/60%60), $secs%60); + return sprintf('%02d:%02d:%02d', ($secs / 3600), ($secs / 60 % 60), $secs % 60); } /** diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 1568e0c9f54..c5ff6eff194 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -95,16 +95,16 @@ class ViewController extends Controller { Helper $activityHelper ) { parent::__construct($appName, $request); - $this->appName = $appName; - $this->request = $request; - $this->urlGenerator = $urlGenerator; - $this->l10n = $l10n; - $this->config = $config; + $this->appName = $appName; + $this->request = $request; + $this->urlGenerator = $urlGenerator; + $this->l10n = $l10n; + $this->config = $config; $this->eventDispatcher = $eventDispatcher; - $this->userSession = $userSession; - $this->appManager = $appManager; - $this->rootFolder = $rootFolder; - $this->activityHelper = $activityHelper; + $this->userSession = $userSession; + $this->appManager = $appManager; + $this->rootFolder = $rootFolder; + $this->activityHelper = $activityHelper; } /** @@ -113,8 +113,8 @@ class ViewController extends Controller { * @return string */ protected function renderScript($appName, $scriptName) { - $content = ''; - $appPath = \OC_App::getAppPath($appName); + $content = ''; + $appPath = \OC_App::getAppPath($appName); $scriptPath = $appPath . '/' . $scriptName; if (file_exists($scriptPath)) { // TODO: sanitize path / script name ? @@ -203,19 +203,19 @@ class ViewController extends Controller { $favoritesSublistArray = []; $navBarPositionPosition = 6; - $currentCount = 0; + $currentCount = 0; foreach ($favElements['folders'] as $dir) { - $link = $this->urlGenerator->linkToRoute('files.view.index', ['dir' => $dir, 'view' => 'files']); + $link = $this->urlGenerator->linkToRoute('files.view.index', ['dir' => $dir, 'view' => 'files']); $sortingValue = ++$currentCount; - $element = [ - 'id' => str_replace('/', '-', $dir), - 'view' => 'files', - 'href' => $link, - 'dir' => $dir, - 'order' => $navBarPositionPosition, - 'folderPosition' => $sortingValue, - 'name' => basename($dir), - 'icon' => 'files', + $element = [ + 'id' => str_replace('/', '-', $dir), + 'view' => 'files', + 'href' => $link, + 'dir' => $dir, + 'order' => $navBarPositionPosition, + 'folderPosition' => $sortingValue, + 'name' => basename($dir), + 'icon' => 'files', 'quickaccesselement' => 'true' ]; @@ -266,13 +266,13 @@ class ViewController extends Controller { $subcontent = $this->renderScript($subitem['appname'], $subitem['script']); } $contentItems[$subitem['id']] = [ - 'id' => $subitem['id'], + 'id' => $subitem['id'], 'content' => $subcontent ]; } } $contentItems[$item['id']] = [ - 'id' => $item['id'], + 'id' => $item['id'], 'content' => $content ]; } @@ -285,22 +285,22 @@ class ViewController extends Controller { $this->eventDispatcher->dispatchTyped(new LoadViewer()); } - $params = []; - $params['usedSpacePercent'] = (int) $storageInfo['relative']; - $params['owner'] = $storageInfo['owner'] ?? ''; - $params['ownerDisplayName'] = $storageInfo['ownerDisplayName'] ?? ''; - $params['isPublic'] = false; - $params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes'); - $params['defaultFileSorting'] = $this->config->getUserValue($user, 'files', 'file_sorting', 'name'); + $params = []; + $params['usedSpacePercent'] = (int) $storageInfo['relative']; + $params['owner'] = $storageInfo['owner'] ?? ''; + $params['ownerDisplayName'] = $storageInfo['ownerDisplayName'] ?? ''; + $params['isPublic'] = false; + $params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes'); + $params['defaultFileSorting'] = $this->config->getUserValue($user, 'files', 'file_sorting', 'name'); $params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc'); - $params['showgridview'] = $this->config->getUserValue($user, 'files', 'show_grid', false); - $params['isIE'] = \OCP\Util::isIE(); - $showHidden = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false); - $params['showHiddenFiles'] = $showHidden ? 1 : 0; - $params['fileNotFound'] = $fileNotFound ? 1 : 0; - $params['appNavigation'] = $nav; - $params['appContents'] = $contentItems; - $params['hiddenFields'] = $event->getHiddenFields(); + $params['showgridview'] = $this->config->getUserValue($user, 'files', 'show_grid', false); + $params['isIE'] = \OCP\Util::isIE(); + $showHidden = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false); + $params['showHiddenFiles'] = $showHidden ? 1 : 0; + $params['fileNotFound'] = $fileNotFound ? 1 : 0; + $params['appNavigation'] = $nav; + $params['appContents'] = $contentItems; + $params['hiddenFields'] = $event->getHiddenFields(); $response = new TemplateResponse( $this->appName, @@ -322,14 +322,14 @@ class ViewController extends Controller { * @throws \OCP\Files\NotFoundException */ private function redirectToFile($fileId) { - $uid = $this->userSession->getUser()->getUID(); + $uid = $this->userSession->getUser()->getUID(); $baseFolder = $this->rootFolder->getUserFolder($uid); - $files = $baseFolder->getById($fileId); - $params = []; + $files = $baseFolder->getById($fileId); + $params = []; if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) { - $baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/'); - $files = $baseFolder->getById($fileId); + $baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/'); + $files = $baseFolder->getById($fileId); $params['view'] = 'trashbin'; } diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php index 2d5a3e2f26e..69ab8f8f64f 100644 --- a/apps/files/lib/Helper.php +++ b/apps/files/lib/Helper.php @@ -56,11 +56,11 @@ class Helper { return [ 'uploadMaxFilesize' => $maxUploadFileSize, - 'maxHumanFilesize' => $maxHumanFileSize, + 'maxHumanFilesize' => $maxHumanFileSize, 'freeSpace' => $storageInfo['free'], 'quota' => $storageInfo['quota'], 'used' => $storageInfo['used'], - 'usedSpacePercent' => (int)$storageInfo['relative'], + 'usedSpacePercent' => (int)$storageInfo['relative'], 'owner' => $storageInfo['owner'], 'ownerDisplayName' => $storageInfo['ownerDisplayName'], 'mountType' => $storageInfo['mountType'], |