| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.243 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 23 | 17 | protected function newCommonMarkConverter(RootConfig $config) |
|
| 24 | { |
||
| 25 | 17 | $environment = Environment::createCommonMarkEnvironment(); |
|
| 26 | |||
| 27 | 17 | foreach ($config->getCommonMarkExtensions() as $extension) { |
|
| 28 | 9 | if (!class_exists($extension)) { |
|
| 29 | throw new \RuntimeException( |
||
| 30 | sprintf('CommonMark extension class "%s" does not exists. You must use a FCQN!', $extension) |
||
| 31 | ); |
||
| 32 | } |
||
| 33 | 9 | $environment->addExtension(new $extension()); |
|
| 34 | 17 | } |
|
| 35 | |||
| 36 | 17 | return new \League\CommonMark\Converter(new DocParser($environment), new HtmlRenderer($environment)); |
|
| 37 | } |
||
| 38 | } |
||
| 39 |