| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 2 | public function __invoke(BridgeAdapter $bridgeAdapter, string $runner = self::JAPHA_JASPER_V6): ReportRunnerInterface |
|
| 20 | { |
||
| 21 | 2 | if (!array_key_exists($runner, self::SUPPORTED_RUNNERS)) { |
|
| 22 | 1 | throw new Exception\UnsupportedRunnerException( |
|
| 23 | 1 | sprintf( |
|
| 24 | 1 | 'Unsupported runner "%s", must be in (%s)', |
|
| 25 | 1 | $runner, |
|
| 26 | 1 | implode(',', array_keys(self::SUPPORTED_RUNNERS)) |
|
| 27 | ) |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | 1 | $class = self::SUPPORTED_RUNNERS[$runner]; |
|
| 32 | |||
| 33 | 1 | return new $class($bridgeAdapter); |
|
| 34 | } |
||
| 35 | } |
||
| 36 |