Passed
Pull Request — master (#684)
by
unknown
02:30
created
src/Convert.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -109,15 +109,15 @@
 block discarded – undo
109 109
             if (substr($linha, 0, 2) == 'A|') {
110 110
                 $resp[$xCount]['init'] = $iCount;
111 111
                 if ($xCount > 0) {
112
-                    $resp[$xCount -1]['fim'] = $iCount;
112
+                    $resp[$xCount - 1]['fim'] = $iCount;
113 113
                 }
114 114
                 $xCount += 1;
115 115
             }
116 116
             $iCount += 1;
117 117
         }
118
-        $resp[$xCount-1]['fim'] = $iCount;
118
+        $resp[$xCount - 1]['fim'] = $iCount;
119 119
         foreach ($resp as $marc) {
120
-            $length = $marc['fim']-$marc['init'];
120
+            $length = $marc['fim'] - $marc['init'];
121 121
             $aNotas[] = array_slice($array, $marc['init'], $length, false);
122 122
         }
123 123
         return $aNotas;
Please login to merge, or discard this patch.
src/Factories/ContingencyNFe.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
             $cNF
76 76
         );
77 77
         $ide->getElementsByTagName('cDV')->item(0)->nodeValue = substr($chave, -1);
78
-        $infNFe->setAttribute('Id', 'NFe'.$chave);
78
+        $infNFe->setAttribute('Id', 'NFe' . $chave);
79 79
         return Strings::clearXmlString($dom->saveXML(), true);
80 80
     }
81 81
 }
Please login to merge, or discard this patch.
src/Common/FakePretty.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         $html .= '<h2>body</h2>';
67 67
         $html .= str_replace(
68 68
             ['<', '>'],
69
-            ['&lt;','&gt;'],
69
+            ['&lt;', '&gt;'],
70 70
             str_replace(
71 71
                 '<?xml version="1.0"?>',
72 72
                 '<?xml version="1.0" encoding="UTF-8"?>',
Please login to merge, or discard this patch.
src/Complements.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
             //wrong document, this document is not able to recieve a protocol
26 26
             throw DocumentsException::wrongDocument(0, $key);
27 27
         }
28
-        $func = "add".$key."Protocol";
28
+        $func = "add" . $key . "Protocol";
29 29
         return self::$func($request, $response);
30 30
     }
31 31
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $node2 = $procb2b->importNode($nodeb2b, true);
73 73
         $nfeProcB2B->appendChild($node2);
74 74
         $nfeb2bXML = $procb2b->saveXML();
75
-        $nfeb2bXMLString = str_replace(array("\n","\r","\s"), '', $nfeb2bXML);
75
+        $nfeb2bXMLString = str_replace(array("\n", "\r", "\s"), '', $nfeb2bXML);
76 76
         return (string) $nfeb2bXMLString;
77 77
     }
78 78
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                     //205 NFe Denegada
258 258
                     //301 Uso denegado por irregularidade fiscal do emitente
259 259
                     //302 Uso denegado por irregularidade fiscal do destinatário
260
-                    $cstatpermit = ['100', '150', '110', '205', '301','302'];
260
+                    $cstatpermit = ['100', '150', '110', '205', '301', '302'];
261 261
                     if (!in_array($cStat, $cstatpermit)) {
262 262
                         throw DocumentsException::wrongDocument(4, "[$cStat] $xMotivo");
263 263
                     }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         $resLote = $ret->getElementsByTagName('idLote')->item(0)->nodeValue;
304 304
         //extrai a rag retEvento da resposta (retorno da SEFAZ)
305 305
         $retEv = $ret->getElementsByTagName('retEvento')->item(0);
306
-        $cStat  = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue;
306
+        $cStat = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue;
307 307
         $xMotivo = $retEv->getElementsByTagName('xMotivo')->item(0)->nodeValue;
308 308
         $tpEvento = $retEv->getElementsByTagName('tpEvento')->item(0)->nodeValue;
