@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $remoteStorages = $this->getRemoteStorages(); |
| 62 | 62 | |
| 63 | - $output->writeln(count($remoteStorages) . ' remote storage(s) need(s) to be checked'); |
|
| 63 | + $output->writeln(count($remoteStorages).' remote storage(s) need(s) to be checked'); |
|
| 64 | 64 | |
| 65 | 65 | $remoteShareIds = $this->getRemoteShareIds(); |
| 66 | 66 | |
| 67 | - $output->writeln(count($remoteShareIds) . ' remote share(s) exist'); |
|
| 67 | + $output->writeln(count($remoteShareIds).' remote share(s) exist'); |
|
| 68 | 68 | |
| 69 | 69 | foreach ($remoteShareIds as $id => $remoteShareId) { |
| 70 | 70 | if (isset($remoteStorages[$remoteShareId])) { |
@@ -142,13 +142,13 @@ discard block |
||
| 142 | 142 | ->where($queryBuilder->expr()->like( |
| 143 | 143 | 'id', |
| 144 | 144 | // match all 'shared::' + 32 characters storages |
| 145 | - $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::') . str_repeat('_', 32)), |
|
| 145 | + $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::').str_repeat('_', 32)), |
|
| 146 | 146 | IQueryBuilder::PARAM_STR) |
| 147 | 147 | ) |
| 148 | 148 | ->andWhere($queryBuilder->expr()->notLike( |
| 149 | 149 | 'id', |
| 150 | 150 | // but not the ones starting with a '/', they are for normal shares |
| 151 | - $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'), |
|
| 151 | + $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/').'%'), |
|
| 152 | 152 | IQueryBuilder::PARAM_STR) |
| 153 | 153 | )->orderBy('numeric_id'); |
| 154 | 154 | $query = $queryBuilder->execute(); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $remoteShareIds = []; |
| 173 | 173 | |
| 174 | 174 | while ($row = $query->fetch()) { |
| 175 | - $remoteShareIds[$row['id']] = 'shared::' . md5($row['share_token'] . '@' . $row['remote']); |
|
| 175 | + $remoteShareIds[$row['id']] = 'shared::'.md5($row['share_token'].'@'.$row['remote']); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | return $remoteShareIds; |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * pass all other function directly to the \Doctrine\DBAL\Driver\Statement |
| 56 | 56 | */ |
| 57 | - public function __call($name,$arguments) { |
|
| 58 | - return call_user_func_array(array($this->statement,$name), $arguments); |
|
| 57 | + public function __call($name, $arguments) { |
|
| 58 | + return call_user_func_array(array($this->statement, $name), $arguments); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * @param array $input |
| 65 | 65 | * @return \OC_DB_StatementWrapper|int|bool |
| 66 | 66 | */ |
| 67 | - public function execute($input= []) { |
|
| 67 | + public function execute($input = []) { |
|
| 68 | 68 | $this->lastArguments = $input; |
| 69 | 69 | if (count($input) > 0) { |
| 70 | 70 | $result = $this->statement->execute($input); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @param integer|null $length max length when using an OUT bind |
| 114 | 114 | * @return boolean |
| 115 | 115 | */ |
| 116 | - public function bindParam($column, &$variable, $type = null, $length = null){ |
|
| 116 | + public function bindParam($column, &$variable, $type = null, $length = null) { |
|
| 117 | 117 | return $this->statement->bindParam($column, $variable, $type, $length); |
| 118 | 118 | } |
| 119 | 119 | } |
@@ -93,20 +93,20 @@ discard block |
||
| 93 | 93 | $this->logger = $logger; |
| 94 | 94 | $cachedGroups = & $this->cachedGroups; |
| 95 | 95 | $cachedUserGroups = & $this->cachedUserGroups; |
| 96 | - $this->listen('\OC\Group', 'postDelete', function ($group) use (&$cachedGroups, &$cachedUserGroups) { |
|
| 96 | + $this->listen('\OC\Group', 'postDelete', function($group) use (&$cachedGroups, &$cachedUserGroups) { |
|
| 97 | 97 | /** |
| 98 | 98 | * @var \OC\Group\Group $group |
| 99 | 99 | */ |
| 100 | 100 | unset($cachedGroups[$group->getGID()]); |
| 101 | 101 | $cachedUserGroups = array(); |
| 102 | 102 | }); |
| 103 | - $this->listen('\OC\Group', 'postAddUser', function ($group) use (&$cachedUserGroups) { |
|
| 103 | + $this->listen('\OC\Group', 'postAddUser', function($group) use (&$cachedUserGroups) { |
|
| 104 | 104 | /** |
| 105 | 105 | * @var \OC\Group\Group $group |
| 106 | 106 | */ |
| 107 | 107 | $cachedUserGroups = array(); |
| 108 | 108 | }); |
| 109 | - $this->listen('\OC\Group', 'postRemoveUser', function ($group) use (&$cachedUserGroups) { |
|
| 109 | + $this->listen('\OC\Group', 'postRemoveUser', function($group) use (&$cachedUserGroups) { |
|
| 110 | 110 | /** |
| 111 | 111 | * @var \OC\Group\Group $group |
| 112 | 112 | */ |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | if ($aGroup instanceof IGroup) { |
| 236 | 236 | $groups[$groupId] = $aGroup; |
| 237 | 237 | } else { |
| 238 | - $this->logger->debug('Group "' . $groupId . '" was returned by search but not found through direct access', ['app' => 'core']); |
|
| 238 | + $this->logger->debug('Group "'.$groupId.'" was returned by search but not found through direct access', ['app' => 'core']); |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | if (!is_null($limit) and $limit <= 0) { |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * @param IUser|null $user |
| 250 | 250 | * @return \OC\Group\Group[] |
| 251 | 251 | */ |
| 252 | - public function getUserGroups(IUser $user= null) { |
|
| 252 | + public function getUserGroups(IUser $user = null) { |
|
| 253 | 253 | if (!$user instanceof IUser) { |
| 254 | 254 | return []; |
| 255 | 255 | } |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | if ($aGroup instanceof IGroup) { |
| 274 | 274 | $groups[$groupId] = $aGroup; |
| 275 | 275 | } else { |
| 276 | - $this->logger->debug('User "' . $uid . '" belongs to deleted group: "' . $groupId . '"', ['app' => 'core']); |
|
| 276 | + $this->logger->debug('User "'.$uid.'" belongs to deleted group: "'.$groupId.'"', ['app' => 'core']); |
|
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | } |
@@ -322,32 +322,32 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { |
| 324 | 324 | $group = $this->get($gid); |
| 325 | - if(is_null($group)) { |
|
| 325 | + if (is_null($group)) { |
|
| 326 | 326 | return array(); |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | $search = trim($search); |
| 330 | 330 | $groupUsers = array(); |
| 331 | 331 | |
| 332 | - if(!empty($search)) { |
|
| 332 | + if (!empty($search)) { |
|
| 333 | 333 | // only user backends have the capability to do a complex search for users |
| 334 | 334 | $searchOffset = 0; |
| 335 | 335 | $searchLimit = $limit * 100; |
| 336 | - if($limit === -1) { |
|
| 336 | + if ($limit === -1) { |
|
| 337 | 337 | $searchLimit = 500; |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | do { |
| 341 | 341 | $filteredUsers = $this->userManager->searchDisplayName($search, $searchLimit, $searchOffset); |
| 342 | - foreach($filteredUsers as $filteredUser) { |
|
| 343 | - if($group->inGroup($filteredUser)) { |
|
| 344 | - $groupUsers[]= $filteredUser; |
|
| 342 | + foreach ($filteredUsers as $filteredUser) { |
|
| 343 | + if ($group->inGroup($filteredUser)) { |
|
| 344 | + $groupUsers[] = $filteredUser; |
|
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | $searchOffset += $searchLimit; |
| 348 | - } while(count($groupUsers) < $searchLimit+$offset && count($filteredUsers) >= $searchLimit); |
|
| 348 | + } while (count($groupUsers) < $searchLimit + $offset && count($filteredUsers) >= $searchLimit); |
|
| 349 | 349 | |
| 350 | - if($limit === -1) { |
|
| 350 | + if ($limit === -1) { |
|
| 351 | 351 | $groupUsers = array_slice($groupUsers, $offset); |
| 352 | 352 | } else { |
| 353 | 353 | $groupUsers = array_slice($groupUsers, $offset, $limit); |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | $matchingUsers = array(); |
| 360 | - foreach($groupUsers as $groupUser) { |
|
| 360 | + foreach ($groupUsers as $groupUser) { |
|
| 361 | 361 | $matchingUsers[$groupUser->getUID()] = $groupUser->getDisplayName(); |
| 362 | 362 | } |
| 363 | 363 | return $matchingUsers; |
@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function __construct($appName, |
| 61 | 61 | IRequest $request, |
| 62 | - $corsMethods='PUT, POST, GET, DELETE, PATCH', |
|
| 63 | - $corsAllowedHeaders='Authorization, Content-Type, Accept', |
|
| 64 | - $corsMaxAge=1728000){ |
|
| 62 | + $corsMethods = 'PUT, POST, GET, DELETE, PATCH', |
|
| 63 | + $corsAllowedHeaders = 'Authorization, Content-Type, Accept', |
|
| 64 | + $corsMaxAge = 1728000) { |
|
| 65 | 65 | parent::__construct($appName, $request); |
| 66 | 66 | $this->corsMethods = $corsMethods; |
| 67 | 67 | $this->corsAllowedHeaders = $corsAllowedHeaders; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @since 7.0.0 |
| 80 | 80 | */ |
| 81 | 81 | public function preflightedCors() { |
| 82 | - if(isset($this->request->server['HTTP_ORIGIN'])) { |
|
| 82 | + if (isset($this->request->server['HTTP_ORIGIN'])) { |
|
| 83 | 83 | $origin = $this->request->server['HTTP_ORIGIN']; |
| 84 | 84 | } else { |
| 85 | 85 | $origin = '*'; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $response = new Response(); |
| 89 | 89 | $response->addHeader('Access-Control-Allow-Origin', $origin); |
| 90 | 90 | $response->addHeader('Access-Control-Allow-Methods', $this->corsMethods); |
| 91 | - $response->addHeader('Access-Control-Max-Age', (string)$this->corsMaxAge); |
|
| 91 | + $response->addHeader('Access-Control-Max-Age', (string) $this->corsMaxAge); |
|
| 92 | 92 | $response->addHeader('Access-Control-Allow-Headers', $this->corsAllowedHeaders); |
| 93 | 93 | $response->addHeader('Access-Control-Allow-Credentials', 'false'); |
| 94 | 94 | return $response; |
@@ -30,6 +30,6 @@ |
||
| 30 | 30 | * @package OCP\Files |
| 31 | 31 | * @since 11.0.0 |
| 32 | 32 | */ |
| 33 | -interface IAppData extends ISimpleRoot { |
|
| 33 | +interface IAppData extends ISimpleRoot { |
|
| 34 | 34 | |
| 35 | 35 | } |
@@ -128,32 +128,32 @@ discard block |
||
| 128 | 128 | $authBackend = $this->backendService->getAuthMechanism($authIdentifier); |
| 129 | 129 | |
| 130 | 130 | if (!Filesystem::isValidPath($mountPoint)) { |
| 131 | - $output->writeln('<error>Invalid mountpoint "' . $mountPoint . '"</error>'); |
|
| 131 | + $output->writeln('<error>Invalid mountpoint "'.$mountPoint.'"</error>'); |
|
| 132 | 132 | return 1; |
| 133 | 133 | } |
| 134 | 134 | if (is_null($storageBackend)) { |
| 135 | - $output->writeln('<error>Storage backend with identifier "' . $storageIdentifier . '" not found (see `occ files_external:backends` for possible values)</error>'); |
|
| 135 | + $output->writeln('<error>Storage backend with identifier "'.$storageIdentifier.'" not found (see `occ files_external:backends` for possible values)</error>'); |
|
| 136 | 136 | return 404; |
| 137 | 137 | } |
| 138 | 138 | if (is_null($authBackend)) { |
| 139 | - $output->writeln('<error>Authentication backend with identifier "' . $authIdentifier . '" not found (see `occ files_external:backends` for possible values)</error>'); |
|
| 139 | + $output->writeln('<error>Authentication backend with identifier "'.$authIdentifier.'" not found (see `occ files_external:backends` for possible values)</error>'); |
|
| 140 | 140 | return 404; |
| 141 | 141 | } |
| 142 | 142 | $supportedSchemes = array_keys($storageBackend->getAuthSchemes()); |
| 143 | 143 | if (!in_array($authBackend->getScheme(), $supportedSchemes)) { |
| 144 | - $output->writeln('<error>Authentication backend "' . $authIdentifier . '" not valid for storage backend "' . $storageIdentifier . '" (see `occ files_external:backends storage ' . $storageIdentifier . '` for possible values)</error>'); |
|
| 144 | + $output->writeln('<error>Authentication backend "'.$authIdentifier.'" not valid for storage backend "'.$storageIdentifier.'" (see `occ files_external:backends storage '.$storageIdentifier.'` for possible values)</error>'); |
|
| 145 | 145 | return 1; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | $config = []; |
| 149 | 149 | foreach ($configInput as $configOption) { |
| 150 | 150 | if (!strpos($configOption, '=')) { |
| 151 | - $output->writeln('<error>Invalid mount configuration option "' . $configOption . '"</error>'); |
|
| 151 | + $output->writeln('<error>Invalid mount configuration option "'.$configOption.'"</error>'); |
|
| 152 | 152 | return 1; |
| 153 | 153 | } |
| 154 | 154 | list($key, $value) = explode('=', $configOption, 2); |
| 155 | 155 | if (!$this->validateParam($key, $value, $storageBackend, $authBackend)) { |
| 156 | - $output->writeln('<error>Unknown configuration for backends "' . $key . '"</error>'); |
|
| 156 | + $output->writeln('<error>Unknown configuration for backends "'.$key.'"</error>'); |
|
| 157 | 157 | return 1; |
| 158 | 158 | } |
| 159 | 159 | $config[$key] = $value; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | if ($user) { |
| 169 | 169 | if (!$this->userManager->userExists($user)) { |
| 170 | - $output->writeln('<error>User "' . $user . '" not found</error>'); |
|
| 170 | + $output->writeln('<error>User "'.$user.'" not found</error>'); |
|
| 171 | 171 | return 1; |
| 172 | 172 | } |
| 173 | 173 | $mount->setApplicableUsers([$user]); |
@@ -178,9 +178,9 @@ discard block |
||
| 178 | 178 | } else { |
| 179 | 179 | $this->getStorageService($user)->addStorage($mount); |
| 180 | 180 | if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) { |
| 181 | - $output->writeln('<info>Storage created with id ' . $mount->getId() . '</info>'); |
|
| 181 | + $output->writeln('<info>Storage created with id '.$mount->getId().'</info>'); |
|
| 182 | 182 | } else { |
| 183 | - $output->writeln((string)$mount->getId()); |
|
| 183 | + $output->writeln((string) $mount->getId()); |
|
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | return 0; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | public function __construct($arguments) { |
| 51 | 51 | $this->user = $arguments['user']; |
| 52 | 52 | $datadir = $this->user->getHome(); |
| 53 | - $this->id = 'home::' . $this->user->getUID(); |
|
| 53 | + $this->id = 'home::'.$this->user->getUID(); |
|
| 54 | 54 | |
| 55 | 55 | parent::__construct(['datadir' => $datadir]); |
| 56 | 56 | } |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | return $this->getServiceNotAvailableResponse(); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - return array_map(function (IToken $token) use ($sessionToken) { |
|
| 106 | + return array_map(function(IToken $token) use ($sessionToken) { |
|
| 107 | 107 | $data = $token->jsonSerialize(); |
| 108 | 108 | if ($sessionToken->getId() === $token->getId()) { |
| 109 | 109 | $data['canDelete'] = false; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | public function castColumn($column, $type) { |
| 148 | 148 | if ($type === IQueryBuilder::PARAM_STR) { |
| 149 | 149 | $column = $this->helper->quoteColumnName($column); |
| 150 | - return new QueryFunction('to_char(' . $column . ')'); |
|
| 150 | + return new QueryFunction('to_char('.$column.')'); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return parent::castColumn($column, $type); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @inheritdoc |
| 158 | 158 | */ |
| 159 | 159 | public function like($x, $y, $type = null) { |
| 160 | - return parent::like($x, $y, $type) . " ESCAPE '\\'"; |
|
| 160 | + return parent::like($x, $y, $type)." ESCAPE '\\'"; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -166,6 +166,6 @@ discard block |
||
| 166 | 166 | public function iLike($x, $y, $type = null) { |
| 167 | 167 | $x = $this->helper->quoteColumnName($x); |
| 168 | 168 | $y = $this->helper->quoteColumnName($y); |
| 169 | - return new QueryFunction('REGEXP_LIKE(' . $x . ', \'^\' || REPLACE(REPLACE(' . $y . ', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')'); |
|
| 169 | + return new QueryFunction('REGEXP_LIKE('.$x.', \'^\' || REPLACE(REPLACE('.$y.', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')'); |
|
| 170 | 170 | } |
| 171 | 171 | } |