Passed
Pull Request — master (#195)
by
unknown
04:23
created
src/Complements.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace NFePHP\CTe;
4 4
 
5
-use NFePHP\Common\Strings;
6 5
 use NFePHP\CTe\Common\Standardize;
7 6
 use NFePHP\CTe\Exception\DocumentsException;
8 7
 use DOMDocument;
Please login to merge, or discard this 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
     
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             throw DocumentsException::wrongDocument(3, "<protCTe>");
129 129
         }
130 130
         $infProt = $ret->getElementsByTagName('infProt')->item(0);
131
-        $cStat  = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue;
131
+        $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue;
132 132
         $xMotivo = $infProt->getElementsByTagName('xMotivo')->item(0)->nodeValue;
133 133
         $dig = $infProt->getElementsByTagName("digVal")->item(0);
134 134
         $digProt = '000';
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             throw DocumentsException::wrongDocument(3, "<protCTe>");
186 186
         }
187 187
         $infProt = $ret->getElementsByTagName('infProt')->item(0);
188
-        $cStat  = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue;
188
+        $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue;
189 189
         $xMotivo = $infProt->getElementsByTagName('xMotivo')->item(0)->nodeValue;
190 190
         $dig = $infProt->getElementsByTagName("digVal")->item(0);
191 191
         $digProt = '000';
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 //        $resLote = $ret->getElementsByTagName('idLote')->item(0)->nodeValue;
239 239
         //extrai a rag retEvento da resposta (retorno da SEFAZ)
240 240
         $retEv = $ret->getElementsByTagName('retEventoCTe')->item(0);
241
-        $cStat  = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue;
241
+        $cStat = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue;
242 242
         $xMotivo = $retEv->getElementsByTagName('xMotivo')->item(0)->nodeValue;
243 243
         $tpEvento = $retEv->getElementsByTagName('tpEvento')->item(0)->nodeValue;
