Passed
Push — master ( 46aa78...f4050b )
by Roberto
06:59 queued 02:00
created
src/Certificate/Oids.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     private static function loadOids()
53 53
     {
54
-        $json = file_get_contents(__DIR__ .'/oids.json');
54
+        $json = file_get_contents(__DIR__ . '/oids.json');
55 55
         self::$oidsTable = (array) json_decode($json, true);
56 56
     }
57 57
 }
Please login to merge, or discard this patch.
src/Soap/SoapClientExtended.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function __doRequest($request, $location, $action, $version, $oneWay = 0)
32 32
     {
33
-        $search = [":ns1","ns1:","\n","\r"];
33
+        $search = [":ns1", "ns1:", "\n", "\r"];
34 34
         return parent::__doRequest(
35 35
             str_replace($search, '', $request),
36 36
             $location,
Please login to merge, or discard this patch.
src/Soap/SoapCode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 {
23 23
     public static function info($code)
24 24
     {
25
-        $codes = (array) json_decode(file_get_contents(__DIR__.'/httpcodes.json'), true);
25
+        $codes = (array) json_decode(file_get_contents(__DIR__ . '/httpcodes.json'), true);
26 26
         if (array_key_exists($code, $codes)) {
27 27
             return $codes[$code];
28 28
         }
Please login to merge, or discard this patch.
src/Exception/ExceptionCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
      */
88 88
     public function __toString()
89 89
     {
90
-        $messages = array_map(function (\Exception $exception) {
90
+        $messages = array_map(function(\Exception $exception) {
91 91
             return $exception->getMessage();
92 92
         }, $this->exceptions);
93 93
         return implode(PHP_EOL, $messages);
Please login to merge, or discard this patch.
src/Exception/ValidatorException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@
 block discarded – undo
17 17
     {
18 18
         $msg = '';
19 19
         foreach ($errors as $error) {
20
-            $msg .= $error."\n";
20
+            $msg .= $error . "\n";
21 21
         }
22
-        return new static('This XML is not valid. '.$msg);
22
+        return new static('This XML is not valid. ' . $msg);
23 23
     }
24 24
     
25 25
     public static function isNotXml()
Please login to merge, or discard this patch.
src/Validator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         $dom->formatOutput = false;
40 40
         $dom->loadXML($xml, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG);
41 41
         libxml_clear_errors();
42
-        if (! $dom->schemaValidate($xsd)) {
42
+        if (!$dom->schemaValidate($xsd)) {
43 43
             $errors = [];
44 44
             foreach (libxml_get_errors() as $error) {
45 45
                 $errors[] = $error->message;
Please login to merge, or discard this patch.
src/Strings.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
     public static function replaceSpecialsChars($string)
24 24
     {
25 25
         $string = trim($string);
26
-        $aFind = ['&','á','à','ã','â','é','ê','í','ó','ô','õ','ú','ü',
27
-            'ç','Á','À','Ã','Â','É','Ê','Í','Ó','Ô','Õ','Ú','Ü','Ç'];
28
-        $aSubs = ['e','a','a','a','a','e','e','i','o','o','o','u','u',
29
-            'c','A','A','A','A','E','E','I','O','O','O','U','U','C'];
26
+        $aFind = ['&', 'á', 'à', 'ã', 'â', 'é', 'ê', 'í', 'ó', 'ô', 'õ', 'ú', 'ü',
27
+            'ç', 'Á', 'À', 'Ã', 'Â', 'É', 'Ê', 'Í', 'Ó', 'Ô', 'Õ', 'Ú', 'Ü', 'Ç'];
28
+        $aSubs = ['e', 'a', 'a', 'a', 'a', 'e', 'e', 'i', 'o', 'o', 'o', 'u', 'u',
29
+            'c', 'A', 'A', 'A', 'A', 'E', 'E', 'I', 'O', 'O', 'O', 'U', 'U', 'C'];
30 30
         $newstr = str_replace($aFind, $aSubs, $string);
31 31
         $newstr = preg_replace("/[^a-zA-Z0-9 @,-_.;:\/]/", "", $newstr);
32 32
         return $newstr;
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
     public static function clearProtocoledXML($string)
95 95
     {
96 96
         $procXML = self::clearXmlString($string);
97
-        $aApp = array('nfe','cte','mdfe');
97
+        $aApp = array('nfe', 'cte', 'mdfe');
98 98
         foreach ($aApp as $app) {
99 99
             $procXML = str_replace(
100
-                'xmlns="http://www.portalfiscal.inf.br/'.$app.'" xmlns="http://www.w3.org/2000/09/xmldsig#"',
101
-                'xmlns="http://www.portalfiscal.inf.br/'.$app.'"',
100
+                'xmlns="http://www.portalfiscal.inf.br/' . $app . '" xmlns="http://www.w3.org/2000/09/xmldsig#"',
101
+                'xmlns="http://www.portalfiscal.inf.br/' . $app . '"',
102 102
                 $procXML
103 103
             );
104 104
         }
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
     public static function removeSomeAlienCharsfromTxt($txt)
114 114
     {
115 115
         //remove CRs and TABs
116
-        $txt = str_replace(["\r","\t"], "", $txt);
116
+        $txt = str_replace(["\r", "\t"], "", $txt);
117 117
         //remove multiple spaces
118 118
         $txt = preg_replace('/(?:\s\s+)/', ' ', $txt);
119 119
         //remove spaces at begin and end of fields
120
-        $txt = str_replace(["| "," |"], "|", $txt);
120
+        $txt = str_replace(["| ", " |"], "|", $txt);
121 121
         return $txt;
122 122
     }
123 123
     
Please login to merge, or discard this patch.
src/Certificate/Exception/Expired.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,6 +10,6 @@
 block discarded – undo
10 10
     public function __construct(Certificate $certificate)
11 11
     {
12 12
         $invalidDate = $certificate->getValidFrom()->format('Y-m-d H:i');
13
-        parent::__construct('Certificate invalid from '.$invalidDate, 0, null);
13
+        parent::__construct('Certificate invalid from ' . $invalidDate, 0, null);
14 14
     }
15 15
 }
Please login to merge, or discard this patch.
src/Signer.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 class Signer
37 37
 {
38
-    private static $canonical = [true,false,null,null];
38
+    private static $canonical = [true, false, null, null];
39 39
     
40 40
     /**
41 41
      * Make Signature tag
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $tagname,
56 56
         $mark = 'Id',
57 57
         $algorithm = OPENSSL_ALGO_SHA1,
58
-        $canonical = [true,false,null,null],
58
+        $canonical = [true, false, null, null],
59 59
         $rootname = ''
60 60
     ) {
61 61
         if (!empty($canonical)) {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         if (empty($content)) {
65 65
             throw SignerException::isNotXml();
66 66
         }
67
-        if (! Validator::isXML($content)) {
67
+        if (!Validator::isXML($content)) {
68 68
             throw SignerException::isNotXml();
69 69
         }
70 70
         $dom = new DOMDocument('1.0', 'UTF-8');
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         if (empty($node) || empty($root)) {
80 80
             throw SignerException::tagNotFound($tagname);
81 81
         }
82
-        if (! self::existsSignature($content)) {
82
+        if (!self::existsSignature($content)) {
83 83
             $dom = self::createSignature(
84 84
                 $certificate,
85 85
                 $dom,
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         DOMElement $node,
113 113
         $mark,
114 114
         $algorithm = OPENSSL_ALGO_SHA1,
115
-        $canonical = [true,false,null,null]
115
+        $canonical = [true, false, null, null]
116 116
     ) {
117 117
         $nsDSIG = 'http://www.w3.org/2000/09/xmldsig#';
118 118
         $nsCannonMethod = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315';
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $nsSignatureMethod = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256';
125 125
             $nsDigestMethod = 'http://www.w3.org/2001/04/xmlenc#sha256';
126 126
         }
127
-        $nsTransformMethod1 ='http://www.w3.org/2000/09/xmldsig#enveloped-signature';
127
+        $nsTransformMethod1 = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature';
128 128
         $nsTransformMethod2 = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315';
129 129
         $idSigned = trim($node->getAttribute($mark));
130 130
         $digestValue = self::makeDigest($node, $digestAlgorithm, $canonical);
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      */
180 180
     public static function removeSignature($content)
181 181
     {
182
-        if (! self::existsSignature($content)) {
182
+        if (!self::existsSignature($content)) {
183 183
             return $content;
184 184
         }
185 185
         $dom = new \DOMDocument('1.0', 'utf-8');
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     public static function isSigned(
208 208
         $content,
209 209
         $tagname = '',
210
-        $canonical = [true,false,null,null]
210
+        $canonical = [true, false, null, null]
211 211
     ) {
212 212
         if (self::existsSignature($content)) {
213 213
             if (self::digestCheck($content, $tagname, $canonical)) {
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
      */
227 227
     public static function existsSignature($content)
228 228
     {
229
-        if (! Validator::isXML($content)) {
229
+        if (!Validator::isXML($content)) {
230 230
             throw SignerException::isNotXml();
231 231
         }
232 232
         $dom = new \DOMDocument('1.0', 'utf-8');
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
      */
249 249
     private static function signatureCheck(
250 250
         $xml,
251
-        $canonical = [true,false,null,null]
251
+        $canonical = [true, false, null, null]
252 252
     ) {
253 253
         $dom = new \DOMDocument('1.0', 'utf-8');
254 254
         $dom->formatOutput = false;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
         $decodedSignature = base64_decode(
275 275
             str_replace(array("\r", "\n"), '', $signatureValue)
276 276
         );
277
-        if (! $publicKey->verify($signInfoNode, $decodedSignature, $algorithm)) {
277
+        if (!$publicKey->verify($signInfoNode, $decodedSignature, $algorithm)) {
278 278
             throw SignerException::signatureComparisonFailed();
279 279
         }
280 280
         return true;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     private static function digestCheck(
291 291
         $xml,
292 292
         $tagname = '',
293
-        $canonical = [true,false,null,null]
293
+        $canonical = [true, false, null, null]
294 294
     ) {
295 295
         $dom = new \DOMDocument('1.0', 'utf-8');
296 296
         $dom->formatOutput = false;
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
     private static function makeDigest(
347 347
         DOMNode $node,
348 348
         $algorithm,
349
-        $canonical = [true,false,null,null]
349
+        $canonical = [true, false, null, null]
350 350
     ) {
351 351
         //calcular o hash dos dados
352 352
         $c14n = self::canonize($node, $canonical);
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
      */
363 363
     private static function canonize(
364 364
         DOMNode $node,
365
-        $canonical = [true,false,null,null]
365
+        $canonical = [true, false, null, null]
366 366
     ) {
367 367
         return $node->C14N(
368 368
             $canonical[0],
Please login to merge, or discard this patch.