Passed
Pull Request — master (#179)
by
unknown
02:25
created
src/Certificate/Asn1.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             //get length of OID data
75 75
             $len = self::getLength($data);
76 76
             //get only a string with bytes belongs to OID
77
-            $oidData = substr($data, 2 + $bytes, $len-($bytes));
77
+            $oidData = substr($data, 2 + $bytes, $len - ($bytes));
78 78
             //parse OID data many possibel formats and structures
79 79
             $head = strlen($oidData) - strlen($xcv) - 2;
80 80
             $ret = substr($oidData, -$head);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             if ($num == 0) {
119 119
                 $bun = 40 * $partes[$num];
120 120
             } elseif ($num == 1) {
121
-                $bun +=  $partes[$num];
121
+                $bun += $partes[$num];
122 122
                 $abBinary[] = $bun;
123 123
             } else {
124 124
                 $abBinary = self::xBase128($abBinary, (integer) $partes[$num], true);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     {
143 143
         $abc = $abIn;
144 144
         if ($qIn > 127) {
145
-            $abc = self::xBase128($abc, floor($qIn/128), false);
145
+            $abc = self::xBase128($abc, floor($qIn / 128), false);
146 146
         }
147 147
         $qIn2 = $qIn % 128;
148 148
         if ($flag) {
Please login to merge, or discard this patch.
src/Signer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 class Signer
34 34
 {
35
-    const CANONICAL = [true,false,null,null];
35
+    const CANONICAL = [true, false, null, null];
36 36
     
37 37
     /**
38 38
      * Make Signature tag
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         if (empty($content)) {
59 59
             throw SignerException::isNotXml();
60 60
         }
61
-        if (! Validator::isXML($content)) {
61
+        if (!Validator::isXML($content)) {
62 62
             throw SignerException::isNotXml();
63 63
         }
64 64
         $dom = new DOMDocument('1.0', 'UTF-8');
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         if (empty($node) || empty($root)) {
74 74
             throw SignerException::tagNotFound($tagname);
75 75
         }
76
-        if (! self::existsSignature($content)) {
76
+        if (!self::existsSignature($content)) {
77 77
             $dom = self::createSignature(
78 78
                 $certificate,
79 79
                 $dom,
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $nsSignatureMethod = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256';
119 119
             $nsDigestMethod = 'http://www.w3.org/2001/04/xmlenc#sha256';
120 120
         }
121
-        $nsTransformMethod1 ='http://www.w3.org/2000/09/xmldsig#enveloped-signature';
121
+        $nsTransformMethod1 = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature';
122 122
         $nsTransformMethod2 = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315';
123 123
         $idSigned = trim($node->getAttribute($mark));
124 124
         $digestValue = self::makeDigest($node, $digestAlgorithm, $canonical);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      */
174 174
     public static function removeSignature($content)
175 175
     {
176
-        if (! self::existsSignature($content)) {
176
+        if (!self::existsSignature($content)) {
177 177
             return $content;
178 178
         }
179 179
         $dom = new \DOMDocument('1.0', 'utf-8');
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public static function existsSignature($content)
221 221
     {
222
-        if (! Validator::isXML($content)) {
222
+        if (!Validator::isXML($content)) {
223 223
             throw SignerException::isNotXml();
224 224
         }
225 225
         $dom = new \DOMDocument('1.0', 'utf-8');
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         $decodedSignature = base64_decode(
268 268
             str_replace(array("\r", "\n"), '', $signatureValue)
269 269
         );
270
-        if (! $publicKey->verify($signInfoNode, $decodedSignature, $algorithm)) {
270
+        if (!$publicKey->verify($signInfoNode, $decodedSignature, $algorithm)) {
271 271
             throw SignerException::signatureComparisonFailed();
272 272
         }
273 273
         return true;
Please login to merge, or discard this patch.