@@ -131,7 +131,7 @@ |
||
131 | 131 | if (isset($versions[0])) { |
132 | 132 | $highestVersion = $versions[0]; |
133 | 133 | foreach ($releases as $release) { |
134 | - if ((string)$release['version'] === (string)$highestVersion) { |
|
134 | + if ((string) $release['version'] === (string) $highestVersion) { |
|
135 | 135 | $response['data'][$dataKey]['releases'] = [$release]; |
136 | 136 | break; |
137 | 137 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($this->cache !== null) { |
57 | - $fileCacheKey = $file . filemtime($file); |
|
57 | + $fileCacheKey = $file.filemtime($file); |
|
58 | 58 | if ($cachedValue = $this->cache->get($fileCacheKey)) { |
59 | 59 | return json_decode($cachedValue, true); |
60 | 60 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | public function xmlToArray($xml) { |
232 | 232 | if (!$xml->children()) { |
233 | - return (string)$xml; |
|
233 | + return (string) $xml; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | $array = []; |
@@ -247,15 +247,15 @@ discard block |
||
247 | 247 | '@attributes' => [], |
248 | 248 | ]; |
249 | 249 | if (!count($node->children())) { |
250 | - $value = (string)$node; |
|
250 | + $value = (string) $node; |
|
251 | 251 | if (!empty($value)) { |
252 | - $data['@value'] = (string)$node; |
|
252 | + $data['@value'] = (string) $node; |
|
253 | 253 | } |
254 | 254 | } else { |
255 | 255 | $data = array_merge($data, $this->xmlToArray($node)); |
256 | 256 | } |
257 | 257 | foreach ($attributes as $attr => $value) { |
258 | - $data['@attributes'][$attr] = (string)$value; |
|
258 | + $data['@attributes'][$attr] = (string) $value; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | if ($totalElement > 1) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | private function hash(string $methodIdentifier, |
63 | 63 | string $userIdentifier): string { |
64 | - return hash('sha512', $methodIdentifier . $userIdentifier); |
|
64 | + return hash('sha512', $methodIdentifier.$userIdentifier); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $existingAttempts = array_values($existingAttempts); |
123 | 123 | |
124 | 124 | // Store the new attempt |
125 | - $existingAttempts[] = (string)$currentTime; |
|
125 | + $existingAttempts[] = (string) $currentTime; |
|
126 | 126 | $this->cache->set($identifier, json_encode($existingAttempts)); |
127 | 127 | } |
128 | 128 | } |
@@ -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); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | return true; |
91 | 91 | } |
92 | 92 | // Reject misformed domains in any case |
93 | - if (strpos($domain,'-') === 0 || strpos($domain,'..') !== false) { |
|
93 | + if (strpos($domain, '-') === 0 || strpos($domain, '..') !== false) { |
|
94 | 94 | return false; |
95 | 95 | } |
96 | 96 | // Match, allowing for * wildcards |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | if (gettype($trusted) !== 'string') { |
99 | 99 | break; |
100 | 100 | } |
101 | - $regex = '/^' . implode('[-\.a-zA-Z0-9]*', array_map(function ($v) { |
|
101 | + $regex = '/^'.implode('[-\.a-zA-Z0-9]*', array_map(function($v) { |
|
102 | 102 | return preg_quote($v, '/'); |
103 | - }, explode('*', $trusted))) . '$/i'; |
|
103 | + }, explode('*', $trusted))).'$/i'; |
|
104 | 104 | if (preg_match($regex, $domain) || preg_match($regex, $domainWithPort)) { |
105 | 105 | return true; |
106 | 106 | } |
@@ -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 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | $result = $this->entries; |
122 | 122 | if ($type !== 'all') { |
123 | - $result = array_filter($this->entries, function ($entry) use ($type) { |
|
123 | + $result = array_filter($this->entries, function($entry) use ($type) { |
|
124 | 124 | return $entry['type'] === $type; |
125 | 125 | }); |
126 | 126 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @return array |
136 | 136 | */ |
137 | 137 | private function proceedNavigation(array $list): array { |
138 | - uasort($list, function ($a, $b) { |
|
138 | + uasort($list, function($a, $b) { |
|
139 | 139 | if (isset($a['order']) && isset($b['order'])) { |
140 | 140 | return ($a['order'] < $b['order']) ? -1 : 1; |
141 | 141 | } elseif (isset($a['order']) || isset($b['order'])) { |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | continue; |
289 | 289 | } |
290 | 290 | $l = $this->l10nFac->get($app); |
291 | - $id = $nav['id'] ?? $app . ($key === 0 ? '' : $key); |
|
291 | + $id = $nav['id'] ?? $app.($key === 0 ? '' : $key); |
|
292 | 292 | $order = isset($nav['order']) ? $nav['order'] : 100; |
293 | 293 | $type = isset($nav['type']) ? $nav['type'] : 'link'; |
294 | 294 | $route = $nav['route'] !== '' ? $this->urlGenerator->linkToRoute($nav['route']) : ''; |