| Conditions | 6 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | 1 | public function setIdentifiers(array $identifiers): void |
|
| 43 | { |
||
| 44 | 1 | $this->opfXml->registerXPathNamespace('dc', $this->dcNamespace); |
|
| 45 | |||
| 46 | 1 | $identifierNodes = $this->opfXml->xpath('//dc:identifier'); |
|
| 47 | |||
| 48 | 1 | if ($identifierNodes !== false && $identifierNodes !== null && $identifierNodes !== []) { |
|
| 49 | 1 | foreach ($identifierNodes as $key => $identifierNode) { |
|
| 50 | 1 | unset($identifierNodes[$key][0]); |
|
| 51 | } |
||
| 52 | } |
||
| 53 | |||
| 54 | 1 | foreach ($identifiers as $identifier) { |
|
| 55 | 1 | $this->opfXml->metadata->addChild('identifier', $identifier, $this->dcNamespace); |
|
| 56 | } |
||
| 59 |