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