309 309
         $cStatValids = ['135', '136'];
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
     {
340 340
         $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
341 341
                 . "<$nodename versao=\"$versao\" "
342
-                . "xmlns=\"".self::$urlPortal."\">";
342
+                . "xmlns=\"" . self::$urlPortal . "\">";
343 343
         $xml .= $first;
344 344
         $xml .= $second;
345 345
         $xml .= "</$nodename>";
Please login to merge, or discard this patch.
src/Factories/QRCode.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
         $tpEmis,
145 145
         $cDest
146 146
     ) {
147
-        $ver = $versao/100;
147
+        $ver = $versao / 100;
148 148
         $cscId = (int) $idToken;
149 149
         $csc = $token;
150 150
         if (strpos($url, '?p=') === false) {
151
-            $url = $url.'?p=';
151
+            $url = $url . '?p=';
152 152
         }
153 153
         if ($tpEmis != 9) {
154 154
             //emissão on-line
155 155
             $seq = "$chNFe|$ver|$tpAmb|$cscId";
156
-            $hash = strtoupper(sha1($seq.$csc));
156
+            $hash = strtoupper(sha1($seq . $csc));
157 157
             return "$url$seq|$hash";
158 158
         }
159 159
         //emissão off-line
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $valor = number_format($vNF, 2, '.', '');
163 163
         $digHex = self::str2Hex($digVal);
164 164
         $seq = "$chNFe|$ver|$tpAmb|$dia|$valor|$digHex|$cscId";
165
-        $hash = strtoupper(sha1($seq.$csc));
165
+        $hash = strtoupper(sha1($seq . $csc));
166 166
         return "$url$seq|$hash";
167 167
     }
168 168
 
Please login to merge, or discard this patch.
src/Tools.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
         }
341 341
         //monta a consulta
342 342
         $consulta = "<distDFeInt xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
343
-            . "<tpAmb>".$this->tpAmb."</tpAmb>"
343
+            . "<tpAmb>" . $this->tpAmb . "</tpAmb>"
344 344
             . "<cUFAutor>$cUF</cUFAutor>";
345 345
         if ($this->typePerson === 'J') {
346 346
             $consulta .= "<CNPJ>$cnpj</CNPJ>";
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
             $dt = new \DateTime();
581 581
             $dhEvento = $dt->format('Y-m-d\TH:i:sP');
582 582
             $sSeqEvento = str_pad($evt->nSeqEvento, 2, "0", STR_PAD_LEFT);
583
-            $eventId = "ID".$evt->tpEvento.$evt->chave.$sSeqEvento;
583
+            $eventId = "ID" . $evt->tpEvento . $evt->chave . $sSeqEvento;
584 584
             $cOrgao = UFList::getCodeByUF($uf);
585 585
             $request = "<evento xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
586 586
                 . "<infEvento Id=\"$eventId\">"
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
         $dt = new \DateTime();
728 728
         $dhEvento = $dt->format('Y-m-d\TH:i:sP');
729 729
         $sSeqEvento = str_pad($nSeqEvento, 2, "0", STR_PAD_LEFT);
730
-        $eventId = "ID".$tpEvento.$chave.$sSeqEvento;
730
+        $eventId = "ID" . $tpEvento . $chave . $sSeqEvento;
731 731
         $cOrgao = UFList::getCodeByUF($uf);
732 732
         $request = "<evento xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
733 733
             . "<infEvento Id=\"$eventId\">"
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
             $this->canonical
760 760
         );
761 761
         $request = Strings::clearXmlString($request, true);
762
-        $lote = $dt->format('YmdHis').rand(0, 9);
762
+        $lote = $dt->format('YmdHis') . rand(0, 9);
763 763
         $request = "<envEvento xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
764 764
             . "<idLote>$lote</idLote>"
765 765
             . $request
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
         $cnpj = $this->config->cnpj;
795 795
         //monta a consulta
796 796
         $request = "<distDFeInt xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
797
-            . "<tpAmb>".$this->tpAmb."</tpAmb>"
797
+            . "<tpAmb>" . $this->tpAmb . "</tpAmb>"
798 798
             . "<cUFAutor>$cUF</cUFAutor>";
799 799
         if ($this->typePerson === 'J') {
800 800
             $request .= "<CNPJ>$cnpj</CNPJ>";
@@ -852,8 +852,8 @@  discard block
 block discarded – undo
852 852
             . "<indOp>$indOp</indOp>"
853 853
             . "<raizCNPJ>$raizCNPJ</raizCNPJ>"
854 854
             . "<dadosCsc>"
855
-            . "<idCsc>".$this->config->CSCid."</idCsc>"
856
-            . "<codigoCsc>".$this->config->CSC."</codigoCsc>"
855
+            . "<idCsc>" . $this->config->CSCid . "</idCsc>"
856
+            . "<codigoCsc>" . $this->config->CSC . "</codigoCsc>"
857 857
             . "</dadosCsc>"
858 858
             . "</admCscNFCe>";
859 859
         }
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
         $dom->loadXML($nfe);
886 886
         //verifica a validade no webservice da SEFAZ
887 887
         $tpAmb = $dom->getElementsByTagName('tpAmb')->item(0)->nodeValue;
