@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | protected function retrieveKey(string $id): Key { |
| 104 | 104 | try { |
| 105 | - $cachedPublicKey = $this->cache->get($id . '-public'); |
|
| 106 | - $cachedPrivateKey = $this->cache->get($id . '-private'); |
|
| 105 | + $cachedPublicKey = $this->cache->get($id.'-public'); |
|
| 106 | + $cachedPrivateKey = $this->cache->get($id.'-private'); |
|
| 107 | 107 | |
| 108 | 108 | if ($cachedPublicKey !== null && $cachedPrivateKey !== null) { |
| 109 | 109 | $decryptedPrivateKey = $this->crypto->decrypt($cachedPrivateKey); |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | $privateKey = $folder->getFile('private')->getContent(); |
| 116 | 116 | $publicKey = $folder->getFile('public')->getContent(); |
| 117 | 117 | |
| 118 | - $this->cache->set($id . '-public', $publicKey); |
|
| 119 | - $this->cache->set($id . '-private', $privateKey); |
|
| 118 | + $this->cache->set($id.'-public', $publicKey); |
|
| 119 | + $this->cache->set($id.'-private', $privateKey); |
|
| 120 | 120 | |
| 121 | 121 | $decryptedPrivateKey = $this->crypto->decrypt($privateKey); |
| 122 | 122 | return new Key($publicKey, $decryptedPrivateKey); |
@@ -132,19 +132,19 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function getKey(IUser $user): Key { |
| 134 | 134 | $uid = $user->getUID(); |
| 135 | - return $this->retrieveKey('user-' . $uid); |
|
| 135 | + return $this->retrieveKey('user-'.$uid); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * Set public key for $user |
| 140 | 140 | */ |
| 141 | 141 | public function setPublicKey(IUser $user, string $publicKey): void { |
| 142 | - $id = 'user-' . $user->getUID(); |
|
| 142 | + $id = 'user-'.$user->getUID(); |
|
| 143 | 143 | |
| 144 | 144 | $folder = $this->appData->getFolder($id); |
| 145 | 145 | $folder->newFile('public', $publicKey); |
| 146 | 146 | |
| 147 | - $this->cache->set($id . '-public', $publicKey); |
|
| 147 | + $this->cache->set($id.'-public', $publicKey); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | if ($instanceId === null) { |
| 158 | 158 | throw new \RuntimeException('no instance id!'); |
| 159 | 159 | } |
| 160 | - return $this->retrieveKey('system-' . $instanceId); |
|
| 160 | + return $this->retrieveKey('system-'.$instanceId); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | public function hasAppKey(string $app, string $name): bool { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | private function generateAppKeyId(string $app, string $name): string { |
| 192 | - return 'app-' . $app . '-' . $name; |
|
| 192 | + return 'app-'.$app.'-'.$name; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | private function logOpensslError(): void { |
@@ -197,6 +197,6 @@ discard block |
||
| 197 | 197 | while ($error = openssl_error_string()) { |
| 198 | 198 | $errors[] = $error; |
| 199 | 199 | } |
| 200 | - $this->logger->critical('Something is wrong with your openssl setup: ' . implode(', ', $errors)); |
|
| 200 | + $this->logger->critical('Something is wrong with your openssl setup: '.implode(', ', $errors)); |
|
| 201 | 201 | } |
| 202 | 202 | } |