244 244
         $cStatValids = ['135', '136'];
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
     {
270 270
         $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
271 271
                 . "<$nodename versao=\"$versao\" "
272
-                . "xmlns=\"".self::$urlPortal."\">";
272
+                . "xmlns=\"" . self::$urlPortal . "\">";
273 273
         $xml .= $first;
274 274
         $xml .= $second;
275 275
         $xml .= "</$nodename>";
Please login to merge, or discard this patch.
src/Factories/Parser.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -777,7 +777,6 @@
 block discarded – undo
777 777
 
778 778
     /**
779 779
      * Create tag comb [LA]
780
-     * @param stdClass $std
781 780
      * @return void
782 781
      */
783 782
     protected function buildLAEntity()
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
  * @link      http://github.com/nfephp-org/sped-nfe for the canonical source repository
17 17
  */
18 18
 
19
-use NFePHP\Common\Strings;
20 19
 use NFePHP\CTe\Make;
21 20
 use NFePHP\CTe\Exception\DocumentsException;
22 21
 use stdClass;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     public function __construct($version = '3.10')
108 108
     {
109 109
         $ver = str_replace('.', '', $version);
110
-        $path = realpath(__DIR__."/../../storage/txtstructure$ver.json");
110
+        $path = realpath(__DIR__ . "/../../storage/txtstructure$ver.json");
111 111
         $this->structure = json_decode(file_get_contents($path), true);
112 112
         $this->make = new Make();
113 113
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             if (empty($fields)) {
139 139
                 continue;
140 140
             }
141
-            $metodo = strtolower(str_replace(' ', '', $fields[0])).'Entity';
141
+            $metodo = strtolower(str_replace(' ', '', $fields[0])) . 'Entity';
142 142
             if (!method_exists(__CLASS__, $metodo)) {
143 143
                 //campo não definido
144 144
                 throw DocumentsException::wrongDocument(16, $lin);
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     protected static function fieldsToStd($dfls, $struct)
159 159
     {
160 160
         $sfls = explode('|', $struct);
161
-        $len = count($sfls)-1;
161
+        $len = count($sfls) - 1;
162 162
         $std = new \stdClass();
163 163
         for ($i = 1; $i < $len; $i++) {
164 164
             $name = $sfls[$i];
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
         $this->stdPIS->CST = $std->CST;
1232 1232
         $this->stdPIS->vPIS = $std->vPIS;
1233 1233
         $this->stdPIS->qBCProd = $std->qBCProd;
1234
-        $this->stdPIS->vAliqProd  = $std->vAliqProd;
1234
+        $this->stdPIS->vAliqProd = $std->vAliqProd;
1235 1235
         $this->buildQEntity();
1236 1236
     }
1237 1237
 
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
     protected function q10Entity($std)
1283 1283
     {
1284 1284
         $this->stdPIS->qBCProd = $std->qBCProd;
1285
-        $this->stdPIS->vAliqProd  = $std->vAliqProd;
1285
+        $this->stdPIS->vAliqProd = $std->vAliqProd;
1286 1286
         $this->buildQEntity();
1287 1287
     }
1288 1288
 
Please login to merge, or discard this patch.
src/Factories/Protocol.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     /**
26 26
      * Add protocol to xml
27 27
      * @param string $xmlnfe xml
28
-     * @param string $protocol response xml
28
+     * @param string $xmlprotocol response xml
29 29
      * @return string
30 30
      * @throws InvalidArgumentException
31 31
      */
Please login to merge, or discard this patch.
src/Make.php 4 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
 use NFePHP\Common\DOMImproved as Dom;
18 18
 use NFePHP\Common\Strings;
19 19
 use stdClass;
20
-use RuntimeException;
21 20
 use DOMElement;
22 21
 use DateTime;
23 22
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3536,9 +3536,9 @@
 block discarded – undo
3536 3536
         $identificador = '#1 <rodoOS> - ';
3537 3537
         $this->rodo = $this->dom->createElement('rodoOS');
3538 3538
         $this->dom->addChild($this->rodo, 'TAF', $std->TAF, false, $identificador .
3539
-                             'Termo de Autorização de Fretamento - TAF');
3539
+                                'Termo de Autorização de Fretamento - TAF');
3540 3540
         $this->dom->addChild($this->rodo, 'NroRegEstadual', $std->nroRegEstadual, false, $identificador .
3541
-                             'Número do Registro Estadual');
3541
+                                'Número do Registro Estadual');
3542 3542
 
3543 3543
         return $this->rodo;
3544 3544
     }
Please login to merge, or discard this patch.
Doc Comments   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1272,7 +1272,6 @@  discard block
 block discarded – undo
1272 1272
      * e adiciona ao grupo ide
1273 1273
      * #35
1274 1274
      * Nível: 2
1275
-     * @param string $toma Tomador do Serviço
1276 1275
      * @param  stdClass $std
1277 1276
      * @return \DOMElement
1278 1277
      */
@@ -1967,6 +1966,7 @@  discard block
 block discarded – undo
1967 1966
      * Os parâmetros para esta função são todos os elementos da tag "ObsCont" do
1968 1967
      * tipo elemento (Ele = E|CE|A) e nível 3
1969 1968
      *
1969
+     * @param stdClass $std
1970 1970
      * @return boolean
1971 1971
      */
1972 1972
     public function tagobsCont($std)
@@ -2000,6 +2000,7 @@  discard block
 block discarded – undo
2000 2000
      * Os parâmetros para esta função são todos os elementos da tag "ObsFisco" do tipo
2001 2001
      * elemento (Ele = E|CE|A) e nível 3
2002 2002
      *
2003
+     * @param stdClass $std
2003 2004
      * @return boolean
2004 2005
      */
2005 2006
     public function tagobsFisco($std)
@@ -2033,6 +2034,7 @@  discard block
 block discarded – undo
2033 2034
      * Os parâmetros para esta função são todos os elementos da tag "emit" do
2034 2035
      * tipo elemento (Ele = E|CE|A) e nível 2
2035 2036
      *
2037
+     * @param stdClass $std
2036 2038
      * @return \DOMElement
2037 2039
      */
2038 2040
     public function tagemit($std)
@@ -2084,6 +2086,7 @@  discard block
 block discarded – undo
2084 2086
      * Os parâmetros para esta função são todos os elementos da tag "enderEmit" do
2085 2087
      * tipo elemento (Ele = E|CE|A) e nível 3
2086 2088
      *
2089
+     * @param stdClass $std
2087 2090
      * @return \DOMElement
2088 2091
      */
2089 2092
     public function tagenderEmit($std)
@@ -2680,6 +2683,7 @@  discard block
 block discarded – undo
2680 2683
      * Os parâmetros para esta função são todos os elementos da tag "dest" do
2681 2684
      * tipo elemento (Ele = E|CE|A) e nível 2
2682 2685
      *
2686
+     * @param stdClass $std
2683 2687
      * @return \DOMElement
2684 2688
      */
2685 2689
     public function tagdest($std)
@@ -2769,6 +2773,7 @@  discard block
 block discarded – undo
2769 2773
      * Os parâmetros para esta função são todos os elementos da tag "enderDest" do
2770 2774
      * tipo elemento (Ele = E|CE|A) e nível 3
2771 2775
      *
2776
+     * @param stdClass $std
2772 2777
      * @return \DOMElement
2773 2778
      */
2774 2779
     public function tagenderDest($std)
@@ -2916,6 +2921,7 @@  discard block
 block discarded – undo
2916 2921
      * Informações relativas ao ICMS
2917 2922
      * #194
2918 2923
      *
2924
+     * @param stdClass $std
2919 2925
      * @return DOMElement
2920 2926
      */
2921 2927
     public function tagicms($std)
@@ -3370,6 +3376,7 @@  discard block
 block discarded – undo
3370 3376
      * Gera as tags para o elemento: "infNFe" (Informações das NF-e)
3371 3377
      * #297
3372 3378
      * Nível: 3
3379
+     * @param stdClass $std
3373 3380
      * @return mixed
3374 3381
      */
3375 3382
     public function taginfNFe($std)
@@ -3532,7 +3539,6 @@  discard block
 block discarded – undo
3532 3539
      * Gera as tags para o elemento: "infModal" (Informações do modal)
3533 3540
      * #366
3534 3541
      * Nível: 2
3535
-     * @param string $versaoModal
3536 3542
      * @return DOMElement|\DOMNode
3537 3543
      */
3538 3544
     public function taginfModal($std)
@@ -3701,7 +3707,6 @@  discard block
 block discarded – undo
3701 3707
     
3702 3708
     /**
3703 3709
      * CT-e de substituição - tomaICMS
3704
-     * @param type $std
3705 3710
      * @return type
3706 3711
      */
3707 3712
     public function tagtomaICMS()
@@ -3713,7 +3718,7 @@  discard block
 block discarded – undo
3713 3718
     
3714 3719
     /**
3715 3720
      * CT-e de substituição - NF-e
3716
-     * @param type $std
3721
+     * @param stdClass $std
3717 3722
      * @return type
3718 3723
      */
3719 3724
     public function tagrefNFe($std)
@@ -3735,7 +3740,7 @@  discard block
 block discarded – undo
3735 3740
     
3736 3741
     /**
3737 3742
      * CT-e de substituição - NF
3738
-     * @param type $std
3743
+     * @param stdClass $std
3739 3744
      * @return type
3740 3745
      */
3741 3746
     public function tagrefNF($std)
@@ -3778,7 +3783,7 @@  discard block
 block discarded – undo
3778 3783
     
3779 3784
     /**
3780 3785
      * CT-e de substituição - CT-e
3781
-     * @param type $std
3786
+     * @param stdClass $std
3782 3787
      * @return type
3783 3788
      */
3784 3789
     public function tagrefCTe($std)
@@ -4102,6 +4107,7 @@  discard block
 block discarded – undo
4102 4107
      * Nível: 1
4103 4108
      * Os parâmetros para esta função são todos os elementos da tag "autXML"
4104 4109
      *
4110
+     * @param stdClass $std
4105 4111
      * @return boolean
4106 4112
      */
4107 4113
     public function tagautXML($std)
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -676,12 +676,12 @@  discard block
 block discarded – undo
676 676
             }
