| Conditions | 3 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3.072 |
| Changes | 13 | ||
| Bugs | 1 | Features | 4 |
| 1 | <?php |
||
| 38 | 2 | protected function init() |
|
| 39 | { |
||
| 40 | 2 | $getopt = $this->context->getopt(array( |
|
| 41 | 2 | 'template:', |
|
| 42 | 2 | 'target:', |
|
| 43 | 'root-href:' |
||
| 44 | 2 | )); |
|
| 45 | |||
| 46 | 2 | if ($getopt->hasErrors()) { |
|
| 47 | $errors = $getopt->getErrors(); |
||
| 48 | $error = array_shift($errors); |
||
| 49 | throw $error; |
||
| 50 | } |
||
| 51 | |||
| 52 | 2 | $rootConfigFile = $getopt->get(1); |
|
| 53 | 2 | if (! $rootConfigFile) { |
|
| 54 | 1 | throw new Exception( |
|
| 55 | "Please enter the path to a bookdown.json file as the first argument." |
||
| 56 | 1 | ); |
|
| 57 | } |
||
| 58 | |||
| 59 | 1 | $rootConfigOverrides = $getopt->get(); |
|
| 60 | 1 | return array($rootConfigFile, $rootConfigOverrides); |
|
| 61 | } |
||
| 62 | } |
||
| 63 |