@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function getMountsForUser(IUser $user) { |
85 | 85 | $loader = $this->loader; |
86 | - $mounts = array_map(function (IMountProvider $provider) use ($user, $loader) { |
|
86 | + $mounts = array_map(function(IMountProvider $provider) use ($user, $loader) { |
|
87 | 87 | return $provider->getMountsForUser($user, $loader); |
88 | 88 | }, $this->providers); |
89 | - $mounts = array_filter($mounts, function ($result) { |
|
89 | + $mounts = array_filter($mounts, function($result) { |
|
90 | 90 | return is_array($result); |
91 | 91 | }); |
92 | - $mounts = array_reduce($mounts, function (array $mounts, array $providerMounts) { |
|
92 | + $mounts = array_reduce($mounts, function(array $mounts, array $providerMounts) { |
|
93 | 93 | return array_merge($mounts, $providerMounts); |
94 | 94 | }, []); |
95 | 95 | return $this->filterMounts($user, $mounts); |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | // shared mount provider gets to go last since it needs to know existing files |
100 | 100 | // to check for name collisions |
101 | 101 | $firstMounts = []; |
102 | - $firstProviders = array_filter($this->providers, function (IMountProvider $provider) { |
|
102 | + $firstProviders = array_filter($this->providers, function(IMountProvider $provider) { |
|
103 | 103 | return (get_class($provider) !== 'OCA\Files_Sharing\MountProvider'); |
104 | 104 | }); |
105 | - $lastProviders = array_filter($this->providers, function (IMountProvider $provider) { |
|
105 | + $lastProviders = array_filter($this->providers, function(IMountProvider $provider) { |
|
106 | 106 | return (get_class($provider) === 'OCA\Files_Sharing\MountProvider'); |
107 | 107 | }); |
108 | 108 | foreach ($firstProviders as $provider) { |
@@ -140,11 +140,11 @@ discard block |
||
140 | 140 | $providers = array_reverse($this->homeProviders); // call the latest registered provider first to give apps an opportunity to overwrite builtin |
141 | 141 | foreach ($providers as $homeProvider) { |
142 | 142 | if ($mount = $homeProvider->getHomeMountForUser($user, $this->loader)) { |
143 | - $mount->setMountPoint('/' . $user->getUID()); //make sure the mountpoint is what we expect |
|
143 | + $mount->setMountPoint('/'.$user->getUID()); //make sure the mountpoint is what we expect |
|
144 | 144 | return $mount; |
145 | 145 | } |
146 | 146 | } |
147 | - throw new \Exception('No home storage configured for user ' . $user); |
|
147 | + throw new \Exception('No home storage configured for user '.$user); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | private function filterMounts(IUser $user, array $mountPoints) { |
166 | - return array_filter($mountPoints, function (IMountPoint $mountPoint) use ($user) { |
|
166 | + return array_filter($mountPoints, function(IMountPoint $mountPoint) use ($user) { |
|
167 | 167 | foreach ($this->mountFilters as $filter) { |
168 | 168 | if ($filter($mountPoint, $user) === false) { |
169 | 169 | return false; |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function getRootMounts(): array { |
217 | 217 | $loader = $this->loader; |
218 | - $mounts = array_map(function (IRootMountProvider $provider) use ($loader) { |
|
218 | + $mounts = array_map(function(IRootMountProvider $provider) use ($loader) { |
|
219 | 219 | return $provider->getRootMounts($loader); |
220 | 220 | }, $this->rootProviders); |
221 | - $mounts = array_reduce($mounts, function (array $mounts, array $providerMounts) { |
|
221 | + $mounts = array_reduce($mounts, function(array $mounts, array $providerMounts) { |
|
222 | 222 | return array_merge($mounts, $providerMounts); |
223 | 223 | }, []); |
224 | 224 | return $mounts; |
@@ -61,7 +61,7 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | private function getCredentialsIdentifier($storageId) { |
64 | - return self::CREDENTIALS_IDENTIFIER_PREFIX . $storageId; |
|
64 | + return self::CREDENTIALS_IDENTIFIER_PREFIX.$storageId; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | public function saveBackendOptions(IUser $user, $mountId, array $options) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function generateTarget($itemSource, $shareWith, $exclude = null) { |
99 | 99 | $shareFolder = \OCA\Files_Sharing\Helper::getShareFolder(); |
100 | - $target = \OC\Files\Filesystem::normalizePath($shareFolder . '/' . basename($itemSource)); |
|
100 | + $target = \OC\Files\Filesystem::normalizePath($shareFolder.'/'.basename($itemSource)); |
|
101 | 101 | |
102 | 102 | // for group shares we return the target right away |
103 | 103 | if ($shareWith === false) { |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | \OC\Files\Filesystem::initMountPoints($shareWith); |
108 | - $view = new \OC\Files\View('/' . $shareWith . '/files'); |
|
108 | + $view = new \OC\Files\View('/'.$shareWith.'/files'); |
|
109 | 109 | |
110 | 110 | if (!$view->is_dir($shareFolder)) { |
111 | 111 | $dir = ''; |
112 | 112 | $subdirs = explode('/', $shareFolder); |
113 | 113 | foreach ($subdirs as $subdir) { |
114 | - $dir = $dir . '/' . $subdir; |
|
114 | + $dir = $dir.'/'.$subdir; |
|
115 | 115 | if (!$view->is_dir($dir)) { |
116 | 116 | $view->mkdir($dir); |
117 | 117 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | if ($share['item_type'] === 'folder' && $target !== '') { |
250 | 250 | // note: in case of ext storage mount points the path might be empty |
251 | 251 | // which would cause a leading slash to appear |
252 | - $share['path'] = ltrim($share['path'] . '/' . $target, '/'); |
|
252 | + $share['path'] = ltrim($share['path'].'/'.$target, '/'); |
|
253 | 253 | } |
254 | 254 | return self::resolveReshares($share); |
255 | 255 | } |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | ->from(self::TAG_TABLE); |
142 | 142 | |
143 | 143 | if (!\is_null($visibilityFilter)) { |
144 | - $query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int)$visibilityFilter))); |
|
144 | + $query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int) $visibilityFilter))); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | if (!empty($nameSearchPattern)) { |
148 | 148 | $query->andWhere( |
149 | 149 | $query->expr()->like( |
150 | 150 | 'name', |
151 | - $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%') |
|
151 | + $query->createNamedParameter('%'.$this->connection->escapeLikeParameter($nameSearchPattern).'%') |
|
152 | 152 | ) |
153 | 153 | ); |
154 | 154 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $result->closeCursor(); |
183 | 183 | if (!$row) { |
184 | 184 | throw new TagNotFoundException( |
185 | - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist' |
|
185 | + 'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') does not exist' |
|
186 | 186 | ); |
187 | 187 | } |
188 | 188 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $query->execute(); |
206 | 206 | } catch (UniqueConstraintViolationException $e) { |
207 | 207 | throw new TagAlreadyExistsException( |
208 | - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', |
|
208 | + 'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') already exists', |
|
209 | 209 | 0, |
210 | 210 | $e |
211 | 211 | ); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $tagId = $query->getLastInsertId(); |
215 | 215 | |
216 | 216 | $tag = new SystemTag( |
217 | - (string)$tagId, |
|
217 | + (string) $tagId, |
|
218 | 218 | $tagName, |
219 | 219 | $userVisible, |
220 | 220 | $userAssignable |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | } |
267 | 267 | } catch (UniqueConstraintViolationException $e) { |
268 | 268 | throw new TagAlreadyExistsException( |
269 | - 'Tag ("' . $newName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', |
|
269 | + 'Tag ("'.$newName.'", '.$userVisible.', '.$userAssignable.') already exists', |
|
270 | 270 | 0, |
271 | 271 | $e |
272 | 272 | ); |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | private function createSystemTagFromRow($row) { |
376 | - return new SystemTag((string)$row['id'], $row['name'], (bool)$row['visibility'], (bool)$row['editable']); |
|
376 | + return new SystemTag((string) $row['id'], $row['name'], (bool) $row['visibility'], (bool) $row['editable']); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | /** |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | do { |
87 | 87 | $users = $backend->getUsers('', $limit, $offset); |
88 | 88 | foreach ($users as $user) { |
89 | - $output->writeln('Scanning all files for ' . $user); |
|
89 | + $output->writeln('Scanning all files for '.$user); |
|
90 | 90 | $this->setupUserFS($user); |
91 | - $result &= $this->scanFolder($output, '/' . $user); |
|
91 | + $result &= $this->scanFolder($output, '/'.$user); |
|
92 | 92 | } |
93 | 93 | $offset += $limit; |
94 | 94 | } while (count($users) >= $limit); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $clean = true; |
107 | 107 | |
108 | 108 | foreach ($this->rootView->getDirectoryContent($folder) as $item) { |
109 | - $path = $folder . '/' . $item['name']; |
|
109 | + $path = $folder.'/'.$item['name']; |
|
110 | 110 | if ($this->rootView->is_dir($path)) { |
111 | 111 | if ($this->scanFolder($output, $path) === false) { |
112 | 112 | $clean = false; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $stats = $this->rootView->stat($path); |
121 | 121 | if (!isset($stats['hasHeader']) || $stats['hasHeader'] === false) { |
122 | 122 | $clean = false; |
123 | - $output->writeln($path . ' does not have a proper header'); |
|
123 | + $output->writeln($path.' does not have a proper header'); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | parent::__construct(self::APP_ID, $urlParams); |
55 | 55 | |
56 | 56 | $dispatcher = $this->getContainer()->query(IEventDispatcher::class); |
57 | - $dispatcher->addListener(RegisterWidgetEvent::class, function (Event $e) { |
|
57 | + $dispatcher->addListener(RegisterWidgetEvent::class, function(Event $e) { |
|
58 | 58 | Util::addScript(self::APP_ID, 'weather-status'); |
59 | 59 | }); |
60 | 60 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $offset = (int) $arguments['offset']; |
73 | 73 | $stopAt = (int) $arguments['stopAt']; |
74 | 74 | |
75 | - $this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')'); |
|
75 | + $this->logger->info('Building calendar index ('.$offset.'/'.$stopAt.')'); |
|
76 | 76 | |
77 | 77 | $startTime = $this->timeFactory->getTime(); |
78 | 78 | while (($this->timeFactory->getTime() - $startTime) < 15) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'offset' => $offset, |
90 | 90 | 'stopAt' => $stopAt |
91 | 91 | ]); |
92 | - $this->logger->info('New building calendar index job scheduled with offset ' . $offset); |
|
92 | + $this->logger->info('New building calendar index job scheduled with offset '.$offset); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $recentStatusUpdates = array_slice( |
129 | 129 | array_filter( |
130 | 130 | $this->service->findAllRecentStatusChanges(8, 0), |
131 | - static function (UserStatus $status) use ($currentUserId): bool { |
|
131 | + static function(UserStatus $status) use ($currentUserId): bool { |
|
132 | 132 | return $status->getUserId() !== $currentUserId; |
133 | 133 | } |
134 | 134 | ), |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | 7 |
137 | 137 | ); |
138 | 138 | |
139 | - $this->initialStateService->provideInitialState(Application::APP_ID, 'dashboard_data', array_map(function (UserStatus $status): array { |
|
139 | + $this->initialStateService->provideInitialState(Application::APP_ID, 'dashboard_data', array_map(function(UserStatus $status): array { |
|
140 | 140 | $user = $this->userManager->get($status->getUserId()); |
141 | 141 | $displayName = $status->getUserId(); |
142 | 142 | if ($user !== null) { |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | * @param string $root |
109 | 109 | */ |
110 | 110 | protected function updateSystemKeys($root) { |
111 | - if (!$this->rootView->is_dir($root . '/files_encryption')) { |
|
111 | + if (!$this->rootView->is_dir($root.'/files_encryption')) { |
|
112 | 112 | return; |
113 | 113 | } |
114 | 114 | |
115 | - $this->traverseKeys($root . '/files_encryption', null); |
|
115 | + $this->traverseKeys($root.'/files_encryption', null); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | private function traverseKeys(string $folder, ?string $uid) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | if ($node['mimetype'] === 'httpd/unix-directory') { |
123 | 123 | //ignore |
124 | 124 | } else { |
125 | - $endsWith = function ($haystack, $needle) { |
|
125 | + $endsWith = function($haystack, $needle) { |
|
126 | 126 | $length = strlen($needle); |
127 | 127 | if ($length === 0) { |
128 | 128 | return true; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $endsWith($node['name'], '.privateKey') || |
136 | 136 | $endsWith($node['name'], '.publicKey') || |
137 | 137 | $endsWith($node['name'], '.shareKey')) { |
138 | - $path = $folder . '/' . $node['name']; |
|
138 | + $path = $folder.'/'.$node['name']; |
|
139 | 139 | |
140 | 140 | $content = $this->rootView->file_get_contents($path); |
141 | 141 | |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | |
164 | 164 | foreach ($listing as $node) { |
165 | 165 | if ($node['mimetype'] === 'httpd/unix-directory') { |
166 | - $this->traverseFileKeys($folder . '/' . $node['name']); |
|
166 | + $this->traverseFileKeys($folder.'/'.$node['name']); |
|
167 | 167 | } else { |
168 | - $endsWith = function ($haystack, $needle) { |
|
168 | + $endsWith = function($haystack, $needle) { |
|
169 | 169 | $length = strlen($needle); |
170 | 170 | if ($length === 0) { |
171 | 171 | return true; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $endsWith($node['name'], '.privateKey') || |
179 | 179 | $endsWith($node['name'], '.publicKey') || |
180 | 180 | $endsWith($node['name'], '.shareKey')) { |
181 | - $path = $folder . '/' . $node['name']; |
|
181 | + $path = $folder.'/'.$node['name']; |
|
182 | 182 | |
183 | 183 | $content = $this->rootView->file_get_contents($path); |
184 | 184 | |
@@ -247,12 +247,12 @@ discard block |
||
247 | 247 | */ |
248 | 248 | protected function updateUserKeys(string $root, string $user) { |
249 | 249 | if ($this->userManager->userExists($user)) { |
250 | - $source = $root . '/' . $user . '/files_encryption/OC_DEFAULT_MODULE'; |
|
250 | + $source = $root.'/'.$user.'/files_encryption/OC_DEFAULT_MODULE'; |
|
251 | 251 | if ($this->rootView->is_dir($source)) { |
252 | 252 | $this->traverseKeys($source, $user); |
253 | 253 | } |
254 | 254 | |
255 | - $source = $root . '/' . $user . '/files_encryption/keys'; |
|
255 | + $source = $root.'/'.$user.'/files_encryption/keys'; |
|
256 | 256 | if ($this->rootView->is_dir($source)) { |
257 | 257 | $this->traverseFileKeys($source); |
258 | 258 | } |