@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | $configPrefixes = $helper->getServerConfigurationPrefixes(true); |
113 | 113 | $ldapWrapper = new LDAP(); |
114 | 114 | |
115 | - $offset = (int)$input->getOption('offset'); |
|
116 | - $limit = (int)$input->getOption('limit'); |
|
115 | + $offset = (int) $input->getOption('offset'); |
|
116 | + $limit = (int) $input->getOption('limit'); |
|
117 | 117 | $this->validateOffsetAndLimit($offset, $limit); |
118 | 118 | |
119 | 119 | if ($input->getOption('group')) { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | $result = $proxy->$getMethod($input->getArgument('search'), $limit, $offset); |
142 | 142 | foreach ($result as $id => $name) { |
143 | - $line = $name . ($printID ? ' ('.$id.')' : ''); |
|
143 | + $line = $name.($printID ? ' ('.$id.')' : ''); |
|
144 | 144 | $output->writeln($line); |
145 | 145 | } |
146 | 146 | return 0; |
@@ -73,7 +73,7 @@ |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | $providers = $this->registry->getProviderStates($user); |
76 | - $state2fa = array_reduce($providers, function (bool $carry, bool $state) { |
|
76 | + $state2fa = array_reduce($providers, function(bool $carry, bool $state) { |
|
77 | 77 | return $carry || $state; |
78 | 78 | }, false); |
79 | 79 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $input = $host; |
67 | 67 | if (strpos($host, '://') === false) { |
68 | 68 | // add a protocol to fix parse_url behavior with ipv6 |
69 | - $host = 'http://' . $host; |
|
69 | + $host = 'http://'.$host; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $parsed = parse_url($host); |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | $this->root |
111 | 111 | = isset($params['root']) ? $this->cleanPath($params['root']) : '/'; |
112 | 112 | |
113 | - $this->root = '/' . ltrim($this->root, '/'); |
|
114 | - $this->root = rtrim($this->root, '/') . '/'; |
|
113 | + $this->root = '/'.ltrim($this->root, '/'); |
|
114 | + $this->root = rtrim($this->root, '/').'/'; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -170,14 +170,14 @@ discard block |
||
170 | 170 | * {@inheritdoc} |
171 | 171 | */ |
172 | 172 | public function getId() { |
173 | - $id = 'sftp::' . $this->user . '@' . $this->host; |
|
173 | + $id = 'sftp::'.$this->user.'@'.$this->host; |
|
174 | 174 | if ($this->port !== 22) { |
175 | - $id .= ':' . $this->port; |
|
175 | + $id .= ':'.$this->port; |
|
176 | 176 | } |
177 | 177 | // note: this will double the root slash, |
178 | 178 | // we should not change it to keep compatible with |
179 | 179 | // old storage ids |
180 | - $id .= '/' . $this->root; |
|
180 | + $id .= '/'.$this->root; |
|
181 | 181 | return $id; |
182 | 182 | } |
183 | 183 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @return string |
208 | 208 | */ |
209 | 209 | private function absPath($path) { |
210 | - return $this->root . $this->cleanPath($path); |
|
210 | + return $this->root.$this->cleanPath($path); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | try { |
218 | 218 | $storage_view = \OCP\Files::getStorage('files_external'); |
219 | 219 | if ($storage_view) { |
220 | - return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . |
|
221 | - $storage_view->getAbsolutePath('') . |
|
220 | + return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'). |
|
221 | + $storage_view->getAbsolutePath(''). |
|
222 | 222 | 'ssh_hostKeys'; |
223 | 223 | } |
224 | 224 | } catch (\Exception $e) { |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | if ($keyPath && file_exists($keyPath)) { |
237 | 237 | $fp = fopen($keyPath, 'w'); |
238 | 238 | foreach ($keys as $host => $key) { |
239 | - fwrite($fp, $host . '::' . $key . "\n"); |
|
239 | + fwrite($fp, $host.'::'.$key."\n"); |
|
240 | 240 | } |
241 | 241 | fclose($fp); |
242 | 242 | return true; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | return false; |
309 | 309 | } |
310 | 310 | |
311 | - $id = md5('sftp:' . $path); |
|
311 | + $id = md5('sftp:'.$path); |
|
312 | 312 | $dirStream = []; |
313 | 313 | foreach ($list as $file) { |
314 | 314 | if ($file !== '.' && $file !== '..') { |
@@ -375,13 +375,13 @@ discard block |
||
375 | 375 | } |
376 | 376 | SFTPReadStream::register(); |
377 | 377 | $context = stream_context_create(['sftp' => ['session' => $this->getConnection()]]); |
378 | - $handle = fopen('sftpread://' . trim($absPath, '/'), 'r', false, $context); |
|
378 | + $handle = fopen('sftpread://'.trim($absPath, '/'), 'r', false, $context); |
|
379 | 379 | return RetryWrapper::wrap($handle); |
380 | 380 | case 'w': |
381 | 381 | case 'wb': |
382 | 382 | SFTPWriteStream::register(); |
383 | 383 | $context = stream_context_create(['sftp' => ['session' => $this->getConnection()]]); |
384 | - return fopen('sftpwrite://' . trim($absPath, '/'), 'w', false, $context); |
|
384 | + return fopen('sftpwrite://'.trim($absPath, '/'), 'w', false, $context); |
|
385 | 385 | case 'a': |
386 | 386 | case 'ab': |
387 | 387 | case 'r+': |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | // Do not pass the password here. We want to use the Net_SFTP object |
471 | 471 | // supplied via stream context or fail. We only supply username and |
472 | 472 | // hostname because this might show up in logs (they are not used). |
473 | - $url = 'sftp://' . urlencode($this->user) . '@' . $this->host . ':' . $this->port . $this->root . $path; |
|
473 | + $url = 'sftp://'.urlencode($this->user).'@'.$this->host.':'.$this->port.$this->root.$path; |
|
474 | 474 | return $url; |
475 | 475 | } |
476 | 476 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Controllers |
79 | 79 | */ |
80 | - $context->registerService('APIController', function (ContainerInterface $c) { |
|
80 | + $context->registerService('APIController', function(ContainerInterface $c) { |
|
81 | 81 | /** @var IServerContainer $server */ |
82 | 82 | $server = $c->get(IServerContainer::class); |
83 | 83 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | /** |
97 | 97 | * Services |
98 | 98 | */ |
99 | - $context->registerService(TagService::class, function (ContainerInterface $c) { |
|
99 | + $context->registerService(TagService::class, function(ContainerInterface $c) { |
|
100 | 100 | /** @var IServerContainer $server */ |
101 | 101 | $server = $c->get(IServerContainer::class); |
102 | 102 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | private function registerNavigation(IL10N $l10n): void { |
153 | - \OCA\Files\App::getNavigationManager()->add(function () use ($l10n) { |
|
153 | + \OCA\Files\App::getNavigationManager()->add(function() use ($l10n) { |
|
154 | 154 | return [ |
155 | 155 | 'id' => 'files', |
156 | 156 | 'appname' => 'files', |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | 'name' => $l10n->t('All files') |
160 | 160 | ]; |
161 | 161 | }); |
162 | - \OCA\Files\App::getNavigationManager()->add(function () use ($l10n) { |
|
162 | + \OCA\Files\App::getNavigationManager()->add(function() use ($l10n) { |
|
163 | 163 | return [ |
164 | 164 | 'id' => 'recent', |
165 | 165 | 'appname' => 'files', |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | 'name' => $l10n->t('Recent') |
169 | 169 | ]; |
170 | 170 | }); |
171 | - \OCA\Files\App::getNavigationManager()->add(function () use ($l10n) { |
|
171 | + \OCA\Files\App::getNavigationManager()->add(function() use ($l10n) { |
|
172 | 172 | return [ |
173 | 173 | 'id' => 'favorites', |
174 | 174 | 'appname' => 'files', |
@@ -63,7 +63,7 @@ |
||
63 | 63 | public function findAll(?int $limit = null, ?int $offset = null): DataResponse { |
64 | 64 | $allStatuses = $this->service->findAll($limit, $offset); |
65 | 65 | |
66 | - return new DataResponse(array_map(function ($userStatus) { |
|
66 | + return new DataResponse(array_map(function($userStatus) { |
|
67 | 67 | return $this->formatStatus($userStatus); |
68 | 68 | }, $allStatuses)); |
69 | 69 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | return SearchResult::complete($this->getName(), []); |
94 | 94 | } |
95 | 95 | |
96 | - $principalUri = 'principals/users/' . $user->getUID(); |
|
96 | + $principalUri = 'principals/users/'.$user->getUID(); |
|
97 | 97 | $calendarsById = $this->getSortedCalendars($principalUri); |
98 | 98 | $subscriptionsById = $this->getSortedSubscriptions($principalUri); |
99 | 99 | |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | 'offset' => $query->getCursor(), |
109 | 109 | ] |
110 | 110 | ); |
111 | - $formattedResults = \array_map(function (array $taskRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { |
|
111 | + $formattedResults = \array_map(function(array $taskRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { |
|
112 | 112 | $component = $this->getPrimaryComponent($taskRow['calendardata'], self::$componentType); |
113 | - $title = (string)($component->SUMMARY ?? $this->l10n->t('Untitled task')); |
|
113 | + $title = (string) ($component->SUMMARY ?? $this->l10n->t('Untitled task')); |
|
114 | 114 | $subline = $this->generateSubline($component); |
115 | 115 | |
116 | 116 | if ($taskRow['calendartype'] === CalDavBackend::CALENDAR_TYPE_CALENDAR) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'privilege' => '{DAV:}read', |
111 | 111 | 'principal' => $this->getOwner(), |
112 | 112 | 'protected' => true, |
113 | - ],[ |
|
113 | + ], [ |
|
114 | 114 | 'privilege' => '{DAV:}write', |
115 | 115 | 'principal' => $this->getOwner(), |
116 | 116 | 'protected' => true, |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | $acl = $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl); |
148 | 148 | $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/system']; |
149 | - return array_filter($acl, function ($rule) use ($allowedPrincipals) { |
|
149 | + return array_filter($acl, function($rule) use ($allowedPrincipals) { |
|
150 | 150 | return \in_array($rule['principal'], $allowedPrincipals, true); |
151 | 151 | }); |
152 | 152 | } |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | |
181 | 181 | public function delete() { |
182 | 182 | if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) { |
183 | - $principal = 'principal:' . parent::getOwner(); |
|
183 | + $principal = 'principal:'.parent::getOwner(); |
|
184 | 184 | $shares = $this->carddavBackend->getShares($this->getResourceId()); |
185 | - $shares = array_filter($shares, function ($share) use ($principal) { |
|
185 | + $shares = array_filter($shares, function($share) use ($principal) { |
|
186 | 186 | return $share['href'] === $principal; |
187 | 187 | }); |
188 | 188 | if (empty($shares)) { |
@@ -103,7 +103,7 @@ |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | // $calendarHomePath will look like: calendars/username |
106 | - $calendarHomePath = $pathParts[0] . '/' . $pathParts[1]; |
|
106 | + $calendarHomePath = $pathParts[0].'/'.$pathParts[1]; |
|
107 | 107 | try { |
108 | 108 | $calendarHome = $this->server->tree->getNodeForPath($calendarHomePath); |
109 | 109 | if (!($calendarHome instanceof CalendarHome)) { |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | */ |
597 | 597 | private function getVEventByRecurrenceId(VObject\Component\VCalendar $vcalendar, |
598 | 598 | int $recurrenceId, |
599 | - bool $isRecurrenceException):?VEvent { |
|
599 | + bool $isRecurrenceException): ?VEvent { |
|
600 | 600 | $vevents = $this->getAllVEventsFromVCalendar($vcalendar); |
601 | 601 | if (count($vevents) === 0) { |
602 | 602 | return null; |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | * @param string $calendarData |
675 | 675 | * @return VObject\Component\VCalendar|null |
676 | 676 | */ |
677 | - private function parseCalendarData(string $calendarData):?VObject\Component\VCalendar { |
|
677 | + private function parseCalendarData(string $calendarData): ?VObject\Component\VCalendar { |
|
678 | 678 | try { |
679 | 679 | return VObject\Reader::read($calendarData, |
680 | 680 | VObject\Reader::OPTION_FORGIVING); |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | * @param string $principalUri |
688 | 688 | * @return IUser|null |
689 | 689 | */ |
690 | - private function getUserFromPrincipalURI(string $principalUri):?IUser { |
|
690 | + private function getUserFromPrincipalURI(string $principalUri): ?IUser { |
|
691 | 691 | if (!$principalUri) { |
692 | 692 | return null; |
693 | 693 | } |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | * @return VObject\Component\VEvent[] |
728 | 728 | */ |
729 | 729 | private function getRecurrenceExceptionFromListOfVEvents(array $vevents):array { |
730 | - return array_values(array_filter($vevents, function (VEvent $vevent) { |
|
730 | + return array_values(array_filter($vevents, function(VEvent $vevent) { |
|
731 | 731 | return $vevent->{'RECURRENCE-ID'} !== null; |
732 | 732 | })); |
733 | 733 | } |
@@ -736,8 +736,8 @@ discard block |
||
736 | 736 | * @param array $vevents |
737 | 737 | * @return VEvent|null |
738 | 738 | */ |
739 | - private function getMasterItemFromListOfVEvents(array $vevents):?VEvent { |
|
740 | - $elements = array_values(array_filter($vevents, function (VEvent $vevent) { |
|
739 | + private function getMasterItemFromListOfVEvents(array $vevents): ?VEvent { |
|
740 | + $elements = array_values(array_filter($vevents, function(VEvent $vevent) { |
|
741 | 741 | return $vevent->{'RECURRENCE-ID'} === null; |
742 | 742 | })); |
743 | 743 |