@@ -74,7 +74,7 @@ |
||
| 74 | 74 | */ |
| 75 | 75 | public function getPath(): string |
| 76 | 76 | { |
| 77 | - if (substr($this->path, -1)!="/") return $this->path."/"; |
|
| 77 | + if (substr($this->path, -1) != "/") return $this->path."/"; |
|
| 78 | 78 | return $this->path; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -74,7 +74,9 @@ |
||
| 74 | 74 | */ |
| 75 | 75 | public function getPath(): string |
| 76 | 76 | { |
| 77 | - if (substr($this->path, -1)!="/") return $this->path."/"; |
|
| 77 | + if (substr($this->path, -1)!="/") { |
|
| 78 | + return $this->path."/"; |
|
| 79 | + } |
|
| 78 | 80 | return $this->path; |
| 79 | 81 | } |
| 80 | 82 | |
@@ -32,7 +32,6 @@ |
||
| 32 | 32 | * Supported options: |
| 33 | 33 | * path : Path to the directory where the user data is stored |
| 34 | 34 | * |
| 35 | - |
|
| 36 | 35 | */ |
| 37 | 36 | class Tiqr_UserSecretStorage_File extends Tiqr_UserSecretStorage_Abstract |
| 38 | 37 | { |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | */ |
| 81 | 81 | protected function setUserSecret(string $userId, string $secret): void |
| 82 | 82 | { |
| 83 | - $data=array(); |
|
| 83 | + $data = array(); |
|
| 84 | 84 | if ($this->_userExists($userId)) { |
| 85 | 85 | $data = $this->_loadUser($userId); |
| 86 | 86 | } |
@@ -57,13 +57,13 @@ discard block |
||
| 57 | 57 | if ($prefix === $this->encryption->get_type()) { |
| 58 | 58 | // Decrypt the secret if it is prefixed with the current encryption type |
| 59 | 59 | // Remove the encryption type prefix before decrypting |
| 60 | - return $this->encryption->decrypt( substr($encryptedSecret, $pos+1) ); |
|
| 60 | + return $this->encryption->decrypt(substr($encryptedSecret, $pos + 1)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // Check the decryption array for the encryption type to see if there is an encryption |
| 64 | 64 | // instance defined for it. If so, use that to decrypt the secret. |
| 65 | 65 | if (isset($this->decryption[$prefix])) { |
| 66 | - return $this->decryption[$prefix]->decrypt( substr($encryptedSecret, $pos+1) ); |
|
| 66 | + return $this->decryption[$prefix]->decrypt(substr($encryptedSecret, $pos + 1)); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $this->logger->error("Secret for user '$userId' is encrypted with unsupported encryption type '$prefix'"); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $encryptedSecret = $this->encryption->encrypt($secret); |
| 82 | 82 | // Prefix the user secret with the encryption type |
| 83 | - $this->setUserSecret($userId, $this->encryption->get_type() . ':' . $encryptedSecret); |
|
| 83 | + $this->setUserSecret($userId, $this->encryption->get_type().':'.$encryptedSecret); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -88,6 +88,6 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function healthCheck(string &$statusMessage = ''): bool |
| 90 | 90 | { |
| 91 | - return true; // Health check is always successful when not implemented |
|
| 91 | + return true; // Health check is always successful when not implemented |
|
| 92 | 92 | } |
| 93 | 93 | } |
@@ -71,6 +71,6 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function healthCheck(string &$statusMessage = ''): bool |
| 73 | 73 | { |
| 74 | - return true; // Health check is always successful when not implemented |
|
| 74 | + return true; // Health check is always successful when not implemented |
|
| 75 | 75 | } |
| 76 | 76 | } |