@@ -31,12 +31,10 @@ |
||
| 31 | 31 | if (!$success) { |
| 32 | 32 | try { |
| 33 | 33 | $random = random_bytes(static::IV_LENGTH); |
| 34 | - } |
|
| 35 | - catch (Exception $e) { |
|
| 34 | + } catch (Exception $e) { |
|
| 36 | 35 | if ($allowLessSecureIv) { |
| 37 | 36 | $random = $this->generateInsecureIv(static::IV_LENGTH); |
| 38 | - } |
|
| 39 | - else { |
|
| 37 | + } else { |
|
| 40 | 38 | throw new RuntimeException('Unable to generate initialization vector (IV)'); |
| 41 | 39 | } |
| 42 | 40 | } |
@@ -35,9 +35,9 @@ |
||
| 35 | 35 | protected static function createClassName(string $cipher): string { |
| 36 | 36 | $crypto = strtoupper(explode('-', $cipher)[0]); |
| 37 | 37 | return sprintf('%s\%s\%s', |
| 38 | - 'Encryption\Cipher', |
|
| 39 | - $crypto, |
|
| 40 | - str_replace('-', '', ucwords($cipher)) |
|
| 38 | + 'Encryption\Cipher', |
|
| 39 | + $crypto, |
|
| 40 | + str_replace('-', '', ucwords($cipher)) |
|
| 41 | 41 | ); |
| 42 | 42 | } |
| 43 | 43 | |