Conditions | 5 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
29 | 6 | public function convert(ElementInterface $element) |
|
30 | { |
||
31 | 6 | $tag = $element->getTagName(); |
|
32 | 6 | $value = $element->getValue(); |
|
33 | |||
34 | 6 | if ($tag === 'i' || $tag === 'em') { |
|
35 | 6 | $style = $this->config->getOption('italic_style'); |
|
36 | 6 | } else { |
|
37 | 6 | $style = $this->config->getOption('bold_style'); |
|
38 | } |
||
39 | |||
40 | 6 | $prefix = ltrim($value) !== $value ? ' ' : ''; |
|
41 | $suffix = rtrim($value) !== $value ? ' ' : ''; |
||
42 | |||
43 | return $prefix . $style . trim($value) . $style . $suffix; |
||
44 | } |
||
45 | |||
54 |