Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
28 | 3 | private function createDisqusHelper(array $config) : DisqusHelper |
|
29 | { |
||
30 | 3 | if (!isset($config['shortname'])) { |
|
31 | 1 | throw new DisqusConfigurationNotProvidedException('Disqus shortname must be provided through the `disqus` -> `shortname` configuration option'); |
|
32 | } |
||
33 | |||
34 | 2 | $shortName = $config['shortname']; |
|
35 | 2 | unset($config['shortname']); |
|
36 | |||
37 | 2 | $disqusHelper = DisqusHelper::create($shortName); |
|
38 | |||
39 | 2 | if (!empty($config)) { |
|
40 | 1 | $disqusHelper->configure($config); |
|
41 | } |
||
42 | |||
43 | 2 | return $disqusHelper; |
|
44 | } |
||
45 | } |
||
46 |