@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function md5($input): IQueryFunction { |
| 50 | - return new QueryFunction('MD5(' . $this->helper->quoteColumnName($input) . ')'); |
|
| 50 | + return new QueryFunction('MD5('.$this->helper->quoteColumnName($input).')'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public function concat($x, ...$expr): IQueryFunction { |
@@ -61,64 +61,64 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function groupConcat($expr, ?string $separator = ','): IQueryFunction { |
| 63 | 63 | $separator = $this->connection->quote($separator); |
| 64 | - return new QueryFunction('GROUP_CONCAT(' . $this->helper->quoteColumnName($expr) . ' SEPARATOR ' . $separator . ')'); |
|
| 64 | + return new QueryFunction('GROUP_CONCAT('.$this->helper->quoteColumnName($expr).' SEPARATOR '.$separator.')'); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function substring($input, $start, $length = null): IQueryFunction { |
| 68 | 68 | if ($length) { |
| 69 | - return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ', ' . $this->helper->quoteColumnName($length) . ')'); |
|
| 69 | + return new QueryFunction('SUBSTR('.$this->helper->quoteColumnName($input).', '.$this->helper->quoteColumnName($start).', '.$this->helper->quoteColumnName($length).')'); |
|
| 70 | 70 | } else { |
| 71 | - return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ')'); |
|
| 71 | + return new QueryFunction('SUBSTR('.$this->helper->quoteColumnName($input).', '.$this->helper->quoteColumnName($start).')'); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public function sum($field): IQueryFunction { |
| 76 | - return new QueryFunction('SUM(' . $this->helper->quoteColumnName($field) . ')'); |
|
| 76 | + return new QueryFunction('SUM('.$this->helper->quoteColumnName($field).')'); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | public function lower($field): IQueryFunction { |
| 80 | - return new QueryFunction('LOWER(' . $this->helper->quoteColumnName($field) . ')'); |
|
| 80 | + return new QueryFunction('LOWER('.$this->helper->quoteColumnName($field).')'); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | public function add($x, $y): IQueryFunction { |
| 84 | - return new QueryFunction($this->helper->quoteColumnName($x) . ' + ' . $this->helper->quoteColumnName($y)); |
|
| 84 | + return new QueryFunction($this->helper->quoteColumnName($x).' + '.$this->helper->quoteColumnName($y)); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | public function subtract($x, $y): IQueryFunction { |
| 88 | - return new QueryFunction($this->helper->quoteColumnName($x) . ' - ' . $this->helper->quoteColumnName($y)); |
|
| 88 | + return new QueryFunction($this->helper->quoteColumnName($x).' - '.$this->helper->quoteColumnName($y)); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | public function count($count = '', $alias = ''): IQueryFunction { |
| 92 | - $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; |
|
| 92 | + $alias = $alias ? (' AS '.$this->helper->quoteColumnName($alias)) : ''; |
|
| 93 | 93 | $quotedName = $count === '' ? '*' : $this->helper->quoteColumnName($count); |
| 94 | - return new QueryFunction('COUNT(' . $quotedName . ')' . $alias); |
|
| 94 | + return new QueryFunction('COUNT('.$quotedName.')'.$alias); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | public function octetLength($field, $alias = ''): IQueryFunction { |
| 98 | - $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; |
|
| 98 | + $alias = $alias ? (' AS '.$this->helper->quoteColumnName($alias)) : ''; |
|
| 99 | 99 | $quotedName = $this->helper->quoteColumnName($field); |
| 100 | - return new QueryFunction('OCTET_LENGTH(' . $quotedName . ')' . $alias); |
|
| 100 | + return new QueryFunction('OCTET_LENGTH('.$quotedName.')'.$alias); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | public function charLength($field, $alias = ''): IQueryFunction { |
| 104 | - $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; |
|
| 104 | + $alias = $alias ? (' AS '.$this->helper->quoteColumnName($alias)) : ''; |
|
| 105 | 105 | $quotedName = $this->helper->quoteColumnName($field); |
| 106 | - return new QueryFunction('CHAR_LENGTH(' . $quotedName . ')' . $alias); |
|
| 106 | + return new QueryFunction('CHAR_LENGTH('.$quotedName.')'.$alias); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | public function max($field): IQueryFunction { |
| 110 | - return new QueryFunction('MAX(' . $this->helper->quoteColumnName($field) . ')'); |
|
| 110 | + return new QueryFunction('MAX('.$this->helper->quoteColumnName($field).')'); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | public function min($field): IQueryFunction { |
| 114 | - return new QueryFunction('MIN(' . $this->helper->quoteColumnName($field) . ')'); |
|
| 114 | + return new QueryFunction('MIN('.$this->helper->quoteColumnName($field).')'); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | public function greatest($x, $y): IQueryFunction { |
| 118 | - return new QueryFunction('GREATEST(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')'); |
|
| 118 | + return new QueryFunction('GREATEST('.$this->helper->quoteColumnName($x).', '.$this->helper->quoteColumnName($y).')'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | public function least($x, $y): IQueryFunction { |
| 122 | - return new QueryFunction('LEAST(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')'); |
|
| 122 | + return new QueryFunction('LEAST('.$this->helper->quoteColumnName($x).', '.$this->helper->quoteColumnName($y).')'); |
|
| 123 | 123 | } |
| 124 | 124 | } |
@@ -38,26 +38,26 @@ |
||
| 38 | 38 | |
| 39 | 39 | public function groupConcat($expr, ?string $separator = ','): IQueryFunction { |
| 40 | 40 | $separator = $this->connection->quote($separator); |
| 41 | - return new QueryFunction('GROUP_CONCAT(' . $this->helper->quoteColumnName($expr) . ', ' . $separator . ')'); |
|
| 41 | + return new QueryFunction('GROUP_CONCAT('.$this->helper->quoteColumnName($expr).', '.$separator.')'); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function greatest($x, $y): IQueryFunction { |
| 45 | - return new QueryFunction('MAX(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')'); |
|
| 45 | + return new QueryFunction('MAX('.$this->helper->quoteColumnName($x).', '.$this->helper->quoteColumnName($y).')'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function least($x, $y): IQueryFunction { |
| 49 | - return new QueryFunction('MIN(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')'); |
|
| 49 | + return new QueryFunction('MIN('.$this->helper->quoteColumnName($x).', '.$this->helper->quoteColumnName($y).')'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function octetLength($field, $alias = ''): IQueryFunction { |
| 53 | - $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; |
|
| 53 | + $alias = $alias ? (' AS '.$this->helper->quoteColumnName($alias)) : ''; |
|
| 54 | 54 | $quotedName = $this->helper->quoteColumnName($field); |
| 55 | - return new QueryFunction('LENGTH(CAST(' . $quotedName . ' as BLOB))' . $alias); |
|
| 55 | + return new QueryFunction('LENGTH(CAST('.$quotedName.' as BLOB))'.$alias); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function charLength($field, $alias = ''): IQueryFunction { |
| 59 | - $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; |
|
| 59 | + $alias = $alias ? (' AS '.$this->helper->quoteColumnName($alias)) : ''; |
|
| 60 | 60 | $quotedName = $this->helper->quoteColumnName($field); |
| 61 | - return new QueryFunction('LENGTH(' . $quotedName . ')' . $alias); |
|
| 61 | + return new QueryFunction('LENGTH('.$quotedName.')'.$alias); |
|
| 62 | 62 | } |
| 63 | 63 | } |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | |
| 144 | 144 | protected function emitUnassign(string $oldId, bool $pre): void { |
| 145 | 145 | if ($this->userManager instanceof PublicEmitter) { |
| 146 | - $this->userManager->emit('\OC\User', $pre ? 'pre' : 'post' . 'UnassignedUserId', [$oldId]); |
|
| 146 | + $this->userManager->emit('\OC\User', $pre ? 'pre' : 'post'.'UnassignedUserId', [$oldId]); |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | private function getCachedToken(string $cacheKey) { |
| 94 | - $cachedTokenString = $this->cache->get($cacheKey . '/token'); |
|
| 94 | + $cachedTokenString = $this->cache->get($cacheKey.'/token'); |
|
| 95 | 95 | if ($cachedTokenString) { |
| 96 | 96 | return json_decode($cachedTokenString, true); |
| 97 | 97 | } else { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | $this->params['cachedToken'] = $value; |
| 120 | - $this->cache->set($cacheKey . '/token', json_encode($value)); |
|
| 120 | + $this->cache->set($cacheKey.'/token', json_encode($value)); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | $this->params = array_merge(self::DEFAULT_OPTIONS, $this->params); |
| 150 | 150 | |
| 151 | - $cacheKey = $userName . '@' . $this->params['url'] . '/' . $this->params['container']; |
|
| 151 | + $cacheKey = $userName.'@'.$this->params['url'].'/'.$this->params['container']; |
|
| 152 | 152 | $token = $this->getCachedToken($cacheKey); |
| 153 | 153 | $this->params['cachedToken'] = $token; |
| 154 | 154 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | if ($authService instanceof IdentityV3Service) { |
| 185 | 185 | $token = $authService->generateTokenFromCache($cachedToken); |
| 186 | 186 | if (\is_null($token->catalog)) { |
| 187 | - $this->logger->warning('Invalid cached token for swift, no catalog set: ' . json_encode($cachedToken)); |
|
| 187 | + $this->logger->warning('Invalid cached token for swift, no catalog set: '.json_encode($cachedToken)); |
|
| 188 | 188 | } elseif ($token->hasExpired()) { |
| 189 | 189 | $this->logger->debug('Cached token for swift expired'); |
| 190 | 190 | } else { |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | } catch (ConnectException $e) { |
| 279 | 279 | /** @var RequestInterface $request */ |
| 280 | 280 | $request = $e->getRequest(); |
| 281 | - $host = $request->getUri()->getHost() . ':' . $request->getUri()->getPort(); |
|
| 281 | + $host = $request->getUri()->getHost().':'.$request->getUri()->getPort(); |
|
| 282 | 282 | $this->logger->error("Can't connect to object storage server at $host", ['exception' => $e]); |
| 283 | 283 | throw new StorageNotAvailableException("Can't connect to object storage server at $host", StorageNotAvailableException::STATUS_ERROR, $e); |
| 284 | 284 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | return; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $folders = array_filter($folders, function (ISimpleFolder $folder) { |
|
| 77 | + $folders = array_filter($folders, function(ISimpleFolder $folder) { |
|
| 78 | 78 | return $folder->fileExists('photo.'); |
| 79 | 79 | }); |
| 80 | 80 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $output->info('Delete ' . count($folders) . ' "photo." files'); |
|
| 85 | + $output->info('Delete '.count($folders).' "photo." files'); |
|
| 86 | 86 | |
| 87 | 87 | foreach ($folders as $folder) { |
| 88 | 88 | try { |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $folder->getFile('photo.')->delete(); |
| 91 | 91 | } catch (\Exception $e) { |
| 92 | 92 | $this->logger->error($e->getMessage(), ['exception' => $e]); |
| 93 | - $output->warning('Could not delete file "dav-photocache/' . $folder->getName() . '/photo."'); |
|
| 93 | + $output->warning('Could not delete file "dav-photocache/'.$folder->getName().'/photo."'); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | |
| 84 | 84 | if ($row) { |
| 85 | 85 | $this->cache[$storageId] = $row; |
| 86 | - $this->numericIdCache[(int)$row['numeric_id']] = $row; |
|
| 86 | + $this->numericIdCache[(int) $row['numeric_id']] = $row; |
|
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | return $this->cache[$storageId] ?? null; |
@@ -65,12 +65,12 @@ |
||
| 65 | 65 | $node = $this->server->tree->getNodeForPath($path); |
| 66 | 66 | if ($node instanceof File) { |
| 67 | 67 | $type = strtolower( |
| 68 | - (string)$request->getHeader('X-Recalculate-Hash') |
|
| 68 | + (string) $request->getHeader('X-Recalculate-Hash') |
|
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | 71 | $hash = $node->hash($type); |
| 72 | 72 | if ($hash) { |
| 73 | - $checksum = strtoupper($type) . ':' . $hash; |
|
| 73 | + $checksum = strtoupper($type).':'.$hash; |
|
| 74 | 74 | $node->setChecksum($checksum); |
| 75 | 75 | $response->addHeader('OC-Checksum', $checksum); |
| 76 | 76 | $response->setHeader('Content-Length', '0'); |
@@ -58,18 +58,18 @@ |
||
| 58 | 58 | protected function execute(InputInterface $input, OutputInterface $output): int { |
| 59 | 59 | $gid = $input->getArgument('groupid'); |
| 60 | 60 | if ($gid === 'admin') { |
| 61 | - $output->writeln('<error>Group "' . $gid . '" could not be deleted.</error>'); |
|
| 61 | + $output->writeln('<error>Group "'.$gid.'" could not be deleted.</error>'); |
|
| 62 | 62 | return 1; |
| 63 | 63 | } |
| 64 | 64 | if (!$this->groupManager->groupExists($gid)) { |
| 65 | - $output->writeln('<error>Group "' . $gid . '" does not exist.</error>'); |
|
| 65 | + $output->writeln('<error>Group "'.$gid.'" does not exist.</error>'); |
|
| 66 | 66 | return 1; |
| 67 | 67 | } |
| 68 | 68 | $group = $this->groupManager->get($gid); |
| 69 | 69 | if ($group->delete()) { |
| 70 | - $output->writeln('Group "' . $gid . '" was removed'); |
|
| 70 | + $output->writeln('Group "'.$gid.'" was removed'); |
|
| 71 | 71 | } else { |
| 72 | - $output->writeln('<error>Group "' . $gid . '" could not be deleted. Please check the logs.</error>'); |
|
| 72 | + $output->writeln('<error>Group "'.$gid.'" could not be deleted. Please check the logs.</error>'); |
|
| 73 | 73 | return 1; |
| 74 | 74 | } |
| 75 | 75 | return 0; |
@@ -94,6 +94,6 @@ |
||
| 94 | 94 | if ($this->type === ILock::TYPE_TOKEN) { |
| 95 | 95 | $typeString = 'ILock::TYPE_TOKEN'; |
| 96 | 96 | } |
| 97 | - return "$typeString $this->owner " . $this->getNode()->getId(); |
|
| 97 | + return "$typeString $this->owner ".$this->getNode()->getId(); |
|
| 98 | 98 | } |
| 99 | 99 | } |