@@ -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>'); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | - uasort($users, function ($a, $b) { |
|
127 | + uasort($users, function($a, $b) { |
|
128 | 128 | /** |
129 | 129 | * @var \OC\User\User $a |
130 | 130 | * @var \OC\User\User $b |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | 'message' => $userStatus->getMessage(), |
170 | 170 | 'icon' => $userStatus->getIcon(), |
171 | 171 | 'clearAt' => $userStatus->getClearAt() |
172 | - ? (int)$userStatus->getClearAt()->format('U') |
|
172 | + ? (int) $userStatus->getClearAt()->format('U') |
|
173 | 173 | : null, |
174 | 174 | ]; |
175 | 175 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | 'message' => $userStatus->getMessage(), |
254 | 254 | 'icon' => $userStatus->getIcon(), |
255 | 255 | 'clearAt' => $userStatus->getClearAt() |
256 | - ? (int)$userStatus->getClearAt()->format('U') |
|
256 | + ? (int) $userStatus->getClearAt()->format('U') |
|
257 | 257 | : null, |
258 | 258 | ]; |
259 | 259 | } |