888
-        $infNFe  = $dom->getElementsByTagName('infNFe')->item(0);
888
+        $infNFe = $dom->getElementsByTagName('infNFe')->item(0);
889 889
         $chNFe = preg_replace('/[^0-9]/', '', $infNFe->getAttribute("Id"));
890 890
         $protocol = $dom->getElementsByTagName('nProt')->item(0)->nodeValue;
891 891
         $digval = $dom->getElementsByTagName('DigestValue')->item(0)->nodeValue;
Please login to merge, or discard this patch.
src/Common/Config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@
 block discarded – undo
46 46
      */
47 47
     protected static function validInputData($data)
48 48
     {
49
-        $filejsonschema = __DIR__. "/../../storage/config.schema";
49
+        $filejsonschema = __DIR__ . "/../../storage/config.schema";
50 50
         $validator = new JsonValid();
51
-        $validator->check($data, (object)['$ref' => 'file://' . $filejsonschema]);
51
+        $validator->check($data, (object) ['$ref' => 'file://' . $filejsonschema]);
52 52
         if (!$validator->isValid()) {
53 53
             $msg = "";
54 54
             foreach ($validator->getErrors() as $error) {
Please login to merge, or discard this patch.
src/Common/Tools.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * Canonical conversion options
98 98
      * @var array
99 99
      */
100
-    protected $canonical = [true,false,null,null];
100
+    protected $canonical = [true, false, null, null];
101 101
     /**
102 102
      * Model of NFe 55 or 65
103 103
      * @var int
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
         $this->versao = $version;
300 300
         $this->config->schemes = $this->availableVersions[$version];
301 301
         $this->pathschemes = realpath(
302
-            __DIR__ . '/../../schemes/'. $this->config->schemes
303
-        ).'/';
302
+            __DIR__ . '/../../schemes/' . $this->config->schemes
303
+        ) . '/';
304 304
 
305 305
         return $this->versao;
306 306
     }
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
      */
401 401
     protected function isValid($version, $body, $method)
402 402
     {
403
-        $schema = $this->pathschemes.$method."_v$version.xsd";
403
+        $schema = $this->pathschemes . $method . "_v$version.xsd";
404 404
         if (!is_file($schema)) {
405 405
             return true;
406 406
         }
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
         }
548 548
         
549 549
         $path = $this->pathwsfiles . $file;
550
-        if (! file_exists($path)) {
550
+        if (!file_exists($path)) {
551 551
             return '';
552 552
         }
553 553
         return file_get_contents($path);
Please login to merge, or discard this patch.
src/Factories/Parser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             $comp = "_v1.2";
122 122
         }
123 123
         $this->baselayout = $baselayout;
124
-        $path = realpath(__DIR__."/../../storage/txtstructure$ver" . $comp . ".json");
124
+        $path = realpath(__DIR__ . "/../../storage/txtstructure$ver" . $comp . ".json");
125 125
         $this->structure = json_decode(file_get_contents($path), true);
126 126
         $this->make = new Make();
127 127
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             if (empty($fields)) {
153 153
                 continue;
154 154
             }
155
-            $metodo = strtolower(str_replace(' ', '', $fields[0])).'Entity';
155
+            $metodo = strtolower(str_replace(' ', '', $fields[0])) . 'Entity';
156 156
             if (!method_exists(__CLASS__, $metodo)) {
157 157
                 throw DocumentsException::wrongDocument(16, $lin); //campo não definido
158 158
             }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     protected static function fieldsToStd($dfls, $struct)
172 172
     {
173 173
         $sfls = explode('|', $struct);
174
-        $len = count($sfls)-1;
174
+        $len = count($sfls) - 1;
175 175
         $std = new \stdClass();
176 176
         for ($i = 1; $i < $len; $i++) {
177 177
             $name = $sfls[$i];
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
         $this->stdPIS->CST = $std->CST;
1223 1223
         $this->stdPIS->vPIS = $std->vPIS;
1224 1224
         $this->stdPIS->qBCProd = $std->qBCProd;
1225
-        $this->stdPIS->vAliqProd  = $std->vAliqProd;
1225
+        $this->stdPIS->vAliqProd = $std->vAliqProd;
1226 1226
         $this->buildQEntity();
1227 1227
     }
1228 1228
 
@@ -1273,7 +1273,7 @@  discard block
 block discarded – undo
1273 1273
     protected function q10Entity($std)
1274 1274
     {
1275 1275
         $this->stdPIS->qBCProd = $std->qBCProd;
1276
-        $this->stdPIS->vAliqProd  = $std->vAliqProd;
1276
+        $this->stdPIS->vAliqProd = $std->vAliqProd;
1277 1277
         $this->buildQEntity();
1278 1278
     }
1279 1279
 
Please login to merge, or discard this patch.