@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | private function getAltitude(float $lat, float $lon): float { |
227 | 227 | $params = [ |
228 | - 'locations' => $lat . ',' . $lon, |
|
228 | + 'locations' => $lat.','.$lon, |
|
229 | 229 | ]; |
230 | 230 | $url = 'https://api.opentopodata.org/v1/srtm30m'; |
231 | 231 | $result = $this->requestJSON($url, $params); |
@@ -258,11 +258,11 @@ discard block |
||
258 | 258 | } |
259 | 259 | // post code |
260 | 260 | if (isset($jsonAddr['postcode'])) { |
261 | - $cityAddress .= ', ' . $jsonAddr['postcode']; |
|
261 | + $cityAddress .= ', '.$jsonAddr['postcode']; |
|
262 | 262 | } |
263 | 263 | // country |
264 | 264 | if (isset($jsonAddr['country'])) { |
265 | - $cityAddress .= ', ' . $jsonAddr['country']; |
|
265 | + $cityAddress .= ', '.$jsonAddr['country']; |
|
266 | 266 | return $cityAddress; |
267 | 267 | } else { |
268 | 268 | return $json['display_name']; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | 'namedetails' => '1', |
316 | 316 | 'limit' => '1', |
317 | 317 | ]; |
318 | - $url = 'https://nominatim.openstreetmap.org/search/' . $address; |
|
318 | + $url = 'https://nominatim.openstreetmap.org/search/'.$address; |
|
319 | 319 | $results = $this->requestJSON($url, $params); |
320 | 320 | if (count($results) > 0) { |
321 | 321 | return $results[0]; |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | * @return array which contains the error message or the parsed JSON result |
393 | 393 | */ |
394 | 394 | private function requestJSON(string $url, array $params = []): array { |
395 | - $cacheKey = $url . '|' . implode(',', $params) . '|' . implode(',', array_keys($params)); |
|
395 | + $cacheKey = $url.'|'.implode(',', $params).'|'.implode(',', array_keys($params)); |
|
396 | 396 | $cacheValue = $this->cache->get($cacheKey); |
397 | 397 | if ($cacheValue !== null) { |
398 | 398 | return $cacheValue; |
@@ -401,14 +401,14 @@ discard block |
||
401 | 401 | try { |
402 | 402 | $options = [ |
403 | 403 | 'headers' => [ |
404 | - 'User-Agent' => 'NextcloudWeatherStatus/' . $this->version . ' nextcloud.com' |
|
404 | + 'User-Agent' => 'NextcloudWeatherStatus/'.$this->version.' nextcloud.com' |
|
405 | 405 | ], |
406 | 406 | ]; |
407 | 407 | |
408 | 408 | $reqUrl = $url; |
409 | 409 | if (count($params) > 0) { |
410 | 410 | $paramsContent = http_build_query($params); |
411 | - $reqUrl = $url . '?' . $paramsContent; |
|
411 | + $reqUrl = $url.'?'.$paramsContent; |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | $response = $this->client->get($reqUrl, $options); |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | return $json; |
438 | 438 | } |
439 | 439 | } catch (\Exception $e) { |
440 | - $this->logger->warning($url . 'API error : ' . $e, ['app' => Application::APP_ID]); |
|
440 | + $this->logger->warning($url.'API error : '.$e, ['app' => Application::APP_ID]); |
|
441 | 441 | return ['error' => $e->getMessage()]; |
442 | 442 | } |
443 | 443 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if ($this->lastLogin === null) { |
193 | 193 | $this->fetchDetails(); |
194 | 194 | } |
195 | - return (int)$this->lastLogin; |
|
195 | + return (int) $this->lastLogin; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | if ($this->foundDeleted === null) { |
204 | 204 | $this->fetchDetails(); |
205 | 205 | } |
206 | - return (int)$this->foundDeleted; |
|
206 | + return (int) $this->foundDeleted; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -104,24 +104,24 @@ discard block |
||
104 | 104 | * Remove "apps/" from inclusion path for smooth migration to multi app dir |
105 | 105 | */ |
106 | 106 | if (strpos(\OC::$CLASSPATH[$class], 'apps/') === 0) { |
107 | - \OCP\Util::writeLog('core', 'include path for class "' . $class . '" starts with "apps/"', ILogger::DEBUG); |
|
107 | + \OCP\Util::writeLog('core', 'include path for class "'.$class.'" starts with "apps/"', ILogger::DEBUG); |
|
108 | 108 | $paths[] = str_replace('apps/', '', \OC::$CLASSPATH[$class]); |
109 | 109 | } |
110 | 110 | } elseif (strpos($class, 'OC_') === 0) { |
111 | - $paths[] = \OC::$SERVERROOT . '/lib/private/legacy/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php'); |
|
111 | + $paths[] = \OC::$SERVERROOT.'/lib/private/legacy/'.strtolower(str_replace('_', '/', substr($class, 3)).'.php'); |
|
112 | 112 | } elseif (strpos($class, 'OCA\\') === 0) { |
113 | 113 | [, $app, $rest] = explode('\\', $class, 3); |
114 | 114 | $app = strtolower($app); |
115 | 115 | $appPath = \OC_App::getAppPath($app); |
116 | 116 | if ($appPath && stream_resolve_include_path($appPath)) { |
117 | - $paths[] = $appPath . '/' . strtolower(str_replace('\\', '/', $rest) . '.php'); |
|
117 | + $paths[] = $appPath.'/'.strtolower(str_replace('\\', '/', $rest).'.php'); |
|
118 | 118 | // If not found in the root of the app directory, insert '/lib' after app id and try again. |
119 | - $paths[] = $appPath . '/lib/' . strtolower(str_replace('\\', '/', $rest) . '.php'); |
|
119 | + $paths[] = $appPath.'/lib/'.strtolower(str_replace('\\', '/', $rest).'.php'); |
|
120 | 120 | } |
121 | 121 | } elseif ($class === 'Test\\TestCase') { |
122 | 122 | // This File is considered public API, so we make sure that the class |
123 | 123 | // can still be loaded, although the PSR-4 paths have not been loaded. |
124 | - $paths[] = \OC::$SERVERROOT . '/tests/lib/TestCase.php'; |
|
124 | + $paths[] = \OC::$SERVERROOT.'/tests/lib/TestCase.php'; |
|
125 | 125 | } |
126 | 126 | return $paths; |
127 | 127 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function isValidPath(string $fullPath): bool { |
135 | 135 | foreach ($this->validRoots as $root => $true) { |
136 | - if (substr($fullPath, 0, strlen($root) + 1) === $root . '/') { |
|
136 | + if (substr($fullPath, 0, strlen($root) + 1) === $root.'/') { |
|
137 | 137 | return true; |
138 | 138 | } |
139 | 139 | } |
@@ -61,7 +61,7 @@ |
||
61 | 61 | if ($this->enabled && $this->cloudIdManager->isValidCloudId($search) && $offset === 0) { |
62 | 62 | [$remoteGroup, $serverUrl] = $this->splitGroupRemote($search); |
63 | 63 | $result['exact'][] = [ |
64 | - 'label' => $remoteGroup . " ($serverUrl)", |
|
64 | + 'label' => $remoteGroup." ($serverUrl)", |
|
65 | 65 | 'guid' => $remoteGroup, |
66 | 66 | 'name' => $remoteGroup, |
67 | 67 | 'value' => [ |
@@ -71,12 +71,12 @@ |
||
71 | 71 | [$alias, $columnName] = explode('.', $string, 2); |
72 | 72 | |
73 | 73 | if ($columnName === '*') { |
74 | - return '`' . $alias . '`.*'; |
|
74 | + return '`'.$alias.'`.*'; |
|
75 | 75 | } |
76 | 76 | |
77 | - return '`' . $alias . '`.`' . $columnName . '`'; |
|
77 | + return '`'.$alias.'`.`'.$columnName.'`'; |
|
78 | 78 | } |
79 | 79 | |
80 | - return '`' . $string . '`'; |
|
80 | + return '`'.$string.'`'; |
|
81 | 81 | } |
82 | 82 | } |
@@ -319,7 +319,7 @@ |
||
319 | 319 | if ($tagData === null) { |
320 | 320 | [$name, $status] = explode('|||', substr($parameter, 3, -3)); |
321 | 321 | $tagData = [ |
322 | - 'id' => 0,// No way to recover the ID |
|
322 | + 'id' => 0, // No way to recover the ID |
|
323 | 323 | 'name' => $name, |
324 | 324 | 'assignable' => $status === 'assignable', |
325 | 325 | 'visible' => $status !== 'invisible', |
@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | protected function getAddressbookHomeForPrincipal($principal) { |
46 | 46 | if (strrpos($principal, 'principals/users', -strlen($principal)) !== false) { |
47 | 47 | [, $principalId] = \Sabre\Uri\split($principal); |
48 | - return self::ADDRESSBOOK_ROOT . '/users/' . $principalId; |
|
48 | + return self::ADDRESSBOOK_ROOT.'/users/'.$principalId; |
|
49 | 49 | } |
50 | 50 | if (strrpos($principal, 'principals/groups', -strlen($principal)) !== false) { |
51 | 51 | [, $principalId] = \Sabre\Uri\split($principal); |
52 | - return self::ADDRESSBOOK_ROOT . '/groups/' . $principalId; |
|
52 | + return self::ADDRESSBOOK_ROOT.'/groups/'.$principalId; |
|
53 | 53 | } |
54 | 54 | if (strrpos($principal, 'principals/system', -strlen($principal)) !== false) { |
55 | 55 | [, $principalId] = \Sabre\Uri\split($principal); |
56 | - return self::ADDRESSBOOK_ROOT . '/system/' . $principalId; |
|
56 | + return self::ADDRESSBOOK_ROOT.'/system/'.$principalId; |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $ns = '{http://owncloud.org/ns}'; |
69 | 69 | |
70 | 70 | if ($node instanceof AddressBook) { |
71 | - $propFind->handle($ns . 'groups', function () use ($node) { |
|
71 | + $propFind->handle($ns.'groups', function() use ($node) { |
|
72 | 72 | return new Groups($node->getContactsGroups()); |
73 | 73 | }); |
74 | 74 | } |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | $proxies = $this->proxyMapper->getProxiesFor($principal); |
93 | 93 | foreach ($proxies as $proxy) { |
94 | 94 | if ($proxy->getPermissions() === ProxyMapper::PERMISSION_READ) { |
95 | - $groups[] = $proxy->getOwnerId() . '/calendar-proxy-read'; |
|
95 | + $groups[] = $proxy->getOwnerId().'/calendar-proxy-read'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | if ($proxy->getPermissions() === (ProxyMapper::PERMISSION_READ | ProxyMapper::PERMISSION_WRITE)) { |
99 | - $groups[] = $proxy->getOwnerId() . '/calendar-proxy-write'; |
|
99 | + $groups[] = $proxy->getOwnerId().'/calendar-proxy-write'; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | [$prefix, $name] = \Sabre\Uri\split($member); |
137 | 137 | |
138 | 138 | if ($prefix !== $this->principalPrefix) { |
139 | - throw new Exception('Invalid member group prefix: ' . $prefix); |
|
139 | + throw new Exception('Invalid member group prefix: '.$prefix); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | $principalArray = $this->getPrincipalByPath($member); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $proxy->setPermissions($proxy->getPermissions() | $permission); |
152 | 152 | $this->proxyMapper->update($proxy); |
153 | 153 | |
154 | - $proxies = array_filter($proxies, function (Proxy $p) use ($proxy) { |
|
154 | + $proxies = array_filter($proxies, function(Proxy $p) use ($proxy) { |
|
155 | 155 | return $p->getId() !== $proxy->getId(); |
156 | 156 | }); |
157 | 157 | break; |
@@ -224,9 +224,9 @@ discard block |
||
224 | 224 | )) { |
225 | 225 | // note: pre-fetching only supported for depth <= 1 |
226 | 226 | $folderContent = $node->getChildren(); |
227 | - $fileIds[] = (int)$node->getId(); |
|
227 | + $fileIds[] = (int) $node->getId(); |
|
228 | 228 | foreach ($folderContent as $info) { |
229 | - $fileIds[] = (int)$info->getId(); |
|
229 | + $fileIds[] = (int) $info->getId(); |
|
230 | 230 | } |
231 | 231 | $tags = $this->getTagger()->getTagsForObjects($fileIds); |
232 | 232 | if ($tags === false) { |
@@ -244,12 +244,12 @@ discard block |
||
244 | 244 | |
245 | 245 | $isFav = null; |
246 | 246 | |
247 | - $propFind->handle(self::TAGS_PROPERTYNAME, function () use (&$isFav, $node) { |
|
247 | + $propFind->handle(self::TAGS_PROPERTYNAME, function() use (&$isFav, $node) { |
|
248 | 248 | [$tags, $isFav] = $this->getTagsAndFav($node->getId()); |
249 | 249 | return new TagList($tags); |
250 | 250 | }); |
251 | 251 | |
252 | - $propFind->handle(self::FAVORITE_PROPERTYNAME, function () use ($isFav, $node) { |
|
252 | + $propFind->handle(self::FAVORITE_PROPERTYNAME, function() use ($isFav, $node) { |
|
253 | 253 | if (is_null($isFav)) { |
254 | 254 | [, $isFav] = $this->getTagsAndFav($node->getId()); |
255 | 255 | } |
@@ -275,13 +275,13 @@ discard block |
||
275 | 275 | return; |
276 | 276 | } |
277 | 277 | |
278 | - $propPatch->handle(self::TAGS_PROPERTYNAME, function ($tagList) use ($node) { |
|
278 | + $propPatch->handle(self::TAGS_PROPERTYNAME, function($tagList) use ($node) { |
|
279 | 279 | $this->updateTags($node->getId(), $tagList->getTags()); |
280 | 280 | return true; |
281 | 281 | }); |
282 | 282 | |
283 | - $propPatch->handle(self::FAVORITE_PROPERTYNAME, function ($favState) use ($node) { |
|
284 | - if ((int)$favState === 1 || $favState === 'true') { |
|
283 | + $propPatch->handle(self::FAVORITE_PROPERTYNAME, function($favState) use ($node) { |
|
284 | + if ((int) $favState === 1 || $favState === 'true') { |
|
285 | 285 | $this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE); |
286 | 286 | } else { |
287 | 287 | $this->getTagger()->unTag($node->getId(), self::TAG_FAVORITE); |