@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | return -1; |
75 | 75 | } |
76 | 76 | if ($user) { |
77 | - $this->config->setUserValue($user, 'files_trashbin', 'trashbin_size', (string)$parsedSize); |
|
77 | + $this->config->setUserValue($user, 'files_trashbin', 'trashbin_size', (string) $parsedSize); |
|
78 | 78 | $this->commandBus->push(new Expire($user)); |
79 | 79 | } else { |
80 | - $this->config->setAppValue('files_trashbin', 'trashbin_size', (string)$parsedSize); |
|
80 | + $this->config->setAppValue('files_trashbin', 'trashbin_size', (string) $parsedSize); |
|
81 | 81 | $output->writeln("<info>Warning: changing the default trashbin size will automatically trigger cleanup of existing trashbins,</info>"); |
82 | 82 | $output->writeln("<info>a users trashbin can exceed the configured size until they move a new file to the trashbin.</info>"); |
83 | 83 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | private function printTrashbinSize(InputInterface $input, OutputInterface $output, ?string $user) { |
92 | - $globalSize = (int)$this->config->getAppValue('files_trashbin', 'trashbin_size', '-1'); |
|
92 | + $globalSize = (int) $this->config->getAppValue('files_trashbin', 'trashbin_size', '-1'); |
|
93 | 93 | if ($globalSize < 0) { |
94 | 94 | $globalHumanSize = "default (50% of available space)"; |
95 | 95 | } else { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | if ($user) { |
100 | - $userSize = (int)$this->config->getUserValue($user, 'files_trashbin', 'trashbin_size', '-1'); |
|
100 | + $userSize = (int) $this->config->getUserValue($user, 'files_trashbin', 'trashbin_size', '-1'); |
|
101 | 101 | |
102 | 102 | if ($userSize < 0) { |
103 | 103 | $userHumanSize = ($globalSize < 0) ? $globalHumanSize : "default($globalHumanSize)"; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | } else { |
120 | 120 | $users = []; |
121 | - $this->userManager->callForSeenUsers(function (IUser $user) use (&$users) { |
|
121 | + $this->userManager->callForSeenUsers(function(IUser $user) use (&$users) { |
|
122 | 122 | $users[] = $user->getUID(); |
123 | 123 | }); |
124 | 124 | $userValues = $this->config->getUserValueForUsers('files_trashbin', 'trashbin_size', $users); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $output->writeln(""); |
129 | 129 | if (count($userValues)) { |
130 | 130 | $output->writeln("Per-user sizes:"); |
131 | - $this->writeArrayInOutputFormat($input, $output, array_map(function ($size) { |
|
131 | + $this->writeArrayInOutputFormat($input, $output, array_map(function($size) { |
|
132 | 132 | return \OC_Helper::humanFileSize($size); |
133 | 133 | }, $userValues)); |
134 | 134 | } else { |
@@ -6,5 +6,5 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\UserStatus\\' => array($baseDir . '/../lib'), |
|
9 | + 'OCA\\UserStatus\\' => array($baseDir.'/../lib'), |
|
10 | 10 | ); |
@@ -370,18 +370,18 @@ discard block |
||
370 | 370 | private function findFileWithExtension($class, $ext) |
371 | 371 | { |
372 | 372 | // PSR-4 lookup |
373 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
373 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
374 | 374 | |
375 | 375 | $first = $class[0]; |
376 | 376 | if (isset($this->prefixLengthsPsr4[$first])) { |
377 | 377 | $subPath = $class; |
378 | 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
379 | 379 | $subPath = substr($subPath, 0, $lastPos); |
380 | - $search = $subPath . '\\'; |
|
380 | + $search = $subPath.'\\'; |
|
381 | 381 | if (isset($this->prefixDirsPsr4[$search])) { |
382 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
382 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
383 | 383 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
384 | - if (file_exists($file = $dir . $pathEnd)) { |
|
384 | + if (file_exists($file = $dir.$pathEnd)) { |
|
385 | 385 | return $file; |
386 | 386 | } |
387 | 387 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | // PSR-4 fallback dirs |
393 | 393 | foreach ($this->fallbackDirsPsr4 as $dir) { |
394 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
394 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
395 | 395 | return $file; |
396 | 396 | } |
397 | 397 | } |
@@ -403,14 +403,14 @@ discard block |
||
403 | 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
404 | 404 | } else { |
405 | 405 | // PEAR-like class name |
406 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
406 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if (isset($this->prefixesPsr0[$first])) { |
410 | 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
411 | 411 | if (0 === strpos($class, $prefix)) { |
412 | 412 | foreach ($dirs as $dir) { |
413 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
413 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
414 | 414 | return $file; |
415 | 415 | } |
416 | 416 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | // PSR-0 fallback dirs |
422 | 422 | foreach ($this->fallbackDirsPsr0 as $dir) { |
423 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
423 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
424 | 424 | return $file; |
425 | 425 | } |
426 | 426 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | return SearchResult::complete($this->getName(), []); |
96 | 96 | } |
97 | 97 | |
98 | - $principalUri = 'principals/users/' . $user->getUID(); |
|
98 | + $principalUri = 'principals/users/'.$user->getUID(); |
|
99 | 99 | $calendarsById = $this->getSortedCalendars($principalUri); |
100 | 100 | $subscriptionsById = $this->getSortedSubscriptions($principalUri); |
101 | 101 | |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | 'offset' => $query->getCursor(), |
111 | 111 | ] |
112 | 112 | ); |
113 | - $formattedResults = \array_map(function (array $eventRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { |
|
113 | + $formattedResults = \array_map(function(array $eventRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { |
|
114 | 114 | $component = $this->getPrimaryComponent($eventRow['calendardata'], self::$componentType); |
115 | - $title = (string)($component->SUMMARY ?? $this->l10n->t('Untitled event')); |
|
115 | + $title = (string) ($component->SUMMARY ?? $this->l10n->t('Untitled event')); |
|
116 | 116 | $subline = $this->generateSubline($component); |
117 | 117 | |
118 | 118 | if ($eventRow['calendartype'] === CalDavBackend::CALENDAR_TYPE_CALENDAR) { |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | string $calendarObjectUri): string { |
162 | 162 | [,, $principalId] = explode('/', $principalUri, 3); |
163 | 163 | |
164 | - return $this->urlGenerator->linkTo('', 'remote.php') . '/dav/calendars/' |
|
165 | - . $principalId . '/' |
|
166 | - . $calendarUri . '/' |
|
164 | + return $this->urlGenerator->linkTo('', 'remote.php').'/dav/calendars/' |
|
165 | + . $principalId.'/' |
|
166 | + . $calendarUri.'/' |
|
167 | 167 | . $calendarObjectUri; |
168 | 168 | } |
169 | 169 |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | return SearchResult::complete($this->getName(), []); |
109 | 109 | } |
110 | 110 | |
111 | - $principalUri = 'principals/users/' . $user->getUID(); |
|
111 | + $principalUri = 'principals/users/'.$user->getUID(); |
|
112 | 112 | $addressBooks = $this->backend->getAddressBooksForUser($principalUri); |
113 | 113 | $addressBooksById = []; |
114 | 114 | foreach ($addressBooks as $addressBook) { |
@@ -124,17 +124,17 @@ discard block |
||
124 | 124 | 'offset' => $query->getCursor(), |
125 | 125 | ] |
126 | 126 | ); |
127 | - $formattedResults = \array_map(function (array $contactRow) use ($addressBooksById):SearchResultEntry { |
|
127 | + $formattedResults = \array_map(function(array $contactRow) use ($addressBooksById):SearchResultEntry { |
|
128 | 128 | $addressBook = $addressBooksById[$contactRow['addressbookid']]; |
129 | 129 | |
130 | 130 | /** @var VCard $vCard */ |
131 | 131 | $vCard = Reader::read($contactRow['carddata']); |
132 | 132 | $thumbnailUrl = ''; |
133 | 133 | if ($vCard->PHOTO) { |
134 | - $thumbnailUrl = $this->getDavUrlForContact($addressBook['principaluri'], $addressBook['uri'], $contactRow['uri']) . '?photo'; |
|
134 | + $thumbnailUrl = $this->getDavUrlForContact($addressBook['principaluri'], $addressBook['uri'], $contactRow['uri']).'?photo'; |
|
135 | 135 | } |
136 | 136 | |
137 | - $title = (string)$vCard->FN; |
|
137 | + $title = (string) $vCard->FN; |
|
138 | 138 | $subline = $this->generateSubline($vCard); |
139 | 139 | $resourceUrl = $this->getDeepLinkToContactsApp($addressBook['uri'], (string) $vCard->UID); |
140 | 140 | |
@@ -160,10 +160,10 @@ discard block |
||
160 | 160 | [, $principalType, $principalId] = explode('/', $principalUri, 3); |
161 | 161 | |
162 | 162 | return $this->urlGenerator->getAbsoluteURL( |
163 | - $this->urlGenerator->linkTo('', 'remote.php') . '/dav/addressbooks/' |
|
164 | - . $principalType . '/' |
|
165 | - . $principalId . '/' |
|
166 | - . $addressBookUri . '/' |
|
163 | + $this->urlGenerator->linkTo('', 'remote.php').'/dav/addressbooks/' |
|
164 | + . $principalType.'/' |
|
165 | + . $principalId.'/' |
|
166 | + . $addressBookUri.'/' |
|
167 | 167 | . $contactsUri |
168 | 168 | ); |
169 | 169 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | string $contactUid): string { |
178 | 178 | return $this->urlGenerator->getAbsoluteURL( |
179 | 179 | $this->urlGenerator->linkToRoute('contacts.contacts.direct', [ |
180 | - 'contact' => $contactUid . '~' . $addressBookUri |
|
180 | + 'contact' => $contactUid.'~'.$addressBookUri |
|
181 | 181 | ]) |
182 | 182 | ); |
183 | 183 | } |
@@ -192,6 +192,6 @@ discard block |
||
192 | 192 | return ''; |
193 | 193 | } |
194 | 194 | |
195 | - return (string)$emailAddresses[0]; |
|
195 | + return (string) $emailAddresses[0]; |
|
196 | 196 | } |
197 | 197 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return string|null |
86 | 86 | * @since 20.0.0 |
87 | 87 | */ |
88 | - public function getMessage():?string; |
|
88 | + public function getMessage(): ?string; |
|
89 | 89 | |
90 | 90 | /** |
91 | 91 | * Get a custom icon provided by the user |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @return string|null |
94 | 94 | * @since 20.0.0 |
95 | 95 | */ |
96 | - public function getIcon():?string; |
|
96 | + public function getIcon(): ?string; |
|
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Gets the time that the custom status will be cleared at |
@@ -101,5 +101,5 @@ discard block |
||
101 | 101 | * @return DateTimeImmutable|null |
102 | 102 | * @since 20.0.0 |
103 | 103 | */ |
104 | - public function getClearAt():?DateTimeImmutable; |
|
104 | + public function getClearAt(): ?DateTimeImmutable; |
|
105 | 105 | } |
@@ -285,10 +285,10 @@ discard block |
||
285 | 285 | |
286 | 286 | if ($search !== '') { |
287 | 287 | $query->where($query->expr()->iLike('gid', $query->createNamedParameter( |
288 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
288 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
289 | 289 | ))); |
290 | 290 | $query->orWhere($query->expr()->iLike('displayname', $query->createNamedParameter( |
291 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
291 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
292 | 292 | ))); |
293 | 293 | } |
294 | 294 | |
@@ -363,9 +363,9 @@ discard block |
||
363 | 363 | // sqlite doesn't like re-using a single named parameter here |
364 | 364 | ->andWhere( |
365 | 365 | $query->expr()->orX( |
366 | - $query->expr()->ilike('g.uid', $query->createNamedParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')), |
|
367 | - $query->expr()->ilike('u.displayname', $query->createNamedParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')), |
|
368 | - $query->expr()->ilike('p.configvalue', $query->createNamedParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')) |
|
366 | + $query->expr()->ilike('g.uid', $query->createNamedParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')), |
|
367 | + $query->expr()->ilike('u.displayname', $query->createNamedParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')), |
|
368 | + $query->expr()->ilike('p.configvalue', $query->createNamedParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')) |
|
369 | 369 | ) |
370 | 370 | ) |
371 | 371 | ->orderBy('u.uid_lower', 'ASC'); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | |
406 | 406 | if ($search !== '') { |
407 | 407 | $query->andWhere($query->expr()->like('uid', $query->createNamedParameter( |
408 | - '%' . $this->dbConn->escapeLikeParameter($search) . '%' |
|
408 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
409 | 409 | ))); |
410 | 410 | } |
411 | 411 | |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $result->closeCursor(); |
415 | 415 | |
416 | 416 | if ($count !== false) { |
417 | - $count = (int)$count; |
|
417 | + $count = (int) $count; |
|
418 | 418 | } else { |
419 | 419 | $count = 0; |
420 | 420 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $this->fixDI(); |
434 | 434 | |
435 | 435 | $query = $this->dbConn->getQueryBuilder(); |
436 | - $query->select($query->createFunction('COUNT(DISTINCT ' . $query->getColumnName('uid') . ')')) |
|
436 | + $query->select($query->createFunction('COUNT(DISTINCT '.$query->getColumnName('uid').')')) |
|
437 | 437 | ->from('preferences', 'p') |
438 | 438 | ->innerJoin('p', 'group_user', 'g', $query->expr()->eq('p.userid', 'g.uid')) |
439 | 439 | ->where($query->expr()->eq('appid', $query->createNamedParameter('core'))) |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $result->closeCursor(); |
447 | 447 | |
448 | 448 | if ($count !== false) { |
449 | - $count = (int)$count; |
|
449 | + $count = (int) $count; |
|
450 | 450 | } else { |
451 | 451 | $count = 0; |
452 | 452 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | continue; |
83 | 83 | } |
84 | 84 | |
85 | - if (strpos($query->getRoute(), $entry['id'] . '.') === 0) { |
|
85 | + if (strpos($query->getRoute(), $entry['id'].'.') === 0) { |
|
86 | 86 | // Skip the current app, unlikely this is intended |
87 | 87 | continue; |
88 | 88 | } |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | |
107 | 107 | public function getEvents(): array { |
108 | 108 | return [ |
109 | - new GenericEntityEvent($this->l10n->t('File created'), self::EVENT_NAMESPACE . 'postCreate'), |
|
110 | - new GenericEntityEvent($this->l10n->t('File updated'), self::EVENT_NAMESPACE . 'postWrite'), |
|
111 | - new GenericEntityEvent($this->l10n->t('File renamed'), self::EVENT_NAMESPACE . 'postRename'), |
|
112 | - new GenericEntityEvent($this->l10n->t('File deleted'), self::EVENT_NAMESPACE . 'postDelete'), |
|
113 | - new GenericEntityEvent($this->l10n->t('File accessed'), self::EVENT_NAMESPACE . 'postTouch'), |
|
114 | - new GenericEntityEvent($this->l10n->t('File copied'), self::EVENT_NAMESPACE . 'postCopy'), |
|
109 | + new GenericEntityEvent($this->l10n->t('File created'), self::EVENT_NAMESPACE.'postCreate'), |
|
110 | + new GenericEntityEvent($this->l10n->t('File updated'), self::EVENT_NAMESPACE.'postWrite'), |
|
111 | + new GenericEntityEvent($this->l10n->t('File renamed'), self::EVENT_NAMESPACE.'postRename'), |
|
112 | + new GenericEntityEvent($this->l10n->t('File deleted'), self::EVENT_NAMESPACE.'postDelete'), |
|
113 | + new GenericEntityEvent($this->l10n->t('File accessed'), self::EVENT_NAMESPACE.'postTouch'), |
|
114 | + new GenericEntityEvent($this->l10n->t('File copied'), self::EVENT_NAMESPACE.'postCopy'), |
|
115 | 115 | new GenericEntityEvent($this->l10n->t('Tag assigned'), MapperEvent::EVENT_ASSIGN), |
116 | 116 | ]; |
117 | 117 | } |
@@ -156,19 +156,19 @@ discard block |
||
156 | 156 | throw new NotFoundException(); |
157 | 157 | } |
158 | 158 | switch ($this->eventName) { |
159 | - case self::EVENT_NAMESPACE . 'postCreate': |
|
160 | - case self::EVENT_NAMESPACE . 'postWrite': |
|
161 | - case self::EVENT_NAMESPACE . 'postDelete': |
|
162 | - case self::EVENT_NAMESPACE . 'postTouch': |
|
159 | + case self::EVENT_NAMESPACE.'postCreate': |
|
160 | + case self::EVENT_NAMESPACE.'postWrite': |
|
161 | + case self::EVENT_NAMESPACE.'postDelete': |
|
162 | + case self::EVENT_NAMESPACE.'postTouch': |
|
163 | 163 | return $this->event->getSubject(); |
164 | - case self::EVENT_NAMESPACE . 'postRename': |
|
165 | - case self::EVENT_NAMESPACE . 'postCopy': |
|
164 | + case self::EVENT_NAMESPACE.'postRename': |
|
165 | + case self::EVENT_NAMESPACE.'postCopy': |
|
166 | 166 | return $this->event->getSubject()[1]; |
167 | 167 | case MapperEvent::EVENT_ASSIGN: |
168 | 168 | if (!$this->event instanceof MapperEvent || $this->event->getObjectType() !== 'files') { |
169 | 169 | throw new NotFoundException(); |
170 | 170 | } |
171 | - $nodes = $this->root->getById((int)$this->event->getObjectId()); |
|
171 | + $nodes = $this->root->getById((int) $this->event->getObjectId()); |
|
172 | 172 | if (is_array($nodes) && isset($nodes[0])) { |
173 | 173 | $this->node = $nodes[0]; |
174 | 174 | return $this->node; |
@@ -191,17 +191,17 @@ discard block |
||
191 | 191 | ]; |
192 | 192 | |
193 | 193 | switch ($this->eventName) { |
194 | - case self::EVENT_NAMESPACE . 'postCreate': |
|
194 | + case self::EVENT_NAMESPACE.'postCreate': |
|
195 | 195 | return $this->l10n->t('%s created %s', $options); |
196 | - case self::EVENT_NAMESPACE . 'postWrite': |
|
196 | + case self::EVENT_NAMESPACE.'postWrite': |
|
197 | 197 | return $this->l10n->t('%s modified %s', $options); |
198 | - case self::EVENT_NAMESPACE . 'postDelete': |
|
198 | + case self::EVENT_NAMESPACE.'postDelete': |
|
199 | 199 | return $this->l10n->t('%s deleted %s', $options); |
200 | - case self::EVENT_NAMESPACE . 'postTouch': |
|
200 | + case self::EVENT_NAMESPACE.'postTouch': |
|
201 | 201 | return $this->l10n->t('%s accessed %s', $options); |
202 | - case self::EVENT_NAMESPACE . 'postRename': |
|
202 | + case self::EVENT_NAMESPACE.'postRename': |
|
203 | 203 | return $this->l10n->t('%s renamed %s', $options); |
204 | - case self::EVENT_NAMESPACE . 'postCopy': |
|
204 | + case self::EVENT_NAMESPACE.'postCopy': |
|
205 | 205 | return $this->l10n->t('%s copied %s', $options); |
206 | 206 | case MapperEvent::EVENT_ASSIGN: |
207 | 207 | $tagNames = []; |