| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | private function createSecret(string $secretPath): string |
||
| 41 | { |
||
| 42 | $secret = random_bytes(128); |
||
| 43 | $secret = sha1($secret); |
||
| 44 | $secret = substr($secret, 0, 9); |
||
| 45 | |||
| 46 | if (!file_put_contents($secretPath, $secret)) { |
||
| 47 | throw new RuntimeException(sprintf('Cannot write APP_SECRET file: %s', $secretPath)); |
||
| 48 | } |
||
| 49 | |||
| 50 | return $secret; |
||
| 51 | } |
||
| 53 |