@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $documentationUrl = $this->urlGenerator->linkToDocs('developer-code-integrity'); |
82 | 82 | $output->writeln('This command requires the --path, --privateKey and --certificate.'); |
83 | 83 | $output->writeln('Example: ./occ integrity:sign-app --path="/Users/lukasreschke/Programming/myapp/" --privateKey="/Users/lukasreschke/private/myapp.key" --certificate="/Users/lukasreschke/public/mycert.crt"'); |
84 | - $output->writeln('For more information please consult the documentation: '. $documentationUrl); |
|
84 | + $output->writeln('For more information please consult the documentation: '.$documentationUrl); |
|
85 | 85 | return 1; |
86 | 86 | } |
87 | 87 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $this->checker->writeAppSignature($path, $x509, $rsa); |
108 | 108 | $output->writeln('Successfully signed "'.$path.'"'); |
109 | 109 | } catch (\Exception $e) { |
110 | - $output->writeln('Error: ' . $e->getMessage()); |
|
110 | + $output->writeln('Error: '.$e->getMessage()); |
|
111 | 111 | return 1; |
112 | 112 | } |
113 | 113 | return 0; |
@@ -62,7 +62,7 @@ |
||
62 | 62 | protected function execute(InputInterface $input, OutputInterface $output): int { |
63 | 63 | $result = $this->checker->verifyCoreSignature(); |
64 | 64 | $this->writeArrayInOutputFormat($input, $output, $result); |
65 | - if (count($result)>0) { |
|
65 | + if (count($result) > 0) { |
|
66 | 66 | return 1; |
67 | 67 | } |
68 | 68 | return 0; |
@@ -68,10 +68,10 @@ |
||
68 | 68 | */ |
69 | 69 | protected function execute(InputInterface $input, OutputInterface $output): int { |
70 | 70 | $appid = $input->getArgument('appid'); |
71 | - $path = (string)$input->getOption('path'); |
|
71 | + $path = (string) $input->getOption('path'); |
|
72 | 72 | $result = $this->checker->verifyAppSignature($appid, $path); |
73 | 73 | $this->writeArrayInOutputFormat($input, $output, $result); |
74 | - if (count($result)>0) { |
|
74 | + if (count($result) > 0) { |
|
75 | 75 | return 1; |
76 | 76 | } |
77 | 77 | return 0; |
@@ -62,10 +62,10 @@ |
||
62 | 62 | if (is_array($value)) { |
63 | 63 | $output->writeln(" <comment>>></comment> $key:"); |
64 | 64 | foreach ($value as $subKey => $subValue) { |
65 | - $output->writeln(" <comment>>></comment> $subKey: " . str_repeat(' ', 46 - strlen($subKey)) . $subValue); |
|
65 | + $output->writeln(" <comment>>></comment> $subKey: ".str_repeat(' ', 46 - strlen($subKey)).$subValue); |
|
66 | 66 | } |
67 | 67 | } else { |
68 | - $output->writeln(" <comment>>></comment> $key: " . str_repeat(' ', 50 - strlen($key)) . $value); |
|
68 | + $output->writeln(" <comment>>></comment> $key: ".str_repeat(' ', 50 - strlen($key)).$value); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | return 0; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | try { |
72 | 72 | $configs = $this->validateFileContent($content); |
73 | 73 | } catch (\UnexpectedValueException $e) { |
74 | - $output->writeln('<error>' . $e->getMessage(). '</error>'); |
|
74 | + $output->writeln('<error>'.$e->getMessage().'</error>'); |
|
75 | 75 | return 1; |
76 | 76 | } |
77 | 77 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - $output->writeln('<info>Config successfully imported from: ' . $importFile . '</info>'); |
|
94 | + $output->writeln('<info>Config successfully imported from: '.$importFile.'</info>'); |
|
95 | 95 | return 0; |
96 | 96 | } |
97 | 97 | |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | $additionalKeys = array_diff($arrayKeys, $this->validRootKeys); |
146 | 146 | $commonKeys = array_intersect($arrayKeys, $this->validRootKeys); |
147 | 147 | if (!empty($additionalKeys)) { |
148 | - throw new \UnexpectedValueException('Found invalid entries in root: ' . implode(', ', $additionalKeys)); |
|
148 | + throw new \UnexpectedValueException('Found invalid entries in root: '.implode(', ', $additionalKeys)); |
|
149 | 149 | } |
150 | 150 | if (empty($commonKeys)) { |
151 | - throw new \UnexpectedValueException('At least one key of the following is expected: ' . implode(', ', $this->validRootKeys)); |
|
151 | + throw new \UnexpectedValueException('At least one key of the following is expected: '.implode(', ', $this->validRootKeys)); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | if (isset($array['system'])) { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | protected function checkTypeRecursively($configValue, $configName) { |
178 | 178 | if (!is_array($configValue) && !is_bool($configValue) && !is_int($configValue) && !is_string($configValue) && !is_null($configValue)) { |
179 | - throw new \UnexpectedValueException('Invalid system config value for "' . $configName . '". Only arrays, bools, integers, strings and null (delete) are allowed.'); |
|
179 | + throw new \UnexpectedValueException('Invalid system config value for "'.$configName.'". Only arrays, bools, integers, strings and null (delete) are allowed.'); |
|
180 | 180 | } |
181 | 181 | if (is_array($configValue)) { |
182 | 182 | foreach ($configValue as $key => $value) { |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | foreach ($array as $app => $configs) { |
195 | 195 | foreach ($configs as $name => $value) { |
196 | 196 | if (!is_int($value) && !is_string($value) && !is_null($value)) { |
197 | - throw new \UnexpectedValueException('Invalid app config value for "' . $app . '":"' . $name . '". Only integers, strings and null (delete) are allowed.'); |
|
197 | + throw new \UnexpectedValueException('Invalid app config value for "'.$app.'":"'.$name.'". Only integers, strings and null (delete) are allowed.'); |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | protected function execute(InputInterface $input, OutputInterface $output): int { |
85 | 85 | $users = $this->userManager->search('', (int) $input->getOption('limit'), (int) $input->getOption('offset')); |
86 | 86 | |
87 | - $this->writeArrayInOutputFormat($input, $output, $this->formatUsers($users, (bool)$input->getOption('info'))); |
|
87 | + $this->writeArrayInOutputFormat($input, $output, $this->formatUsers($users, (bool) $input->getOption('info'))); |
|
88 | 88 | return 0; |
89 | 89 | } |
90 | 90 | |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | * @return array |
95 | 95 | */ |
96 | 96 | private function formatUsers(array $users, bool $detailed = false) { |
97 | - $keys = array_map(function (IUser $user) { |
|
97 | + $keys = array_map(function(IUser $user) { |
|
98 | 98 | return $user->getUID(); |
99 | 99 | }, $users); |
100 | 100 | |
101 | - $values = array_map(function (IUser $user) use ($detailed) { |
|
101 | + $values = array_map(function(IUser $user) use ($detailed) { |
|
102 | 102 | if ($detailed) { |
103 | 103 | $groups = $this->groupManager->getUserGroupIds($user); |
104 | 104 | return [ |
@@ -65,13 +65,13 @@ |
||
65 | 65 | |
66 | 66 | $lastLogin = $user->getLastLogin(); |
67 | 67 | if ($lastLogin === 0) { |
68 | - $output->writeln('User ' . $user->getUID() . |
|
68 | + $output->writeln('User '.$user->getUID(). |
|
69 | 69 | ' has never logged in, yet.'); |
70 | 70 | } else { |
71 | 71 | $date = new \DateTime(); |
72 | 72 | $date->setTimestamp($lastLogin); |
73 | - $output->writeln($user->getUID() . |
|
74 | - '`s last login: ' . $date->format('d.m.Y H:i')); |
|
73 | + $output->writeln($user->getUID(). |
|
74 | + '`s last login: '.$date->format('d.m.Y H:i')); |
|
75 | 75 | } |
76 | 76 | return 0; |
77 | 77 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | protected function execute(InputInterface $input, OutputInterface $output): int { |
89 | 89 | $uid = $input->getArgument('uid'); |
90 | 90 | if ($this->userManager->userExists($uid)) { |
91 | - $output->writeln('<error>The user "' . $uid . '" already exists.</error>'); |
|
91 | + $output->writeln('<error>The user "'.$uid.'" already exists.</error>'); |
|
92 | 92 | return 1; |
93 | 93 | } |
94 | 94 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | $question = new Question('Confirm password: '); |
110 | 110 | $question->setHidden(true); |
111 | - $confirm = $helper->ask($input, $output,$question); |
|
111 | + $confirm = $helper->ask($input, $output, $question); |
|
112 | 112 | |
113 | 113 | if ($password !== $confirm) { |
114 | 114 | $output->writeln("<error>Passwords did not match!</error>"); |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | $password |
126 | 126 | ); |
127 | 127 | } catch (\Exception $e) { |
128 | - $output->writeln('<error>' . $e->getMessage() . '</error>'); |
|
128 | + $output->writeln('<error>'.$e->getMessage().'</error>'); |
|
129 | 129 | return 1; |
130 | 130 | } |
131 | 131 | |
132 | 132 | |
133 | 133 | if ($user instanceof IUser) { |
134 | - $output->writeln('<info>The user "' . $user->getUID() . '" was created successfully</info>'); |
|
134 | + $output->writeln('<info>The user "'.$user->getUID().'" was created successfully</info>'); |
|
135 | 135 | } else { |
136 | 136 | $output->writeln('<error>An error occurred while creating the user</error>'); |
137 | 137 | return 1; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | if ($input->getOption('display-name')) { |
141 | 141 | $user->setDisplayName($input->getOption('display-name')); |
142 | - $output->writeln('Display name set to "' . $user->getDisplayName() . '"'); |
|
142 | + $output->writeln('Display name set to "'.$user->getDisplayName().'"'); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | $groups = $input->getOption('group'); |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | $this->groupManager->createGroup($groupName); |
157 | 157 | $group = $this->groupManager->get($groupName); |
158 | 158 | if ($group instanceof IGroup) { |
159 | - $output->writeln('Created group "' . $group->getGID() . '"'); |
|
159 | + $output->writeln('Created group "'.$group->getGID().'"'); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | if ($group instanceof IGroup) { |
163 | 163 | $group->addUser($user); |
164 | - $output->writeln('User "' . $user->getUID() . '" added to group "' . $group->getGID() . '"'); |
|
164 | + $output->writeln('User "'.$user->getUID().'" added to group "'.$group->getGID().'"'); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | return 0; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | protected function execute(InputInterface $input, OutputInterface $output): int { |
54 | 54 | $outputType = $input->getOption('output'); |
55 | 55 | if ($outputType === self::OUTPUT_FORMAT_JSON || $outputType === self::OUTPUT_FORMAT_JSON_PRETTY) { |
56 | - $certificates = array_map(function (ICertificate $certificate) { |
|
56 | + $certificates = array_map(function(ICertificate $certificate) { |
|
57 | 57 | return [ |
58 | 58 | 'name' => $certificate->getName(), |
59 | 59 | 'common_name' => $certificate->getCommonName(), |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | 'Issued By' |
80 | 80 | ]); |
81 | 81 | |
82 | - $rows = array_map(function (ICertificate $certificate) { |
|
82 | + $rows = array_map(function(ICertificate $certificate) { |
|
83 | 83 | return [ |
84 | 84 | $certificate->getName(), |
85 | 85 | $certificate->getCommonName(), |