@@ -143,7 +143,7 @@ |
||
143 | 143 | } elseif ($existing === 'exclusive') { |
144 | 144 | return $existing; |
145 | 145 | } else { |
146 | - return $existing . ' shared locks'; |
|
146 | + return $existing.' shared locks'; |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | * @since 13.0.0 |
60 | 60 | */ |
61 | 61 | protected function getValidatedType($type) { |
62 | - $type = trim((string)$type); |
|
62 | + $type = trim((string) $type); |
|
63 | 63 | |
64 | 64 | if ($type === '') { |
65 | 65 | throw new \InvalidArgumentException('Type must not be empty'); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $instance = new static(); |
52 | 52 | |
53 | 53 | foreach ($params as $key => $value) { |
54 | - $method = 'set' . ucfirst($key); |
|
54 | + $method = 'set'.ucfirst($key); |
|
55 | 55 | $instance->$method($value); |
56 | 56 | } |
57 | 57 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | foreach ($row as $key => $value) { |
71 | 71 | $prop = ucfirst($instance->columnToProperty($key)); |
72 | - $setter = 'set' . $prop; |
|
72 | + $setter = 'set'.$prop; |
|
73 | 73 | $instance->$setter($value); |
74 | 74 | } |
75 | 75 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | $this->$name = $args[0]; |
116 | 116 | } else { |
117 | - throw new \BadFunctionCallException($name . |
|
117 | + throw new \BadFunctionCallException($name. |
|
118 | 118 | ' is not a valid attribute'); |
119 | 119 | } |
120 | 120 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if (property_exists($this, $name)) { |
129 | 129 | return $this->$name; |
130 | 130 | } else { |
131 | - throw new \BadFunctionCallException($name . |
|
131 | + throw new \BadFunctionCallException($name. |
|
132 | 132 | ' is not a valid attribute'); |
133 | 133 | } |
134 | 134 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } elseif ($this->isGetterForBoolProperty($methodName)) { |
150 | 150 | return $this->getter(lcfirst(substr($methodName, 2))); |
151 | 151 | } else { |
152 | - throw new \BadFunctionCallException($methodName . |
|
152 | + throw new \BadFunctionCallException($methodName. |
|
153 | 153 | ' does not exist'); |
154 | 154 | } |
155 | 155 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | if ($column === null) { |
214 | 214 | $column = $part; |
215 | 215 | } else { |
216 | - $column .= '_' . lcfirst($part); |
|
216 | + $column .= '_'.lcfirst($part); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | // trim '-' |
260 | 260 | return trim($value, '-'); |
261 | 261 | } else { |
262 | - throw new \BadFunctionCallException($attributeName . |
|
262 | + throw new \BadFunctionCallException($attributeName. |
|
263 | 263 | ' is not a valid attribute'); |
264 | 264 | } |
265 | 265 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function file_put_contents(string $filename, string $data): int { |
66 | 66 | $bytesWritten = @file_put_contents($filename, $data); |
67 | 67 | if ($bytesWritten === false || $bytesWritten !== \strlen($data)) { |
68 | - throw new \Exception('Failed to write into ' . $filename); |
|
68 | + throw new \Exception('Failed to write into '.$filename); |
|
69 | 69 | } |
70 | 70 | return $bytesWritten; |
71 | 71 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function assertDirectoryExists(string $path) { |
86 | 86 | if (!is_dir($path)) { |
87 | - throw new \Exception('Directory ' . $path . ' does not exist.'); |
|
87 | + throw new \Exception('Directory '.$path.' does not exist.'); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->output = $output; |
88 | 88 | |
89 | 89 | if ($user !== '' && $this->userManager->userExists($user) === false) { |
90 | - $this->output->writeln('User "' . $user . '" does not exist. Please check the username and try again'); |
|
90 | + $this->output->writeln('User "'.$user.'" does not exist. Please check the username and try again'); |
|
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | $this->output->writeln('Files for following users couldn\'t be decrypted, '); |
106 | 106 | $this->output->writeln('maybe the user is not set up in a way that supports this operation: '); |
107 | 107 | foreach ($this->failed as $uid => $paths) { |
108 | - $this->output->writeln(' ' . $uid); |
|
108 | + $this->output->writeln(' '.$uid); |
|
109 | 109 | foreach ($paths as $path) { |
110 | - $this->output->writeln(' ' . $path); |
|
110 | + $this->output->writeln(' '.$path); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | $this->output->writeln(''); |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | /** @var IEncryptionModule $module */ |
130 | 130 | $module = call_user_func($moduleDesc['callback']); |
131 | 131 | $this->output->writeln(''); |
132 | - $this->output->writeln('Prepare "' . $module->getDisplayName() . '"'); |
|
132 | + $this->output->writeln('Prepare "'.$module->getDisplayName().'"'); |
|
133 | 133 | $this->output->writeln(''); |
134 | 134 | if ($module->prepareDecryptAll($this->input, $this->output, $user) === false) { |
135 | - $this->output->writeln('Module "' . $moduleDesc['displayName'] . '" does not support the functionality to decrypt all files again or the initialization of the module failed!'); |
|
135 | + $this->output->writeln('Module "'.$moduleDesc['displayName'].'" does not support the functionality to decrypt all files again or the initialization of the module failed!'); |
|
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | protected function decryptUsersFiles($uid, ProgressBar $progress, $userCount) { |
207 | 207 | $this->setupUserFS($uid); |
208 | 208 | $directories = []; |
209 | - $directories[] = '/' . $uid . '/files'; |
|
209 | + $directories[] = '/'.$uid.'/files'; |
|
210 | 210 | |
211 | 211 | while ($root = array_pop($directories)) { |
212 | 212 | $content = $this->rootView->getDirectoryContent($root); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | if ($file->getStorage()->instanceOfStorage('OCA\Files_Sharing\SharedStorage')) { |
216 | 216 | continue; |
217 | 217 | } |
218 | - $path = $root . '/' . $file['name']; |
|
218 | + $path = $root.'/'.$file['name']; |
|
219 | 219 | if ($this->rootView->is_dir($path)) { |
220 | 220 | $directories[] = $path; |
221 | 221 | continue; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | } |
260 | 260 | |
261 | 261 | $source = $path; |
262 | - $target = $path . '.decrypted.' . $this->getTimestamp(); |
|
262 | + $target = $path.'.decrypted.'.$this->getTimestamp(); |
|
263 | 263 | |
264 | 264 | try { |
265 | 265 | $this->rootView->copy($source, $target); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function getKey(IUser $user): Key { |
146 | 146 | $uid = $user->getUID(); |
147 | - return $this->retrieveKey('user-' . $uid); |
|
147 | + return $this->retrieveKey('user-'.$uid); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | if ($instanceId === null) { |
159 | 159 | throw new \RuntimeException('no instance id!'); |
160 | 160 | } |
161 | - return $this->retrieveKey('system-' . $instanceId); |
|
161 | + return $this->retrieveKey('system-'.$instanceId); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | private function logOpensslError(): void { |
@@ -166,6 +166,6 @@ discard block |
||
166 | 166 | while ($error = openssl_error_string()) { |
167 | 167 | $errors[] = $error; |
168 | 168 | } |
169 | - $this->logger->critical('Something is wrong with your openssl setup: ' . implode(', ', $errors)); |
|
169 | + $this->logger->critical('Something is wrong with your openssl setup: '.implode(', ', $errors)); |
|
170 | 170 | } |
171 | 171 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | public function getEncryptedValue(): string { |
58 | 58 | if ($this->encryptedValue === '') { |
59 | 59 | $sharedSecret = random_bytes(\strlen($this->value)); |
60 | - $this->encryptedValue = base64_encode($this->value ^ $sharedSecret) . ':' . base64_encode($sharedSecret); |
|
60 | + $this->encryptedValue = base64_encode($this->value ^ $sharedSecret).':'.base64_encode($sharedSecret); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return $this->encryptedValue; |
@@ -74,7 +74,7 @@ |
||
74 | 74 | */ |
75 | 75 | public function mergePolicies(ContentSecurityPolicy $defaultPolicy, |
76 | 76 | EmptyContentSecurityPolicy $originalPolicy): ContentSecurityPolicy { |
77 | - foreach ((object)(array)$originalPolicy as $name => $value) { |
|
77 | + foreach ((object) (array) $originalPolicy as $name => $value) { |
|
78 | 78 | $setter = 'set'.ucfirst($name); |
79 | 79 | if (\is_array($value)) { |
80 | 80 | $getter = 'get'.ucfirst($name); |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | $alg = $this->getPrefferedAlgorithm(); |
97 | 97 | |
98 | 98 | if (\defined('PASSWORD_ARGON2ID') && $alg === PASSWORD_ARGON2ID) { |
99 | - return 3 . '|' . password_hash($message, PASSWORD_ARGON2ID, $this->options); |
|
99 | + return 3.'|'.password_hash($message, PASSWORD_ARGON2ID, $this->options); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if (\defined('PASSWORD_ARGON2I') && $alg === PASSWORD_ARGON2I) { |
103 | - return 2 . '|' . password_hash($message, PASSWORD_ARGON2I, $this->options); |
|
103 | + return 2.'|'.password_hash($message, PASSWORD_ARGON2I, $this->options); |
|
104 | 104 | } |
105 | 105 | |
106 | - return 1 . '|' . password_hash($message, PASSWORD_BCRYPT, $this->options); |
|
106 | + return 1.'|'.password_hash($message, PASSWORD_BCRYPT, $this->options); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | protected function splitHash(string $prefixedHash) { |
115 | 115 | $explodedString = explode('|', $prefixedHash, 2); |
116 | 116 | if (\count($explodedString) === 2) { |
117 | - if ((int)$explodedString[0] > 0) { |
|
118 | - return ['version' => (int)$explodedString[0], 'hash' => $explodedString[1]]; |
|
117 | + if ((int) $explodedString[0] > 0) { |
|
118 | + return ['version' => (int) $explodedString[0], 'hash' => $explodedString[1]]; |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 |