@@ -41,15 +41,15 @@ |
||
41 | 41 | public function getCalendarHomeForPrincipal($principalUrl) { |
42 | 42 | if (strrpos($principalUrl, 'principals/users', -strlen($principalUrl)) !== false) { |
43 | 43 | [, $principalId] = \Sabre\Uri\split($principalUrl); |
44 | - return self::CALENDAR_ROOT . '/' . $principalId; |
|
44 | + return self::CALENDAR_ROOT.'/'.$principalId; |
|
45 | 45 | } |
46 | 46 | if (strrpos($principalUrl, 'principals/calendar-resources', -strlen($principalUrl)) !== false) { |
47 | 47 | [, $principalId] = \Sabre\Uri\split($principalUrl); |
48 | - return self::SYSTEM_CALENDAR_ROOT . '/calendar-resources/' . $principalId; |
|
48 | + return self::SYSTEM_CALENDAR_ROOT.'/calendar-resources/'.$principalId; |
|
49 | 49 | } |
50 | 50 | if (strrpos($principalUrl, 'principals/calendar-rooms', -strlen($principalUrl)) !== false) { |
51 | 51 | [, $principalId] = \Sabre\Uri\split($principalUrl); |
52 | - return self::SYSTEM_CALENDAR_ROOT . '/calendar-rooms/' . $principalId; |
|
52 | + return self::SYSTEM_CALENDAR_ROOT.'/calendar-rooms/'.$principalId; |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | $server->on('report', [$this, 'report']); |
84 | 84 | |
85 | - $server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] = |
|
85 | + $server->xml->elementMap['{'.self::NS_Nextcloud.'}calendar-search'] = |
|
86 | 86 | CalendarSearchReport::class; |
87 | 87 | } |
88 | 88 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function report($reportName, $report, $path) { |
98 | 98 | switch ($reportName) { |
99 | - case '{' . self::NS_Nextcloud . '}calendar-search': |
|
99 | + case '{'.self::NS_Nextcloud.'}calendar-search': |
|
100 | 100 | $this->server->transactionType = 'report-nc-calendar-search'; |
101 | 101 | $this->calendarSearch($report); |
102 | 102 | return false; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | $reports = []; |
120 | 120 | if ($node instanceof CalendarHome) { |
121 | - $reports[] = '{' . self::NS_Nextcloud . '}calendar-search'; |
|
121 | + $reports[] = '{'.self::NS_Nextcloud.'}calendar-search'; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | return $reports; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | foreach ($nodePaths as $path) { |
149 | 149 | [$properties] = $this->server->getPropertiesForPath( |
150 | - $this->server->getRequestUri() . '/' . $path, |
|
150 | + $this->server->getRequestUri().'/'.$path, |
|
151 | 151 | $report->properties); |
152 | 152 | $result[] = $properties; |
153 | 153 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | try { |
66 | 66 | $this->activityManager->publish($activity); |
67 | 67 | } catch (BadMethodCallException $e) { |
68 | - $this->logger->warning('Could not publish activity: ' . $e->getMessage(), [ |
|
68 | + $this->logger->warning('Could not publish activity: '.$e->getMessage(), [ |
|
69 | 69 | 'exception' => $e |
70 | 70 | ]); |
71 | 71 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $stmt->closeCursor(); |
141 | 141 | |
142 | 142 | foreach ($result as $row) { |
143 | - if ((int)$row['count'] > 1) { |
|
143 | + if ((int) $row['count'] > 1) { |
|
144 | 144 | $this->removeApplicable($row['mount_id'], $applicableType, $applicableId); |
145 | 145 | } else { |
146 | 146 | $this->removeMount($row['mount_id']); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | public function getAdminMountsForMultiple($type, array $values) { |
216 | 216 | $builder = $this->connection->getQueryBuilder(); |
217 | - $params = array_map(function ($value) use ($builder) { |
|
217 | + $params = array_map(function($value) use ($builder) { |
|
218 | 218 | return $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR); |
219 | 219 | }, $values); |
220 | 220 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | } |
413 | 413 | $uniqueMounts = array_values($uniqueMounts); |
414 | 414 | |
415 | - $mountIds = array_map(function ($mount) { |
|
415 | + $mountIds = array_map(function($mount) { |
|
416 | 416 | return $mount['mount_id']; |
417 | 417 | }, $uniqueMounts); |
418 | 418 | $mountIds = array_values(array_unique($mountIds)); |
@@ -421,9 +421,9 @@ discard block |
||
421 | 421 | $config = $this->getConfigForMounts($mountIds); |
422 | 422 | $options = $this->getOptionsForMounts($mountIds); |
423 | 423 | |
424 | - return array_map(function ($mount, $applicable, $config, $options) { |
|
425 | - $mount['type'] = (int)$mount['type']; |
|
426 | - $mount['priority'] = (int)$mount['priority']; |
|
424 | + return array_map(function($mount, $applicable, $config, $options) { |
|
425 | + $mount['type'] = (int) $mount['type']; |
|
426 | + $mount['priority'] = (int) $mount['priority']; |
|
427 | 427 | $mount['applicable'] = $applicable; |
428 | 428 | $mount['config'] = $config; |
429 | 429 | $mount['options'] = $options; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | } |
446 | 446 | $builder = $this->connection->getQueryBuilder(); |
447 | 447 | $fields[] = 'mount_id'; |
448 | - $placeHolders = array_map(function ($id) use ($builder) { |
|
448 | + $placeHolders = array_map(function($id) use ($builder) { |
|
449 | 449 | return $builder->createPositionalParameter($id, IQueryBuilder::PARAM_INT); |
450 | 450 | }, $mountIds); |
451 | 451 | $query = $builder->select($fields) |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | } |
463 | 463 | foreach ($rows as $row) { |
464 | 464 | if (isset($row['type'])) { |
465 | - $row['type'] = (int)$row['type']; |
|
465 | + $row['type'] = (int) $row['type']; |
|
466 | 466 | } |
467 | 467 | $result[$row['mount_id']][] = $row; |
468 | 468 | } |
@@ -493,8 +493,8 @@ discard block |
||
493 | 493 | public function getOptionsForMounts($mountIds) { |
494 | 494 | $mountOptions = $this->selectForMounts('external_options', ['key', 'value'], $mountIds); |
495 | 495 | $optionsMap = array_map([$this, 'createKeyValueMap'], $mountOptions); |
496 | - return array_map(function (array $options) { |
|
497 | - return array_map(function ($option) { |
|
496 | + return array_map(function(array $options) { |
|
497 | + return array_map(function($option) { |
|
498 | 498 | return json_decode($option); |
499 | 499 | }, $options); |
500 | 500 | }, $optionsMap); |
@@ -505,16 +505,16 @@ discard block |
||
505 | 505 | * @return array ['key1' => $value1, ...] |
506 | 506 | */ |
507 | 507 | private function createKeyValueMap(array $keyValuePairs) { |
508 | - $decryptedPairts = array_map(function ($pair) { |
|
508 | + $decryptedPairts = array_map(function($pair) { |
|
509 | 509 | if ($pair['key'] === 'password') { |
510 | 510 | $pair['value'] = $this->decryptValue($pair['value']); |
511 | 511 | } |
512 | 512 | return $pair; |
513 | 513 | }, $keyValuePairs); |
514 | - $keys = array_map(function ($pair) { |
|
514 | + $keys = array_map(function($pair) { |
|
515 | 515 | return $pair['key']; |
516 | 516 | }, $decryptedPairts); |
517 | - $values = array_map(function ($pair) { |
|
517 | + $values = array_map(function($pair) { |
|
518 | 518 | return $pair['value']; |
519 | 519 | }, $decryptedPairts); |
520 | 520 |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } catch (GenericEncryptionException $e) { |
105 | 105 | // in case of a encryption exception we delete the file right away |
106 | 106 | $this->logger->info( |
107 | - "Can't move file " . $path . |
|
107 | + "Can't move file ".$path. |
|
108 | 108 | " to the trash bin, therefore it was deleted right away"); |
109 | 109 | |
110 | 110 | return $this->storage->unlink($path); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @return bool |
138 | 138 | */ |
139 | 139 | protected function shouldMoveToTrash($path) { |
140 | - $normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path); |
|
140 | + $normalized = Filesystem::normalizePath($this->mountPoint.'/'.$path); |
|
141 | 141 | $parts = explode('/', $normalized); |
142 | 142 | if (count($parts) < 4 || strpos($normalized, '/appdata_') === 0) { |
143 | 143 | return false; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * Setup the storate wrapper callback |
213 | 213 | */ |
214 | 214 | public static function setupStorage() { |
215 | - \OC\Files\Filesystem::addStorageWrapper('oc_trashbin', function ($mountPoint, $storage) { |
|
215 | + \OC\Files\Filesystem::addStorageWrapper('oc_trashbin', function($mountPoint, $storage) { |
|
216 | 216 | return new \OCA\Files_Trashbin\Storage( |
217 | 217 | ['storage' => $storage, 'mountPoint' => $mountPoint], |
218 | 218 | \OC::$server->query(ITrashManager::class), |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @inheritdoc |
29 | 29 | */ |
30 | 30 | public function like($x, $y, $type = null): string { |
31 | - return parent::like($x, $y, $type) . " ESCAPE '\\'"; |
|
31 | + return parent::like($x, $y, $type)." ESCAPE '\\'"; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function iLike($x, $y, $type = null): string { |
@@ -40,9 +40,9 @@ |
||
40 | 40 | public function castColumn($column, $type): IQueryFunction { |
41 | 41 | switch ($type) { |
42 | 42 | case IQueryBuilder::PARAM_INT: |
43 | - return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS INT)'); |
|
43 | + return new QueryFunction('CAST('.$this->helper->quoteColumnName($column).' AS INT)'); |
|
44 | 44 | case IQueryBuilder::PARAM_STR: |
45 | - return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS TEXT)'); |
|
45 | + return new QueryFunction('CAST('.$this->helper->quoteColumnName($column).' AS TEXT)'); |
|
46 | 46 | default: |
47 | 47 | return parent::castColumn($column, $type); |
48 | 48 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @return string |
188 | 188 | */ |
189 | 189 | public function getId(): string { |
190 | - return 'shared::' . $this->getMountPoint(); |
|
190 | + return 'shared::'.$this->getMountPoint(); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | public function isCreatable($path): bool { |
218 | - return (bool)($this->getPermissions($path) & \OCP\Constants::PERMISSION_CREATE); |
|
218 | + return (bool) ($this->getPermissions($path) & \OCP\Constants::PERMISSION_CREATE); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | public function isReadable($path): bool { |
@@ -232,18 +232,18 @@ discard block |
||
232 | 232 | } |
233 | 233 | |
234 | 234 | public function isUpdatable($path): bool { |
235 | - return (bool)($this->getPermissions($path) & \OCP\Constants::PERMISSION_UPDATE); |
|
235 | + return (bool) ($this->getPermissions($path) & \OCP\Constants::PERMISSION_UPDATE); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | public function isDeletable($path): bool { |
239 | - return (bool)($this->getPermissions($path) & \OCP\Constants::PERMISSION_DELETE); |
|
239 | + return (bool) ($this->getPermissions($path) & \OCP\Constants::PERMISSION_DELETE); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | public function isSharable($path): bool { |
243 | 243 | if (\OCP\Util::isSharingDisabledForUser() || !\OC\Share\Share::isResharingAllowed()) { |
244 | 244 | return false; |
245 | 245 | } |
246 | - return (bool)($this->getPermissions($path) & \OCP\Constants::PERMISSION_SHARE); |
|
246 | + return (bool) ($this->getPermissions($path) & \OCP\Constants::PERMISSION_SHARE); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | public function fopen($path, $mode) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | } |
291 | 291 | } |
292 | 292 | $info = [ |
293 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
293 | + 'target' => $this->getMountPoint().'/'.$path, |
|
294 | 294 | 'source' => $source, |
295 | 295 | 'mode' => $mode, |
296 | 296 | ]; |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | |
493 | 493 | public function file_get_contents($path) { |
494 | 494 | $info = [ |
495 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
495 | + 'target' => $this->getMountPoint().'/'.$path, |
|
496 | 496 | 'source' => $this->getUnjailedPath($path), |
497 | 497 | ]; |
498 | 498 | \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_get_contents', $info); |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | |
502 | 502 | public function file_put_contents($path, $data) { |
503 | 503 | $info = [ |
504 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
504 | + 'target' => $this->getMountPoint().'/'.$path, |
|
505 | 505 | 'source' => $this->getUnjailedPath($path), |
506 | 506 | ]; |
507 | 507 | \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_put_contents', $info); |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | protected function execute(InputInterface $input, OutputInterface $output): int { |
77 | - $groups = $this->groupManager->search('', (int)$input->getOption('limit'), (int)$input->getOption('offset')); |
|
78 | - $this->writeArrayInOutputFormat($input, $output, $this->formatGroups($groups, (bool)$input->getOption('info'))); |
|
77 | + $groups = $this->groupManager->search('', (int) $input->getOption('limit'), (int) $input->getOption('offset')); |
|
78 | + $this->writeArrayInOutputFormat($input, $output, $this->formatGroups($groups, (bool) $input->getOption('info'))); |
|
79 | 79 | return 0; |
80 | 80 | } |
81 | 81 | |
@@ -84,19 +84,19 @@ discard block |
||
84 | 84 | * @return array |
85 | 85 | */ |
86 | 86 | private function formatGroups(array $groups, bool $addInfo = false) { |
87 | - $keys = array_map(function (IGroup $group) { |
|
87 | + $keys = array_map(function(IGroup $group) { |
|
88 | 88 | return $group->getGID(); |
89 | 89 | }, $groups); |
90 | 90 | |
91 | 91 | if ($addInfo) { |
92 | - $values = array_map(function (IGroup $group) { |
|
92 | + $values = array_map(function(IGroup $group) { |
|
93 | 93 | return [ |
94 | 94 | 'backends' => $group->getBackendNames(), |
95 | 95 | 'users' => array_keys($group->getUsers()), |
96 | 96 | ]; |
97 | 97 | }, $groups); |
98 | 98 | } else { |
99 | - $values = array_map(function (IGroup $group) { |
|
99 | + $values = array_map(function(IGroup $group) { |
|
100 | 100 | return array_keys($group->getUsers()); |
101 | 101 | }, $groups); |
102 | 102 | } |