| Total Complexity | 7 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | trait HandlesEnvFiles |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @param $environment |
||
| 13 | * |
||
| 14 | * @return bool|null|string |
||
| 15 | */ |
||
| 16 | protected function loadEncrypted($environment) |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param $ciphertext |
||
| 29 | * @param $environment |
||
| 30 | * |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | protected function saveEncrypted($ciphertext, $environment) |
||
| 34 | { |
||
| 35 | $path = $this->getFilePathForEnvironment($environment); |
||
| 36 | |||
| 37 | return file_put_contents($path, $ciphertext) !== false; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param $plaintext |
||
| 42 | * @param null $output |
||
|
|
|||
| 43 | * |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | protected function saveDecrypted($plaintext, $output = null) |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param $environment |
||
| 57 | * |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | protected function getFilePathForEnvironment($environment) |
||
| 63 | } |
||
| 64 | } |