Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class Base64EncryptionStrategy implements EncryptionStrategyInterface |
||
14 | { |
||
15 | /** |
||
16 | * Encrypt a value using base64 encoding. |
||
17 | * |
||
18 | * @param string $value The value to encrypt. |
||
19 | * @return string The encrypted value. |
||
20 | */ |
||
21 | public function encrypt(string $value): string |
||
22 | { |
||
23 | return base64_encode($value); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Decrypt an encrypted value using base64 decoding. |
||
28 | * |
||
29 | * @param string $encryptedValue The encrypted value to decrypt. |
||
30 | * @return string The decrypted value. |
||
31 | */ |
||
32 | public function decrypt(string $encryptedValue): string |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Boot the encryption strategy. |
||
39 | * |
||
40 | * @param array $configs The configuration array. |
||
41 | */ |
||
42 | public function boot(array $configs): void |
||
47 |