| Conditions | 4 |
| Paths | 6 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | 11 | public static function getOcraService(string $type="tiqr", array $options=array(), LoggerInterface $logger=null) |
|
| 41 | { |
||
| 42 | 11 | if (!$logger) |
|
| 43 | 1 | $logger=new \Psr\Log\NullLogger(); |
|
| 44 | |||
| 45 | switch ($type) { |
||
| 46 | 11 | case "tiqr": |
|
| 47 | 9 | return new Tiqr_OcraService_Tiqr($options, $logger); |
|
| 48 | 2 | case "oathserviceclient": |
|
| 49 | 1 | return new Tiqr_OcraService_OathServiceClient($options, $logger); |
|
| 50 | } |
||
| 51 | 1 | throw new RuntimeException(sprintf('Unable to create a OcraService instance of type: %s', $type)); |
|
| 52 | } |
||
| 54 |