Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
50 | 16 | public function getHashSignFromDoc(\DOMDocument $document) |
|
51 | { |
||
52 | 16 | $xpt = $this->getXpath($document); |
|
53 | |||
54 | 16 | $exts = $xpt->query('ext:UBLExtensions/ext:UBLExtension', $document->documentElement); |
|
55 | 16 | if ($exts->length == 0) { |
|
56 | 2 | return ''; |
|
57 | } |
||
58 | 14 | $nodeSign = $exts->item($exts->length - 1); |
|
59 | |||
60 | 14 | $hash = $xpt->query('ext:ExtensionContent/ds:Signature/ds:SignedInfo/ds:Reference/ds:DigestValue', $nodeSign); |
|
61 | |||
62 | 14 | if ($hash->length == 0) { |
|
63 | 2 | return ''; |
|
64 | } |
||
65 | |||
66 | 12 | return $hash->item(0)->nodeValue; |
|
67 | } |
||
68 | |||
83 |