| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.4326 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | 11 | public static function getEncryption(LoggerInterface $logger, string $type="dummy", array $options=array()): Tiqr_UserSecretStorage_Encryption_Interface |
|
| 42 | { |
||
| 43 | 11 | $logger->info(sprintf('Using %s as UserStorage encryption type', $type)); |
|
| 44 | 11 | switch ($type) { |
|
| 45 | 11 | case "dummy": |
|
| 46 | 11 | $instance = new Tiqr_UserSecretStorage_Encryption_Dummy($options); |
|
| 47 | 11 | break; |
|
| 48 | case "mcrypt": |
||
| 49 | $instance = new Tiqr_UserSecretStorage_Encryption_Mcrypt($options); |
||
| 50 | break; |
||
| 51 | default: |
||
| 52 | $instance = new $type($options); |
||
| 53 | } |
||
| 54 | |||
| 55 | 11 | return $instance; |
|
| 56 | } |
||
| 58 |