@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * type "sequence", as the first element of the structure |
| 40 | 40 | * @param string $publickeyUnformated |
| 41 | 41 | * @param string $oidNumber OID formated number |
| 42 | - * @return array |
|
| 42 | + * @return string |
|
| 43 | 43 | */ |
| 44 | 44 | public static function getOIDdata($oidNumber, $publickeyUnformated) |
| 45 | 45 | { |
@@ -88,8 +88,6 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * Get length of data field of a sequency from certifcate |
| 91 | - * @param integer $len |
|
| 92 | - * @param integer $bytes |
|
| 93 | 91 | * @param string $data |
| 94 | 92 | * @return integer |
| 95 | 93 | */ |
@@ -142,7 +140,7 @@ discard block |
||
| 142 | 140 | * @param array $abIn |
| 143 | 141 | * @param integer $qIn |
| 144 | 142 | * @param boolean $flag |
| 145 | - * @return integer |
|
| 143 | + * @return integer[] |
|
| 146 | 144 | */ |
| 147 | 145 | protected static function xBase128($abIn, $qIn, $flag) |
| 148 | 146 | { |
@@ -24,7 +24,6 @@ |
||
| 24 | 24 | |
| 25 | 25 | use NFePHP\Common\Certificate; |
| 26 | 26 | use NFePHP\Common\Certificate\PublicKey; |
| 27 | -use NFePHP\Common\Strings; |
|
| 28 | 27 | use RuntimeException; |
| 29 | 28 | use DOMDocument; |
| 30 | 29 | use DOMElement; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | class Signer |
| 33 | 33 | { |
| 34 | - private static $canonical = [false,false,null,null]; |
|
| 34 | + private static $canonical = [false, false, null, null]; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Make Signature tag |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $tagname = '', |
| 51 | 51 | $mark = 'Id', |
| 52 | 52 | $algorithm = OPENSSL_ALGO_SHA1, |
| 53 | - $canonical = [false,false,null,null], |
|
| 53 | + $canonical = [false, false, null, null], |
|
| 54 | 54 | $rootname = '' |
| 55 | 55 | ) { |
| 56 | 56 | if (!empty($canonical)) { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | 'Tag not found ' . $tagname . ' ' . $rootname |
| 71 | 71 | ); |
| 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 | DOMElement $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); |
@@ -250,10 +250,10 @@ discard block |
||
| 250 | 250 | $root = $dom->documentElement; |
| 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 | - if (! empty($signature)) { |
|
| 256 | + if (!empty($signature)) { |
|
| 257 | 257 | $clone = $signature->cloneNode(true); |
| 258 | 258 | } else { |
| 259 | 259 | $signature = $dom->getElementsByTagName('Signature')->item(0); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | * @param array $canonical |
| 289 | 289 | * @return string |
| 290 | 290 | */ |
| 291 | - private static function makeDigest(DOMElement $node, $algorithm, $canonical = [false,false,null,null]) |
|
| 291 | + private static function makeDigest(DOMElement $node, $algorithm, $canonical = [false, false, null, null]) |
|
| 292 | 292 | { |
| 293 | 293 | $dados = $node->C14N(true, false, null, null); |
| 294 | 294 | //calcular o hash dos dados |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | /** |
| 198 | 198 | * Set security protocol |
| 199 | 199 | * @param int $protocol |
| 200 | - * @return type Description |
|
| 200 | + * @return integer Description |
|
| 201 | 201 | */ |
| 202 | 202 | public function protocol($protocol = self::SSL_DEFAULT) |
| 203 | 203 | { |
@@ -248,6 +248,7 @@ discard block |
||
| 248 | 248 | * @param string $operation |
| 249 | 249 | * @param array $namespaces |
| 250 | 250 | * @param \SOAPHeader $header |
| 251 | + * @param integer $soapver |
|
| 251 | 252 | * @return string |
| 252 | 253 | */ |
| 253 | 254 | protected function makeEnvelopeSoap( |
@@ -316,6 +317,7 @@ discard block |
||
| 316 | 317 | |
| 317 | 318 | /** |
| 318 | 319 | * Delete all files in folder |
| 320 | + * @param string $folder |
|
| 319 | 321 | */ |
| 320 | 322 | public function removeTemporarilyFiles($folder) |
| 321 | 323 | { |