Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
35 | 18 | public function newProcess(RootConfig $config, $name) |
|
36 | { |
||
37 | 18 | $method = "get{$name}Process"; |
|
38 | 18 | $class = $config->$method(); |
|
39 | |||
40 | 18 | $implemented = is_subclass_of( |
|
41 | 18 | $class, |
|
42 | 'Bookdown\Bookdown\Process\ProcessBuilderInterface' |
||
43 | 18 | ); |
|
44 | 18 | if (! $implemented) { |
|
45 | 1 | throw new Exception( |
|
46 | 1 | "'{$class}' does not implement ProcessBuilderInterface" |
|
47 | 1 | ); |
|
48 | } |
||
49 | |||
50 | 17 | $builder = new $class(); |
|
51 | 17 | return $builder->newInstance($config, $this->logger, $this->fsio); |
|
52 | } |
||
53 | } |
||
54 |