@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | protected function getPath($user, $path) { |
| 102 | 102 | $node = $this->rootFolder->getUserFolder($user)->get($path); |
| 103 | - return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/')); |
|
| 103 | + return 'files/'.md5($node->getStorage()->getId().'::'.trim($node->getInternalPath(), '/')); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | try { |
| 138 | 138 | $lockingProvider->acquireLock($path, $type); |
| 139 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
| 139 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
| 140 | 140 | return new DataResponse(); |
| 141 | 141 | } catch (LockedException $e) { |
| 142 | 142 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | try { |
| 165 | 165 | $lockingProvider->changeLock($path, $type); |
| 166 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
| 166 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
| 167 | 167 | return new DataResponse(); |
| 168 | 168 | } catch (LockedException $e) { |
| 169 | 169 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | try { |
| 192 | 192 | $lockingProvider->releaseLock($path, $type); |
| 193 | - $this->config->deleteAppValue('testing', 'locking_' . $path); |
|
| 193 | + $this->config->deleteAppValue('testing', 'locking_'.$path); |
|
| 194 | 194 | return new DataResponse(); |
| 195 | 195 | } catch (LockedException $e) { |
| 196 | 196 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -233,9 +233,9 @@ discard block |
||
| 233 | 233 | if (strpos($lock, 'locking_') === 0) { |
| 234 | 234 | $path = substr($lock, strlen('locking_')); |
| 235 | 235 | |
| 236 | - if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
| 236 | + if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
| 237 | 237 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
| 238 | - } elseif ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
| 238 | + } elseif ($type === ILockingProvider::LOCK_SHARED && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
| 239 | 239 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
| 240 | 240 | } else { |
| 241 | 241 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | } catch (NotFoundException $e) { |
| 198 | 198 | return new DataResponse( |
| 199 | 199 | [ |
| 200 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 200 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 201 | 201 | ], |
| 202 | 202 | Http::STATUS_NOT_FOUND |
| 203 | 203 | ); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } catch (NotFoundException $e) { |
| 123 | 123 | return new DataResponse( |
| 124 | 124 | [ |
| 125 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 125 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 126 | 126 | ], |
| 127 | 127 | Http::STATUS_NOT_FOUND |
| 128 | 128 | ); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } else { |
| 163 | 163 | return new DataResponse( |
| 164 | 164 | [ |
| 165 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', [$id]) |
|
| 165 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" is not user editable', [$id]) |
|
| 166 | 166 | ], |
| 167 | 167 | Http::STATUS_FORBIDDEN |
| 168 | 168 | ); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } catch (NotFoundException $e) { |
| 171 | 171 | return new DataResponse( |
| 172 | 172 | [ |
| 173 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 173 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 174 | 174 | ], |
| 175 | 175 | Http::STATUS_NOT_FOUND |
| 176 | 176 | ); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | ->setFlag(DefinitionParameter::FLAG_OPTIONAL), |
| 51 | 51 | ]) |
| 52 | 52 | ->addAuthScheme(AuthMechanism::SCHEME_OPENSTACK) |
| 53 | - ->setLegacyAuthMechanismCallback(function (array $params) use ($openstackAuth, $rackspaceAuth) { |
|
| 53 | + ->setLegacyAuthMechanismCallback(function(array $params) use ($openstackAuth, $rackspaceAuth) { |
|
| 54 | 54 | if (isset($params['options']['key']) && $params['options']['key']) { |
| 55 | 55 | return $rackspaceAuth; |
| 56 | 56 | } |
@@ -56,9 +56,9 @@ |
||
| 56 | 56 | protected function execute(InputInterface $input, OutputInterface $output) { |
| 57 | 57 | $progress = new ProgressBar($output); |
| 58 | 58 | $progress->start(); |
| 59 | - $this->syncService->syncThemAll(function ($url, $ex) use ($progress, $output) { |
|
| 59 | + $this->syncService->syncThemAll(function($url, $ex) use ($progress, $output) { |
|
| 60 | 60 | if ($ex instanceof \Exception) { |
| 61 | - $output->writeln("Error while syncing $url : " . $ex->getMessage()); |
|
| 61 | + $output->writeln("Error while syncing $url : ".$ex->getMessage()); |
|
| 62 | 62 | } else { |
| 63 | 63 | $progress->advance(); |
| 64 | 64 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function requestSharedSecret($url, $token) { |
| 136 | 136 | if ($this->trustedServers->isTrustedServer($url) === false) { |
| 137 | - $this->logger->error('remote server not trusted (' . $url . ') while requesting shared secret', ['app' => 'federation']); |
|
| 137 | + $this->logger->error('remote server not trusted ('.$url.') while requesting shared secret', ['app' => 'federation']); |
|
| 138 | 138 | throw new OCSForbiddenException(); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $localToken = $this->dbHandler->getToken($url); |
| 144 | 144 | if (strcmp($localToken, $token) > 0) { |
| 145 | 145 | $this->logger->info( |
| 146 | - 'remote server (' . $url . ') presented lower token. We will initiate the exchange of the shared secret.', |
|
| 146 | + 'remote server ('.$url.') presented lower token. We will initiate the exchange of the shared secret.', |
|
| 147 | 147 | ['app' => 'federation'] |
| 148 | 148 | ); |
| 149 | 149 | throw new OCSForbiddenException(); |
@@ -183,14 +183,14 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function getSharedSecret($url, $token) { |
| 185 | 185 | if ($this->trustedServers->isTrustedServer($url) === false) { |
| 186 | - $this->logger->error('remote server not trusted (' . $url . ') while getting shared secret', ['app' => 'federation']); |
|
| 186 | + $this->logger->error('remote server not trusted ('.$url.') while getting shared secret', ['app' => 'federation']); |
|
| 187 | 187 | throw new OCSForbiddenException(); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | if ($this->isValidToken($url, $token) === false) { |
| 191 | 191 | $expectedToken = $this->dbHandler->getToken($url); |
| 192 | 192 | $this->logger->error( |
| 193 | - 'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "'. $expectedToken . '") while getting shared secret', |
|
| 193 | + 'remote server ('.$url.') didn\'t send a valid token (got "'.$token.'" but expected "'.$expectedToken.'") while getting shared secret', |
|
| 194 | 194 | ['app' => 'federation'] |
| 195 | 195 | ); |
| 196 | 196 | throw new OCSForbiddenException(); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | public function getLastUsedTagIds() { |
| 54 | 54 | $lastUsed = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'systemtags', 'last_used', '[]'); |
| 55 | 55 | $tagIds = json_decode($lastUsed, true); |
| 56 | - return new DataResponse(array_map(function ($id) { |
|
| 56 | + return new DataResponse(array_map(function($id) { |
|
| 57 | 57 | return (string) $id; |
| 58 | 58 | }, $tagIds)); |
| 59 | 59 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $token = $argument['token']; |
| 98 | 98 | $action = $argument['action']; |
| 99 | 99 | $data = json_decode($argument['data'], true); |
| 100 | - $try = (int)$argument['try'] + 1; |
|
| 100 | + $try = (int) $argument['try'] + 1; |
|
| 101 | 101 | |
| 102 | 102 | $result = $this->notifications->sendUpdateToRemote($remote, $remoteId, $token, $action, $data, $try); |
| 103 | 103 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | 'token' => $argument['token'], |
| 122 | 122 | 'data' => $argument['data'], |
| 123 | 123 | 'action' => $argument['action'], |
| 124 | - 'try' => (int)$argument['try'] + 1, |
|
| 124 | + 'try' => (int) $argument['try'] + 1, |
|
| 125 | 125 | 'lastRun' => time() |
| 126 | 126 | ] |
| 127 | 127 | ); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @return bool |
| 135 | 135 | */ |
| 136 | 136 | protected function shouldRun(array $argument) { |
| 137 | - $lastRun = (int)$argument['lastRun']; |
|
| 137 | + $lastRun = (int) $argument['lastRun']; |
|
| 138 | 138 | return ((time() - $lastRun) > $this->interval); |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } else { |
| 91 | 91 | $p = new ProgressBar($output); |
| 92 | 92 | $p->start(); |
| 93 | - $this->userManager->callForSeenUsers(function (IUser $user) use ($p) { |
|
| 93 | + $this->userManager->callForSeenUsers(function(IUser $user) use ($p) { |
|
| 94 | 94 | $p->advance(); |
| 95 | 95 | $this->expireTrashForUser($user); |
| 96 | 96 | }); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | \OC_Util::setupFS($user); |
| 119 | 119 | |
| 120 | 120 | // Check if this user has a trashbin directory |
| 121 | - $view = new \OC\Files\View('/' . $user); |
|
| 121 | + $view = new \OC\Files\View('/'.$user); |
|
| 122 | 122 | if (!$view->is_dir('/files_trashbin/files')) { |
| 123 | 123 | return false; |
| 124 | 124 | } |