Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
38 | 2 | public function __invoke(BridgeAdapter $bridgeAdapter, string $runner = self::JAPHA_JASPER_V6): ReportRunnerInterface |
|
39 | { |
||
40 | 2 | if (!array_key_exists($runner, self::SUPPORTED_RUNNERS)) { |
|
41 | 1 | throw new Exception\UnsupportedRunnerException( |
|
42 | 1 | sprintf( |
|
43 | 1 | 'Unsupported runner "%s", must be in (%s)', |
|
44 | 1 | $runner, |
|
45 | 1 | implode(',', array_keys(self::SUPPORTED_RUNNERS)) |
|
46 | ) |
||
47 | ); |
||
48 | } |
||
49 | |||
50 | 1 | $class = self::SUPPORTED_RUNNERS[$runner]; |
|
51 | |||
52 | 1 | return new $class($bridgeAdapter); |
|
53 | } |
||
54 | } |
||
55 |