@@ -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 */ |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | public function assign(string $uid): void { |
63 | 63 | $this->log( |
64 | 64 | 'UserID assigned: "%s"', |
65 | - [ 'uid' => $uid ], |
|
66 | - [ 'uid' ] |
|
65 | + ['uid' => $uid], |
|
66 | + ['uid'] |
|
67 | 67 | ); |
68 | 68 | } |
69 | 69 | |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | public function unassign(string $uid): void { |
91 | 91 | $this->log( |
92 | 92 | 'UserID unassigned: "%s"', |
93 | - [ 'uid' => $uid ], |
|
94 | - [ 'uid' ] |
|
93 | + ['uid' => $uid], |
|
94 | + ['uid'] |
|
95 | 95 | ); |
96 | 96 | } |
97 | 97 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function register(IRegistrationContext $context): void { |
61 | 61 | $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); |
62 | 62 | |
63 | - $context->registerService(NewUserMailHelper::class, function (ContainerInterface $c) { |
|
63 | + $context->registerService(NewUserMailHelper::class, function(ContainerInterface $c) { |
|
64 | 64 | return new NewUserMailHelper( |
65 | 65 | $c->get(Defaults::class), |
66 | 66 | $c->get(IURLGenerator::class), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | Util::getDefaultEmailAddress('no-reply') |
74 | 74 | ); |
75 | 75 | }); |
76 | - $context->registerService(ProvisioningApiMiddleware::class, function (ContainerInterface $c) { |
|
76 | + $context->registerService(ProvisioningApiMiddleware::class, function(ContainerInterface $c) { |
|
77 | 77 | $user = $c->get(IUserManager::class)->get($c->get('UserId')); |
78 | 78 | $isAdmin = false; |
79 | 79 | $isSubAdmin = false; |
@@ -103,7 +103,7 @@ |
||
103 | 103 | if (isset($pluginManagerSuppressed)) { |
104 | 104 | $this->pluginManager->setSuppressDeletion($pluginManagerSuppressed); |
105 | 105 | } |
106 | - $output->writeln('<error>' . $e->getMessage() . '</error>'); |
|
106 | + $output->writeln('<error>'.$e->getMessage().'</error>'); |
|
107 | 107 | return 1; |
108 | 108 | } |
109 | 109 | $output->writeln('<error>Error while resetting user</error>'); |