@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | $std = $this->equilizeParameters($std, $possible); |
619 | 619 | $identificador = '#4 <infPercurso> - '; |
620 | 620 | $this->infPercurso[] = $this->dom->createElement('infPercurso'); |
621 | - $posicao = (int)count($this->infPercurso) - 1; |
|
621 | + $posicao = (int) count($this->infPercurso) - 1; |
|
622 | 622 | $this->dom->addChild( |
623 | 623 | $this->infPercurso[$posicao], |
624 | 624 | 'UFPer', |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | $identificador = '#91 <ObsCont> - '; |
698 | 698 | if (count($this->obsCont) <= 10) { |
699 | 699 | $this->obsCont[] = $this->dom->createElement('ObsCont'); |
700 | - $posicao = (int)count($this->obsCont) - 1; |
|
700 | + $posicao = (int) count($this->obsCont) - 1; |
|
701 | 701 | $this->obsCont[$posicao]->setAttribute('xCampo', $std->xCampo); |
702 | 702 | $this->dom->addChild( |
703 | 703 | $this->obsCont[$posicao], |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $identificador = '#94 <ObsFisco> - '; |
736 | 736 | if (count($this->obsFisco) <= 10) { |
737 | 737 | $this->obsFisco[] = $this->dom->createElement('ObsFisco'); |
738 | - $posicao = (int)count($this->obsFisco) - 1; |
|
738 | + $posicao = (int) count($this->obsFisco) - 1; |
|
739 | 739 | $this->obsFisco[$posicao]->setAttribute('xCampo', $std->xCampo); |
740 | 740 | $this->dom->addChild( |
741 | 741 | $this->obsFisco[$posicao], |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | $std = $this->equilizeParameters($std, $possible); |
1118 | 1118 | $identificador = '#65 <Comp> - '; |
1119 | 1119 | $this->comp[] = $this->dom->createElement('Comp'); |
1120 | - $posicao = (int)count($this->comp) - 1; |
|
1120 | + $posicao = (int) count($this->comp) - 1; |
|
1121 | 1121 | $this->dom->addChild( |
1122 | 1122 | $this->comp[$posicao], |
1123 | 1123 | 'xNome', |
@@ -1592,7 +1592,7 @@ discard block |
||
1592 | 1592 | $std = $this->equilizeParameters($std, $possible); |
1593 | 1593 | $identificador = '#257 <infQ> - '; |
1594 | 1594 | $this->infQ[] = $this->dom->createElement('infQ'); |
1595 | - $posicao = (int)count($this->infQ) - 1; |
|
1595 | + $posicao = (int) count($this->infQ) - 1; |
|
1596 | 1596 | $this->dom->addChild( |
1597 | 1597 | $this->infQ[$posicao], |
1598 | 1598 | 'qCarga', |
@@ -1622,7 +1622,7 @@ discard block |
||
1622 | 1622 | $std = $this->equilizeParameters($std, $possible); |
1623 | 1623 | $ident = '#319 <infDocRef> - '; |
1624 | 1624 | $this->infDocRef[] = $this->dom->createElement('infDocRef'); |
1625 | - $posicao = (int)count($this->infDocRef) - 1; |
|
1625 | + $posicao = (int) count($this->infDocRef) - 1; |
|
1626 | 1626 | if (!empty($std->chBPe)) { |
1627 | 1627 | $this->dom->addChild( |
1628 | 1628 | $this->infDocRef[$posicao], |
@@ -1687,7 +1687,7 @@ discard block |
||
1687 | 1687 | $std = $this->equilizeParameters($std, $possible); |
1688 | 1688 | $identificador = '#360 <seg> - '; |
1689 | 1689 | $this->seg[] = $this->dom->createElement('seg'); |
1690 | - $posicao = (int)count($this->seg) - 1; |
|
1690 | + $posicao = (int) count($this->seg) - 1; |
|
1691 | 1691 | $this->dom->addChild( |
1692 | 1692 | $this->seg[$posicao], |
1693 | 1693 | 'respSeg', |
@@ -2114,7 +2114,7 @@ discard block |
||
2114 | 2114 | $std = $this->equilizeParameters($std, $possible); |
2115 | 2115 | $identificador = '#65 <comp> - '; |
2116 | 2116 | $this->infGTVe[] = $this->dom->createElement('infGTVe'); |
2117 | - $posicao = (int)count($this->infGTVe) - 1; |
|
2117 | + $posicao = (int) count($this->infGTVe) - 1; |
|
2118 | 2118 | $this->dom->addChild( |
2119 | 2119 | $this->infGTVe[$posicao], |
2120 | 2120 | 'chCTe', |
@@ -2165,7 +2165,7 @@ discard block |
||
2165 | 2165 | false, |
2166 | 2166 | $identificador . 'Nome do componente (informar apenas para outros)' |
2167 | 2167 | ); |
2168 | - $posicao = (int)count($this->infGTVe) - 1; |
|
2168 | + $posicao = (int) count($this->infGTVe) - 1; |
|
2169 | 2169 | $this->dom->appChild($this->infGTVe[$posicao], $comp, 'Inclui Comp na tag infGTVe'); |
2170 | 2170 | return $comp; |
2171 | 2171 | } |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | $identificador = '#91 <ObsCont> - '; |
1656 | 1656 | if (count($this->obsCont) <= 10) { |
1657 | 1657 | $this->obsCont[] = $this->dom->createElement('ObsCont'); |
1658 | - $posicao = (int)count($this->obsCont) - 1; |
|
1658 | + $posicao = (int) count($this->obsCont) - 1; |
|
1659 | 1659 | $this->obsCont[$posicao]->setAttribute('xCampo', $std->xCampo); |
1660 | 1660 | $this->dom->addChild( |
1661 | 1661 | $this->obsCont[$posicao], |
@@ -1693,7 +1693,7 @@ discard block |
||
1693 | 1693 | $identificador = '#94 <ObsFisco> - '; |
1694 | 1694 | if (count($this->obsFisco) <= 10) { |
1695 | 1695 | $this->obsFisco[] = $this->dom->createElement('ObsFisco'); |
1696 | - $posicao = (int)count($this->obsFisco) - 1; |
|
1696 | + $posicao = (int) count($this->obsFisco) - 1; |
|
1697 | 1697 | $this->obsFisco[$posicao]->setAttribute('xCampo', $std->xCampo); |
1698 | 1698 | $this->dom->addChild( |
1699 | 1699 | $this->obsFisco[$posicao], |
@@ -2659,7 +2659,7 @@ discard block |
||
2659 | 2659 | $std = $this->equilizeParameters($std, $possible); |
2660 | 2660 | $identificador = '#65 <pass> - '; |
2661 | 2661 | $this->comp[] = $this->dom->createElement('Comp'); |
2662 | - $posicao = (int)count($this->comp) - 1; |
|
2662 | + $posicao = (int) count($this->comp) - 1; |
|
2663 | 2663 | $this->dom->addChild( |
2664 | 2664 | $this->comp[$posicao], |
2665 | 2665 | 'xNome', |
@@ -3157,7 +3157,7 @@ discard block |
||
3157 | 3157 | $std = $this->equilizeParameters($std, $possible); |
3158 | 3158 | $identificador = '#257 <infQ> - '; |
3159 | 3159 | $this->infQ[] = $this->dom->createElement('infQ'); |
3160 | - $posicao = (int)count($this->infQ) - 1; |
|
3160 | + $posicao = (int) count($this->infQ) - 1; |
|
3161 | 3161 | $this->dom->addChild( |
3162 | 3162 | $this->infQ[$posicao], |
3163 | 3163 | 'cUnid', |
@@ -3647,7 +3647,7 @@ discard block |
||
3647 | 3647 | $std = $this->equilizeParameters($std, $possible); |
3648 | 3648 | $identificador = '#345 <emiDocAnt> - '; |
3649 | 3649 | $this->emiDocAnt[] = $this->dom->createElement('emiDocAnt'); |
3650 | - $posicao = (int)count($this->emiDocAnt) - 1; |
|
3650 | + $posicao = (int) count($this->emiDocAnt) - 1; |
|
3651 | 3651 | if (!empty($std->CNPJ)) { |
3652 | 3652 | $this->dom->addChild( |
3653 | 3653 | $this->emiDocAnt[$posicao], |
@@ -3703,7 +3703,7 @@ discard block |
||
3703 | 3703 | $std = $this->equilizeParameters($std, $possible); |
3704 | 3704 | $identificador = '#358 <idDocAntEle> - '; |
3705 | 3705 | $this->idDocAntEle[count($this->emiDocAnt) - 1][] = $this->dom->createElement('idDocAntEle'); |
3706 | - $posicao = (int)count($this->idDocAntEle[count($this->emiDocAnt) - 1]) - 1; |
|
3706 | + $posicao = (int) count($this->idDocAntEle[count($this->emiDocAnt) - 1]) - 1; |
|
3707 | 3707 | $this->dom->addChild( |
3708 | 3708 | $this->idDocAntEle[count($this->emiDocAnt) - 1][$posicao], |
3709 | 3709 | 'chCTe', |
@@ -3732,7 +3732,7 @@ discard block |
||
3732 | 3732 | $std = $this->equilizeParameters($std, $possible); |
3733 | 3733 | $identificador = '#358 <idDocAntPap> - '; |
3734 | 3734 | $this->idDocAntPap[count($this->emiDocAnt) - 1][] = $this->dom->createElement('idDocAntPap'); |
3735 | - $posicao = (int)count($this->idDocAntPap[count($this->emiDocAnt) - 1]) - 1; |
|
3735 | + $posicao = (int) count($this->idDocAntPap[count($this->emiDocAnt) - 1]) - 1; |
|
3736 | 3736 | $this->dom->addChild( |
3737 | 3737 | $this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao], |
3738 | 3738 | 'tpDoc', |
@@ -3995,7 +3995,7 @@ discard block |
||
3995 | 3995 | $std = $this->equilizeParameters($std, $possible); |
3996 | 3996 | $identificador = '#12 <detCont> - '; |
3997 | 3997 | $this->lacre[count($this->detCont) - 1][] = $this->dom->createElement('lacre'); |
3998 | - $posicao = (int)count($this->lacre[count($this->detCont) - 1]) - 1; |
|
3998 | + $posicao = (int) count($this->lacre[count($this->detCont) - 1]) - 1; |
|
3999 | 3999 | $this->dom->addChild( |
4000 | 4000 | $this->lacre[count($this->detCont) - 1][$posicao], |
4001 | 4001 | 'nLacre', |
@@ -4022,7 +4022,7 @@ discard block |
||
4022 | 4022 | $std = $this->equilizeParameters($std, $possible); |
4023 | 4023 | $identificador = '#15 <detCont> <infNF> - '; |
4024 | 4024 | $this->infNFCont[count($this->detCont) - 1][] = $this->dom->createElement('infNF'); |
4025 | - $posicao = (int)count($this->infNFCont[count($this->detCont) - 1]) - 1; |
|
4025 | + $posicao = (int) count($this->infNFCont[count($this->detCont) - 1]) - 1; |
|
4026 | 4026 | $this->dom->addChild( |
4027 | 4027 | $this->infNFCont[count($this->detCont) - 1][$posicao], |
4028 | 4028 | 'serie', |
@@ -4056,7 +4056,7 @@ discard block |
||
4056 | 4056 | $std = $this->equilizeParameters($std, $possible); |
4057 | 4057 | $identificador = '#19 <infNFe> - '; |
4058 | 4058 | $this->infNFeCont[count($this->detCont) - 1][] = $this->dom->createElement('infNFe'); |
4059 | - $posicao = (int)count($this->infNFeCont[count($this->detCont) - 1]) - 1; |
|
4059 | + $posicao = (int) count($this->infNFeCont[count($this->detCont) - 1]) - 1; |
|
4060 | 4060 | $this->dom->addChild( |
4061 | 4061 | $this->infNFeCont[count($this->detCont) - 1][$posicao], |
4062 | 4062 | 'chave', |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | $identificador = '#91 <ObsCont> - '; |
782 | 782 | if (count($this->obsCont) <= 10) { |
783 | 783 | $this->obsCont[] = $this->dom->createElement('ObsCont'); |
784 | - $posicao = (int)count($this->obsCont) - 1; |
|
784 | + $posicao = (int) count($this->obsCont) - 1; |
|
785 | 785 | $this->obsCont[$posicao]->setAttribute('xCampo', $std->xCampo); |
786 | 786 | $this->dom->addChild( |
787 | 787 | $this->obsCont[$posicao], |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | $identificador = '#94 <ObsFisco> - '; |
820 | 820 | if (count($this->obsFisco) <= 10) { |
821 | 821 | $this->obsFisco[] = $this->dom->createElement('ObsFisco'); |
822 | - $posicao = (int)count($this->obsFisco) - 1; |
|
822 | + $posicao = (int) count($this->obsFisco) - 1; |
|
823 | 823 | $this->obsFisco[$posicao]->setAttribute('xCampo', $std->xCampo); |
824 | 824 | $this->dom->addChild( |
825 | 825 | $this->obsFisco[$posicao], |
@@ -1582,7 +1582,7 @@ discard block |
||
1582 | 1582 | $std = $this->equilizeParameters($std, $possible); |
1583 | 1583 | $identificador = '#139 <infEspecie> - '; |
1584 | 1584 | $this->infEspecie[] = $this->dom->createElement('infEspecie'); |
1585 | - $posicao = (int)count($this->infEspecie) - 1; |
|
1585 | + $posicao = (int) count($this->infEspecie) - 1; |
|
1586 | 1586 | $this->dom->addChild( |
1587 | 1587 | $this->infEspecie[$posicao], |
1588 | 1588 | 'tpEspecie', |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | $std = $this->equilizeParameters($std, $possible); |
1632 | 1632 | $identificador = '#139 <infVeiculo> - '; |
1633 | 1633 | $this->infVeiculo[] = $this->dom->createElement('infVeiculo'); |
1634 | - $posicao = (int)count($this->infVeiculo) - 1; |
|
1634 | + $posicao = (int) count($this->infVeiculo) - 1; |
|
1635 | 1635 | $this->dom->addChild( |
1636 | 1636 | $this->infVeiculo[$posicao], |
1637 | 1637 | 'placa', |
@@ -177,13 +177,12 @@ discard block |
||
177 | 177 | } |
178 | 178 | //monta a consulta |
179 | 179 | $consulta = "<distDFeInt xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">" |
180 | - . "<tpAmb>".$this->tpAmb."</tpAmb>" |
|
180 | + . "<tpAmb>" . $this->tpAmb . "</tpAmb>" |
|
181 | 181 | . "<cUFAutor>$cUF</cUFAutor>" |
182 | - . ((strlen($this->config->cnpj)==14) ? |
|
183 | - "<CNPJ>".$this->config->cnpj."</CNPJ>" : |
|
184 | - "<CPF>".$this->config->cnpj."</CPF>" |
|
182 | + . ((strlen($this->config->cnpj) == 14) ? |
|
183 | + "<CNPJ>" . $this->config->cnpj . "</CNPJ>" : "<CPF>" . $this->config->cnpj . "</CPF>" |
|
185 | 184 | ) |
186 | - . $tagNSU."</distDFeInt>"; |
|
185 | + . $tagNSU . "</distDFeInt>"; |
|
187 | 186 | //valida o xml da requisição |
188 | 187 | $this->isValid($this->urlVersion, $consulta, 'distDFeInt'); |
189 | 188 | $this->lastRequest = $consulta; |
@@ -467,7 +466,7 @@ discard block |
||
467 | 466 | $dt = new \DateTime('now', new \DateTimeZone($this->timezone)); |
468 | 467 | $dhEvento = $dt->format('Y-m-d\TH:i:sP'); |
469 | 468 | $sSeqEvento = str_pad($nSeqEvento, 3, "0", STR_PAD_LEFT); |
470 | - $eventId = "ID".$tpEvento.$chave.$sSeqEvento; |
|
469 | + $eventId = "ID" . $tpEvento . $chave . $sSeqEvento; |
|
471 | 470 | $cOrgao = UFList::getCodeByUF($uf); |
472 | 471 | $request = "<eventoCTe xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">" |
473 | 472 | . "<infEvento Id=\"$eventId\">" |
@@ -524,9 +523,8 @@ discard block |
||
524 | 523 | ); |
525 | 524 | //monta a consulta |
526 | 525 | $consulta = "<consChNFe><chNFe>$chave</chNFe></consChNFe>" |
527 | - . ((strlen($this->config->cnpj)==14) ? |
|
528 | - "<CNPJ>".$this->config->cnpj."</CNPJ>" : |
|
529 | - "<CPF>".$this->config->cnpj."</CPF>" |
|
526 | + . ((strlen($this->config->cnpj) == 14) ? |
|
527 | + "<CNPJ>" . $this->config->cnpj . "</CNPJ>" : "<CPF>" . $this->config->cnpj . "</CPF>" |
|
530 | 528 | ) |
531 | 529 | ."</distDFeInt>"; |
532 | 530 | //valida o xml da requisição |
@@ -580,8 +578,8 @@ discard block |
||
580 | 578 | . "<indOp>$indOp</indOp>" |
581 | 579 | . "<raizCNPJ>$raizCNPJ</raizCNPJ>" |
582 | 580 | . "<dadosCsc>" |
583 | - . "<idCsc>".$this->config->CSCid."</idCsc>" |
|
584 | - . "<codigoCsc>".$this->config->CSC."</codigoCsc>" |
|
581 | + . "<idCsc>" . $this->config->CSCid . "</idCsc>" |
|
582 | + . "<codigoCsc>" . $this->config->CSC . "</codigoCsc>" |
|
585 | 583 | . "</dadosCsc>" |
586 | 584 | . "</admCscNFCe>"; |
587 | 585 | } |
@@ -612,7 +610,7 @@ discard block |
||
612 | 610 | $dom->loadXML($cte); |
613 | 611 | //verifica a validade no webservice da SEFAZ |
614 | 612 | $tpAmb = $dom->getElementsByTagName('tpAmb')->item(0)->nodeValue; |
615 | - $infCTe = $dom->getElementsByTagName('infCte')->item(0); |
|
613 | + $infCTe = $dom->getElementsByTagName('infCte')->item(0); |
|
616 | 614 | $chCTe = preg_replace('/[^0-9]/', '', $infCTe->getAttribute("Id")); |
617 | 615 | $protocol = $dom->getElementsByTagName('nProt')->item(0)->nodeValue; |
618 | 616 | $digval = $dom->getElementsByTagName('DigestValue')->item(0)->nodeValue; |