@@ -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 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | $gid = $input->getArgument('groupid'); |
68 | 68 | $group = $this->groupManager->get($gid); |
69 | 69 | if (!$group instanceof IGroup) { |
70 | - $output->writeln('<error>Group "' . $gid . '" does not exist.</error>'); |
|
70 | + $output->writeln('<error>Group "'.$gid.'" does not exist.</error>'); |
|
71 | 71 | return 1; |
72 | 72 | } else { |
73 | 73 | $groupOutput = [ |
@@ -52,8 +52,8 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | protected function initLogger() { |
55 | - $default = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/flow.log'; |
|
56 | - $logFile = trim((string)$this->config->getAppValue(Application::APP_ID, 'logfile', $default)); |
|
55 | + $default = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/flow.log'; |
|
56 | + $logFile = trim((string) $this->config->getAppValue(Application::APP_ID, 'logfile', $default)); |
|
57 | 57 | if ($logFile !== '') { |
58 | 58 | $this->flowLogger = $this->logFactory->getCustomPsrLogger($logFile); |
59 | 59 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * sort the actions by priority and name |
118 | 118 | */ |
119 | 119 | private function sortActions(): void { |
120 | - usort($this->actions, function (IAction $action1, IAction $action2) { |
|
120 | + usort($this->actions, function(IAction $action1, IAction $action2) { |
|
121 | 121 | $prio1 = $action1->getPriority(); |
122 | 122 | $prio2 = $action2->getPriority(); |
123 | 123 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function jsonSerialize(): array { |
156 | 156 | $topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null; |
157 | - $otherActions = array_map(function (IAction $action) { |
|
157 | + $otherActions = array_map(function(IAction $action) { |
|
158 | 158 | return $action->jsonSerialize(); |
159 | 159 | }, array_slice($this->actions, 1)); |
160 | 160 |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | * Core class wrappers |
86 | 86 | */ |
87 | 87 | /** FIXME: Remove once OC_User is non-static and mockable */ |
88 | - $context->registerService('isAdmin', function () { |
|
88 | + $context->registerService('isAdmin', function() { |
|
89 | 89 | return \OC_User::isAdminUser(\OC_User::getUser()); |
90 | 90 | }); |
91 | 91 | /** FIXME: Remove once OC_SubAdmin is non-static and mockable */ |
92 | - $context->registerService('isSubAdmin', function () { |
|
92 | + $context->registerService('isSubAdmin', function() { |
|
93 | 93 | $userObject = \OC::$server->getUserSession()->getUser(); |
94 | 94 | $isSubAdmin = false; |
95 | 95 | if ($userObject !== null) { |
@@ -97,18 +97,18 @@ discard block |
||
97 | 97 | } |
98 | 98 | return $isSubAdmin; |
99 | 99 | }); |
100 | - $context->registerService(IProvider::class, function (IAppContainer $appContainer) { |
|
100 | + $context->registerService(IProvider::class, function(IAppContainer $appContainer) { |
|
101 | 101 | /** @var IServerContainer $serverContainer */ |
102 | 102 | $serverContainer = $appContainer->query(IServerContainer::class); |
103 | 103 | return $serverContainer->query(IProvider::class); |
104 | 104 | }); |
105 | - $context->registerService(IManager::class, function (IAppContainer $appContainer) { |
|
105 | + $context->registerService(IManager::class, function(IAppContainer $appContainer) { |
|
106 | 106 | /** @var IServerContainer $serverContainer */ |
107 | 107 | $serverContainer = $appContainer->query(IServerContainer::class); |
108 | 108 | return $serverContainer->getSettingsManager(); |
109 | 109 | }); |
110 | 110 | |
111 | - $context->registerService(NewUserMailHelper::class, function (IAppContainer $appContainer) { |
|
111 | + $context->registerService(NewUserMailHelper::class, function(IAppContainer $appContainer) { |
|
112 | 112 | /** @var Server $server */ |
113 | 113 | $server = $appContainer->query(IServerContainer::class); |
114 | 114 | /** @var Defaults $defaults */ |