677 677
 
678 678
             $this->dom->appChild($this->infCTeNorm, $this->infModal, 'Falta tag "infModal"');
679
-            if ($this->modal=='01') {
679
+            if ($this->modal == '01') {
680 680
                 $this->dom->appChild($this->infModal, $this->rodo, 'Falta tag "rodo"');
681 681
                 foreach ($this->veic as $veic) {
682 682
                     $this->dom->appChild($this->rodo, $veic, 'Falta tag "veic"');
683 683
                 }
684
-            } elseif ($this->modal=='02') {
684
+            } elseif ($this->modal == '02') {
685 685
                 $this->dom->appChild($this->infModal, $this->aereo, 'Falta tag "aereo"');
686 686
             } else {
687 687
                 throw new Exception('Modal não informado ou não suportado.');
@@ -1255,7 +1255,7 @@  discard block
 block discarded – undo
1255 1255
     {
1256 1256
         $identificador = '#4 <infPercurso> - ';
1257 1257
         $this->infPercurso[] = $this->dom->createElement('infPercurso');
1258
-        $posicao = (integer)count($this->infPercurso) - 1;
1258
+        $posicao = (integer) count($this->infPercurso) - 1;
1259 1259
         $this->dom->addChild(
1260 1260
             $this->infPercurso[$posicao],
1261 1261
             'UFPer',
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
             true,
2047 2047
             $identificador . 'CNPJ do emitente'
2048 2048
         );
2049
-        if( $std->IE != '' ){
2049
+        if ($std->IE != '') {
2050 2050
             $this->dom->addChild(
2051 2051
                 $this->emit,
2052 2052
                 'IE',
@@ -2895,7 +2895,7 @@  discard block
 block discarded – undo
2895 2895
     {
2896 2896
         $identificador = '#65 <pass> - ';
2897 2897
         $this->comp[] = $this->dom->createElement('Comp');
2898
-        $posicao = (integer)count($this->comp) - 1;
2898
+        $posicao = (integer) count($this->comp) - 1;
2899 2899
         $this->dom->addChild(
2900 2900
             $this->comp[$posicao],
2901 2901
             'xNome',
@@ -3301,7 +3301,7 @@  discard block
 block discarded – undo
3301 3301
     {
3302 3302
         $identificador = '#257 <infQ> - ';
3303 3303
         $this->infQ[] = $this->dom->createElement('infQ');
3304
-        $posicao = (integer)count($this->infQ) - 1;
3304
+        $posicao = (integer) count($this->infQ) - 1;
3305 3305
         $this->dom->addChild($this->infQ[$posicao], 'cUnid', $std->cUnid, true, $identificador . 'Código da
3306 3306
             Unidade de Medida');
3307 3307
         $this->dom->addChild($this->infQ[$posicao], 'tpMed', $std->tpMed, true, $identificador . 'Tipo da Medida');
@@ -3346,7 +3346,7 @@  discard block
 block discarded – undo
3346 3346
     {
3347 3347
         $identificador = '#262 <infNF> - ';
3348 3348
         $this->infNF[] = $this->dom->createElement('infNF');
3349
-        $posicao = (integer)count($this->infNF) - 1;
3349
+        $posicao = (integer) count($this->infNF) - 1;
3350 3350
 
3351 3351
         $this->dom->addChild($this->infNF[$posicao], 'nRoma', $std->nRoma, false, $identificador . 'Número do
3352 3352
             Romaneio da NF');
@@ -3387,7 +3387,7 @@  discard block
 block discarded – undo
3387 3387
     {
3388 3388
         $identificador = '#297 <infNFe> - ';
3389 3389
         $this->infNFe[] = $this->dom->createElement('infNFe');
3390
-        $posicao = (integer)count($this->infNFe) - 1;
3390
+        $posicao = (integer) count($this->infNFe) - 1;
3391 3391
         $this->dom->addChild(
3392 3392
             $this->infNFe[$posicao],
3393 3393
             'chave',
@@ -3422,7 +3422,7 @@  discard block
 block discarded – undo
3422 3422
     {
3423 3423
         $ident = '#319 <infOutros> - ';
3424 3424
         $this->infOutros[] = $this->dom->createElement('infOutros');
3425
-        $posicao = (integer)count($this->infOutros) - 1;
3425
+        $posicao = (integer) count($this->infOutros) - 1;
3426 3426
         $this->dom->addChild($this->infOutros[$posicao], 'tpDoc', $std->tpDoc, true, $ident . 'Tipo '
3427 3427
             . 'de documento originário');
3428 3428
         $this->dom->addChild($this->infOutros[$posicao], 'descOutros', $std->descOutros, false, $ident . 'Descrição '
@@ -3447,7 +3447,7 @@  discard block
 block discarded – undo
3447 3447
     {
3448 3448
         $ident = '#319 <infDocRef> - ';
3449 3449
         $this->infDocRef[] = $this->dom->createElement('infDocRef');
3450
-        $posicao = (integer)count($this->infDocRef) - 1;
3450
+        $posicao = (integer) count($this->infDocRef) - 1;
3451 3451
         $this->dom->addChild($this->infDocRef[$posicao], 'nDoc', $std->nDoc, false, $ident . 'Número '
3452 3452
             . 'do documento');
3453 3453
         $this->dom->addChild($this->infDocRef[$posicao], 'serie', $std->serie, false, $ident . 'Série '
@@ -3470,7 +3470,7 @@  discard block
 block discarded – undo
3470 3470
     {
3471 3471
         $identificador = '#345 <emiDocAnt> - ';
3472 3472
         $this->emiDocAnt[] = $this->dom->createElement('emiDocAnt');
3473
-        $posicao = (integer)count($this->emiDocAnt) - 1;
3473
+        $posicao = (integer) count($this->emiDocAnt) - 1;
3474 3474
         if ($std->CNPJ != '') {
3475 3475
             $this->dom->addChild(
3476 3476
                 $this->emiDocAnt[$posicao],
@@ -3511,7 +3511,7 @@  discard block
 block discarded – undo
3511 3511
     {
3512 3512
         $identificador = '#358 <idDocAntEle> - ';
3513 3513
         $this->idDocAntEle[] = $this->dom->createElement('idDocAntEle');
3514
-        $posicao = (integer)count($this->idDocAntEle) - 1;
3514
+        $posicao = (integer) count($this->idDocAntEle) - 1;
3515 3515
         $this->dom->addChild($this->idDocAntEle[$posicao], 'chCTe', $std->chCTe, true, $identificador . 'Chave de '
3516 3516
             . 'Acesso do CT-e');
3517 3517
 
@@ -3529,7 +3529,7 @@  discard block
 block discarded – undo
3529 3529
     {
3530 3530
         $identificador = '#360 <seg> - ';
3531 3531
         $this->seg[] = $this->dom->createElement('seg');
3532
-        $posicao = (integer)count($this->seg) - 1;
3532
+        $posicao = (integer) count($this->seg) - 1;
3533 3533
 
3534 3534
         $this->dom->addChild($this->seg[$posicao], 'respSeg', $std->respSeg, true, $identificador . 'Responsável
3535 3535
             pelo Seguro');
@@ -3821,7 +3821,7 @@  discard block
 block discarded – undo
3821 3821
     {
3822 3822
         $identificador = '#21 <veic> - ';
3823 3823
         $this->veic[] = $this->dom->createElement('veic');
3824
-        $posicao = (integer)count($this->veic) - 1;
3824
+        $posicao = (integer) count($this->veic) - 1;
3825 3825
         if ($std->cInt != '') {
3826 3826
             $this->dom->addChild(
3827 3827
                 $this->veic[$posicao],
@@ -3903,7 +3903,7 @@  discard block
 block discarded – undo
3903 3903
         );
3904 3904
         if ($std->tpProp == 'T') { // CASO FOR VEICULO DE TERCEIRO
3905 3905
             $this->prop[] = $this->dom->createElement('prop');
3906
-            $p = (integer)count($this->prop) - 1;
3906
+            $p = (integer) count($this->prop) - 1;
3907 3907
             if ($std->CNPJ != '') {
3908 3908
                 $this->dom->addChild(
3909 3909
                     $this->prop[$p],
Please login to merge, or discard this patch.
src/Tools.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 use NFePHP\Common\Strings;
20 20
 use NFePHP\Common\Signer;
21 21
 use NFePHP\Common\UFList;
22
-use NFePHP\CTe\Factories\Events;
23 22
 use NFePHP\CTe\Common\Tools as ToolsCommon;
24 23
 use RuntimeException;
25 24
 use InvalidArgumentException;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
     /**
93 93
      * Request authorization to issue CTe OS with one document only
94 94
      * @param type $xml
95
-     * @return type
95
+     * @return string
96 96
      */
97 97
     public function sefazEnviaCTeOS($xml)
98 98
     {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         if ($compactar) {
82 82
             $gzdata = base64_encode(gzencode($cons, 9, FORCE_GZIP));
83 83
             $body = "<cteDadosMsgZip xmlns=\"$this->urlNamespace\">$gzdata</cteDadosMsgZip>";
84
-            $method = $this->urlMethod."Zip";
84
+            $method = $this->urlMethod . "Zip";
85 85
             $parameters = ['cteDadosMsgZip' => $gzdata];
86 86
             $body = "<cteDadosMsgZip xmlns=\"$this->urlNamespace\">$gzdata</cteDadosMsgZip>";
87 87
         }
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
         }
375 375
         //monta a consulta
376 376
         $consulta = "<distDFeInt xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
377
-            . "<tpAmb>".$this->tpAmb."</tpAmb>"
377
+            . "<tpAmb>" . $this->tpAmb . "</tpAmb>"
378 378
             . "<cUFAutor>$cUF</cUFAutor>"
379
-            . "<CNPJ>".$this->config->cnpj."</CNPJ>$tagNSU</distDFeInt>";
379
+            . "<CNPJ>" . $this->config->cnpj . "</CNPJ>$tagNSU</distDFeInt>";
380 380
         //valida o xml da requisição
381 381
         $this->isValid($this->urlVersion, $consulta, 'distDFeInt');
382 382
         $this->lastRequest = $consulta;
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
         $dt = new \DateTime();
667 667
         $dhEvento = $dt->format('Y-m-d\TH:i:sP');
668 668
         $sSeqEvento = str_pad($nSeqEvento, 2, "0", STR_PAD_LEFT);
669
-        $eventId = "ID".$tpEvento.$chave.$sSeqEvento;
669
+        $eventId = "ID" . $tpEvento . $chave . $sSeqEvento;
670 670
         $cOrgao = UFList::getCodeByUF($uf);
671 671
 
672 672
         $request = "<eventoCTe xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
@@ -731,9 +731,9 @@  discard block
 block discarded – undo
731 731
         $tagChave = "<consChNFe><chNFe>$chave</chNFe></consChNFe>";
732 732
         //monta a consulta
733 733
         $consulta = "<distDFeInt xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
734
-            . "<tpAmb>".$this->tpAmb."</tpAmb>"
734
+            . "<tpAmb>" . $this->tpAmb . "</tpAmb>"
735 735
             . "<cUFAutor>$cUF</cUFAutor>"
736
-            . "<CNPJ>".$this->config->cnpj."</CNPJ>$tagChave</distDFeInt>";
736
+            . "<CNPJ>" . $this->config->cnpj . "</CNPJ>$tagChave</distDFeInt>";
737 737
         //valida o xml da requisição
738 738
         $this->isValid($this->urlVersion, $consulta, 'distDFeInt');
739 739
         $this->lastRequest = $consulta;
@@ -785,8 +785,8 @@  discard block
 block discarded – undo
785 785
             . "<indOp>$indOp</indOp>"
786 786
             . "<raizCNPJ>$raizCNPJ</raizCNPJ>"
787 787
             . "<dadosCsc>"
788
-            . "<idCsc>".$this->config->CSCid."</idCsc>"
789
-            . "<codigoCsc>".$this->config->CSC."</codigoCsc>"
788
+            . "<idCsc>" . $this->config->CSCid . "</idCsc>"
789
+            . "<codigoCsc>" . $this->config->CSC . "</codigoCsc>"
790 790
             . "</dadosCsc>"
791 791
             . "</admCscNFCe>";
792 792
         }
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
         $dom->loadXML($cte);
818 818
         //verifica a validade no webservice da SEFAZ
819 819
         $tpAmb = $dom->getElementsByTagName('tpAmb')->item(0)->nodeValue;
820
-        $infCTe  = $dom->getElementsByTagName('infCte')->item(0);
820
+        $infCTe = $dom->getElementsByTagName('infCte')->item(0);
821 821
         $chCTe = preg_replace('/[^0-9]/', '', $infCTe->getAttribute("Id"));
822 822
         $protocol = $dom->getElementsByTagName('nProt')->item(0)->nodeValue;
823 823
         $digval = $dom->getElementsByTagName('DigestValue')->item(0)->nodeValue;
Please login to merge, or discard this patch.
src/Common/Tools.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      * Canonical conversion options
97 97
      * @var array
98 98
      */
99
-    protected $canonical = [true,false,null,null];
99
+    protected $canonical = [true, false, null, null];
100 100
     /**
101 101
      * Model of CTe 57 or 67
102 102
      * @var int
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         $this->config = json_decode($configJson);
184 184
         $this->pathwsfiles = realpath(
185 185
             __DIR__ . '/../../storage'
186
-        ).'/';
186
+        ) . '/';
187 187
         $this->version($this->config->versao);
188 188
         $this->setEnvironmentTimeZone($this->config->siglaUF);
189 189
         $this->certificate = $certificate;
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
             $this->versao = $version;
262 262
             $this->config->schemes = $this->availableVersions[$version];
263 263
             $this->pathschemes = realpath(
264
-                __DIR__ . '/../../schemes/'. $this->config->schemes
265
-            ).'/';
264
+                __DIR__ . '/../../schemes/' . $this->config->schemes
265
+            ) . '/';
266 266
         }
267 267
         return $this->versao;
268 268
     }
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     protected function isValid($version, $body, $method)
359 359
     {
360
-        $schema = $this->pathschemes.$method."_v$version.xsd";
360
+        $schema = $this->pathschemes . $method . "_v$version.xsd";
361 361
         if (!is_file($schema)) {
362 362
             return true;
363 363
         }
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
      * @param array $opt
424 424
      * @return array
425 425
      */
426
-    public function canonicalOptions($opt = [true,false,null,null])
426
+    public function canonicalOptions($opt = [true, false, null, null])
427 427
     {
428 428
         if (!empty($opt) && is_array($opt)) {
429 429
             $this->canonical = $opt;
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
     {
540 540
         $file = $this->pathwsfiles
541 541
             . DIRECTORY_SEPARATOR
542
-            . "wscte_".$this->versao."_mod57.xml";
543
-        if (! file_exists($file)) {
542
+            . "wscte_" . $this->versao . "_mod57.xml";
543
+        if (!file_exists($file)) {
544 544
             return '';
545 545
         }
546 546
         return file_get_contents($file);
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
         //os URI estão em storage/uri_consulta_nfce.json
591 591
         $std = json_decode(
592 592
             file_get_contents(
593
-                $this->pathwsfiles.'uri_consulta_nfce.json'
593
+                $this->pathwsfiles . 'uri_consulta_nfce.json'
594 594
             )
595 595
         );
596 596
         return $std->$uf;
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
@@ -48,9 +48,9 @@
 block discarded – undo
48 48
      */
49 49
     protected static function validInputData(stdClass $data)
50 50
     {
51
-        $filejsonschema = __DIR__. "/../../storage/config_json.schema";
51
+        $filejsonschema = __DIR__ . "/../../storage/config_json.schema";
52 52
         $validator = new JsonValid();
53
-        $validator->check($data, (object)['$ref' => 'file://' . $filejsonschema]);
53
+        $validator->check($data, (object) ['$ref' => 'file://' . $filejsonschema]);
54 54
         if (!$validator->isValid()) {
55 55
             $msg = "";
56 56
             foreach ($validator->getErrors() as $error) {
Please login to merge, or discard this patch.
src/Common/ValidTXT.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     {
31 31
         $path = realpath(__DIR__ . "/../../storage");
32 32
         $json = file_get_contents(
33
-            $path . '/txtstructure' . ($version*100) . '.json'
33
+            $path . '/txtstructure' . ($version * 100) . '.json'
34 34
         );
35 35
         self::$entities = json_decode($json, true);
36 36
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             if ($default != $count) {
82 82
                 self::$errors[] = "ERRO: O número de parâmetros na linha "
83 83
                     . "está errado (esperado #$default) -> (encontrado #$count). [ $row ] Esperado [ "
84
-                    . self::$entities[$ref]." ]";
84
+                    . self::$entities[$ref] . " ]";
85 85
             }
86 86
             foreach ($fields as $field) {
87 87
                 if ($field != trim($field)) {
Please login to merge, or discard this patch.