Completed
Pull Request — master (#110)
by Roberto
02:29
created
src/Signer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.