Conditions | 5 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 5.1158 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 1 | public function setDescription(string $description): void |
|
34 | { |
||
35 | 1 | $this->opfXml->registerXPathNamespace('dc', $this->dcNamespace); |
|
36 | |||
37 | 1 | $descriptionNode = $this->opfXml->xpath('//dc:description'); |
|
38 | |||
39 | 1 | if ($descriptionNode !== false && $descriptionNode !== null && $descriptionNode !== [] && isset($descriptionNode[0])) { |
|
40 | // @phpstan-ignore-next-line |
||
41 | 1 | $descriptionNode[0][0] = $description; |
|
42 | } else { |
||
43 | $this->opfXml->metadata->addChild('description', $description, $this->dcNamespace); |
||
44 | } |
||
47 |