@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * Make Signature tag |
39 | 39 | * @param string $content |
40 | 40 | * @param string $tagname |
41 | - * @param string $marker for URI |
|
41 | + * @param string $mark for URI |
|
42 | 42 | * @param string $algorithm |
43 | 43 | * @param array $canonical parameters to format node for signature |
44 | 44 | * @param string $rootname name of tag to insert signature block |
@@ -104,7 +104,6 @@ discard block |
||
104 | 104 | |
105 | 105 | /** |
106 | 106 | * Verify if xml signature is valid |
107 | - * @param string $content xml content |
|
108 | 107 | * @param string $tagname tag for sign |
109 | 108 | * @return boolean |
110 | 109 | */ |
@@ -241,8 +240,6 @@ discard block |
||
241 | 240 | /** |
242 | 241 | * digestCheck |
243 | 242 | * Verify digest value |
244 | - * @param string $content |
|
245 | - * @param string $tagid |
|
246 | 243 | * @return boolean |
247 | 244 | * @throws SignerException |
248 | 245 | */ |
@@ -25,7 +25,6 @@ |
||
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 RuntimeException; |
30 | 29 | use DOMDocument; |
31 | 30 | use DOMElement; |
@@ -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 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $tagname = '', |
52 | 52 | $mark = 'Id', |
53 | 53 | $algorithm = OPENSSL_ALGO_SHA1, |
54 | - $canonical = [false,false,null,null], |
|
54 | + $canonical = [false, false, null, null], |
|
55 | 55 | $rootname = '' |
56 | 56 | ) { |
57 | 57 | if (!empty($canonical)) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | 'Tag not found ' . $tagname . ' ' . $rootname |
72 | 72 | ); |
73 | 73 | } |
74 | - if (! self::existsSignature($dom)) { |
|
74 | + if (!self::existsSignature($dom)) { |
|
75 | 75 | $dom = self::createSignature( |
76 | 76 | $certificate, |
77 | 77 | $dom, |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | DOMElement $node, |
138 | 138 | $mark, |
139 | 139 | $algorithm = OPENSSL_ALGO_SHA1, |
140 | - $canonical = [false,false,null,null] |
|
140 | + $canonical = [false, false, null, null] |
|
141 | 141 | ) { |
142 | 142 | $nsDSIG = 'http://www.w3.org/2000/09/xmldsig#'; |
143 | 143 | $nsCannonMethod = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $nsSignatureMethod = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'; |
150 | 150 | $nsDigestMethod = 'http://www.w3.org/2001/04/xmlenc#sha256'; |
151 | 151 | } |
152 | - $nsTransformMethod1 ='http://www.w3.org/2000/09/xmldsig#enveloped-signature'; |
|
152 | + $nsTransformMethod1 = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature'; |
|
153 | 153 | $nsTransformMethod2 = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'; |
154 | 154 | $idSigned = trim($node->getAttribute($mark)); |
155 | 155 | $digestValue = self::makeDigest($node, $digestAlgorithm, $canonical); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | { |
251 | 251 | $node = $dom->getElementsByTagName($tagname)->item(0); |
252 | 252 | if (empty($node)) { |
253 | - throw new \RuntimeException('Tag not found ' .$tagname); |
|
253 | + throw new \RuntimeException('Tag not found ' . $tagname); |
|
254 | 254 | } |
255 | 255 | $signature = $dom->getElementsByTagName('Signature')->item(0); |
256 | 256 | if (empty($signature)) { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * @param array $canonical |
288 | 288 | * @return string |
289 | 289 | */ |
290 | - private static function makeDigest(DOMElement $node, $algorithm, $canonical = [false,false,null,null]) |
|
290 | + private static function makeDigest(DOMElement $node, $algorithm, $canonical = [false, false, null, null]) |
|
291 | 291 | { |
292 | 292 | //calcular o hash dos dados |
293 | 293 | $c14n = $node->C14N( |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use NFePHP\Common\Soap\SoapBase; |
20 | 20 | use NFePHP\Common\Soap\SoapInterface; |
21 | 21 | use NFePHP\Common\Exception\SoapException; |
22 | -use SoapHeader; |
|
23 | 22 | use SoapFault; |
24 | 23 | use NFePHP\Common\Certificate; |
25 | 24 | use Psr\Log\LoggerInterface; |
@@ -374,9 +374,9 @@ discard block |
||
374 | 374 | ); |
375 | 375 | } |
376 | 376 | $this->certsdir = $this->certificate->getCnpj() . '/certs/'; |
377 | - $this->prifile = $this->certsdir. Strings::randomString(10).'.pem'; |
|
378 | - $this->pubfile = $this->certsdir . Strings::randomString(10).'.pem'; |
|
379 | - $this->certfile = $this->certsdir . Strings::randomString(10).'.pem'; |
|
377 | + $this->prifile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
378 | + $this->pubfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
379 | + $this->certfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
380 | 380 | $ret = true; |
381 | 381 | //cria uma senha temporária ALEATÓRIA para salvar a chave primaria |
382 | 382 | //portanto mesmo que localizada e identificada não estará acessível |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | //utilize a API. Outra solução para remover arquivos "perdidos" pode ser |
424 | 424 | //encontrada oportunamente. |
425 | 425 | $dt = new \DateTime(); |
426 | - $tint = new \DateInterval("PT".$this->waitingTime."M"); |
|
426 | + $tint = new \DateInterval("PT" . $this->waitingTime . "M"); |
|
427 | 427 | $tint->invert = true; |
428 | 428 | $tsLimit = $dt->add($tint)->getTimestamp(); |
429 | 429 | foreach ($contents as $item) { |