@@ -39,7 +39,7 @@ |
||
39 | 39 | * @param Certificate $certificate |
40 | 40 | * @param string $content |
41 | 41 | * @param string $tagname |
42 | - * @param string $marker for URI |
|
42 | + * @param string $mark for URI |
|
43 | 43 | * @param string $algorithm |
44 | 44 | * @param array $canonical parameters to format node for signature |
45 | 45 | * @param string $rootname name of tag to insert signature block |
@@ -25,10 +25,8 @@ |
||
25 | 25 | use NFePHP\Common\Certificate; |
26 | 26 | use NFePHP\Common\Certificate\PublicKey; |
27 | 27 | use NFePHP\Common\Exception\SignerException; |
28 | -use NFePHP\Common\Strings; |
|
29 | 28 | use DOMDocument; |
30 | 29 | use DOMNode; |
31 | -use DOMElement; |
|
32 | 30 | |
33 | 31 | class Signer |
34 | 32 | { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | class Signer |
34 | 34 | { |
35 | - private static $canonical = [false,false,null,null]; |
|
35 | + private static $canonical = [false, false, null, null]; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Make Signature tag |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $tagname = '', |
53 | 53 | $mark = 'Id', |
54 | 54 | $algorithm = OPENSSL_ALGO_SHA1, |
55 | - $canonical = [false,false,null,null], |
|
55 | + $canonical = [false, false, null, null], |
|
56 | 56 | $rootname = '' |
57 | 57 | ) { |
58 | 58 | if (!empty($canonical)) { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | if (empty($node) || empty($root)) { |
71 | 71 | throw SignerException::tagNotFound($tagname); |
72 | 72 | } |
73 | - if (! self::existsSignature($dom)) { |
|
73 | + if (!self::existsSignature($dom)) { |
|
74 | 74 | $dom = self::createSignature( |
75 | 75 | $certificate, |
76 | 76 | $dom, |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | DOMNode $node, |
137 | 137 | $mark, |
138 | 138 | $algorithm = OPENSSL_ALGO_SHA1, |
139 | - $canonical = [false,false,null,null] |
|
139 | + $canonical = [false, false, null, null] |
|
140 | 140 | ) { |
141 | 141 | $nsDSIG = 'http://www.w3.org/2000/09/xmldsig#'; |
142 | 142 | $nsCannonMethod = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $nsSignatureMethod = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'; |
149 | 149 | $nsDigestMethod = 'http://www.w3.org/2001/04/xmlenc#sha256'; |
150 | 150 | } |
151 | - $nsTransformMethod1 ='http://www.w3.org/2000/09/xmldsig#enveloped-signature'; |
|
151 | + $nsTransformMethod1 = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature'; |
|
152 | 152 | $nsTransformMethod2 = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'; |
153 | 153 | $idSigned = trim($node->getAttribute($mark)); |
154 | 154 | $digestValue = self::makeDigest($node, $digestAlgorithm, $canonical); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | { |
250 | 250 | $node = $dom->getElementsByTagName($tagname)->item(0); |
251 | 251 | if (empty($node)) { |
252 | - throw new \RuntimeException('Tag not found ' .$tagname); |
|
252 | + throw new \RuntimeException('Tag not found ' . $tagname); |
|
253 | 253 | } |
254 | 254 | $signature = $dom->getElementsByTagName('Signature')->item(0); |
255 | 255 | if (empty($signature)) { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | * @param array $canonical |
287 | 287 | * @return string |
288 | 288 | */ |
289 | - private static function makeDigest(DOMNode $node, $algorithm, $canonical = [false,false,null,null]) |
|
289 | + private static function makeDigest(DOMNode $node, $algorithm, $canonical = [false, false, null, null]) |
|
290 | 290 | { |
291 | 291 | //calcular o hash dos dados |
292 | 292 | $c14n = $node->C14N( |