| 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 setTitle(string $title): void |
|
| 34 | { |
||
| 35 | 1 | $this->opfXml->registerXPathNamespace('dc', $this->dcNamespace); |
|
| 36 | |||
| 37 | 1 | $titleNode = $this->opfXml->xpath('//dc:title'); |
|
| 38 | |||
| 39 | 1 | if ($titleNode !== false && $titleNode !== null && $titleNode !== [] && isset($titleNode[0])) { |
|
| 40 | // @phpstan-ignore-next-line |
||
| 41 | 1 | $titleNode[0][0] = $title; |
|
| 42 | } else { |
||
| 43 | $this->opfXml->metadata->addChild('title', $title, $this->dcNamespace); |
||
| 44 | } |
||
| 47 |