@@ -48,9 +48,9 @@ |
||
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) { |
@@ -30,7 +30,7 @@ discard block |
||
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 |
||
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)) { |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $dtEmi = new DateTime($ide->getElementsByTagName('dhEmi')->item(0)->nodeValue); |
37 | 37 | $ano = $dtEmi->format('y'); |
38 | 38 | $mes = $dtEmi->format('m'); |
39 | - $tpEmis = (string)$contingency->tpEmis; |
|
39 | + $tpEmis = (string) $contingency->tpEmis; |
|
40 | 40 | $emit = $dom->getElementsByTagName('emit')->item(0); |
41 | 41 | $cnpj = $emit->getElementsByTagName('CNPJ')->item(0)->nodeValue; |
42 | 42 |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | throw DocumentsException::wrongDocument(3, "<protCTe>"); |
130 | 130 | } |
131 | 131 | $infProt = $ret->getElementsByTagName('infProt')->item(0); |
132 | - $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
132 | + $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
133 | 133 | $xMotivo = $infProt->getElementsByTagName('xMotivo')->item(0)->nodeValue; |
134 | 134 | $dig = $infProt->getElementsByTagName("digVal")->item(0); |
135 | 135 | $digProt = '000'; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | throw DocumentsException::wrongDocument(3, "<protCTe>"); |
187 | 187 | } |
188 | 188 | $infProt = $ret->getElementsByTagName('infProt')->item(0); |
189 | - $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
189 | + $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
190 | 190 | $xMotivo = $infProt->getElementsByTagName('xMotivo')->item(0)->nodeValue; |
191 | 191 | $dig = $infProt->getElementsByTagName("digVal")->item(0); |
192 | 192 | $digProt = '000'; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | // $resLote = $ret->getElementsByTagName('idLote')->item(0)->nodeValue; |
240 | 240 | //extrai a rag retEvento da resposta (retorno da SEFAZ) |
241 | 241 | $retEv = $ret->getElementsByTagName('retEventoCTe')->item(0); |
242 | - $cStat = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
242 | + $cStat = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
243 | 243 | $xMotivo = $retEv->getElementsByTagName('xMotivo')->item(0)->nodeValue; |
244 | 244 | $tpEvento = $retEv->getElementsByTagName('tpEvento')->item(0)->nodeValue; |
245 | 245 | $cStatValids = ['135', '136']; |
@@ -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', |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $signed = $this->addQRCode($dom); |
356 | 356 | } |
357 | 357 | $this->isValid($this->versao, $signed, $method); |
358 | - $modal = (int)$dom->getElementsByTagName('modal')->item(0)->nodeValue; |
|
358 | + $modal = (int) $dom->getElementsByTagName('modal')->item(0)->nodeValue; |
|
359 | 359 | if ($modelo == 57) { |
360 | 360 | switch ($modal) { |
361 | 361 | case 1: |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | protected function sendRequest($request, array $parameters = []) |
602 | 602 | { |
603 | 603 | $this->checkSoap(); |
604 | - return (string)$this->soap->send( |
|
604 | + return (string) $this->soap->send( |
|
605 | 605 | $this->urlService, |
606 | 606 | $this->urlMethod, |
607 | 607 | $this->urlAction, |
@@ -115,7 +115,7 @@ |
||
115 | 115 | ); |
116 | 116 | $type = strtoupper(str_replace('-', '', $type)); |
117 | 117 | if (empty($type)) { |
118 | - $type = (string)$list[$acronym]; |
|
118 | + $type = (string) $list[$acronym]; |
|
119 | 119 | } |
120 | 120 | $this->config = $this->configBuild($dt->getTimestamp(), $motive, $type); |
121 | 121 | return $this->__toString(); |
@@ -184,8 +184,7 @@ discard block |
||
184 | 184 | . "<tpAmb>" . $this->tpAmb . "</tpAmb>" |
185 | 185 | . "<cUFAutor>$cUF</cUFAutor>" |
186 | 186 | . ((strlen($this->config->cnpj) == 14) ? |
187 | - "<CNPJ>{$this->config->cnpj}</CNPJ>" : |
|
188 | - "<CPF>{$this->config->cnpj}</CPF>" |
|
187 | + "<CNPJ>{$this->config->cnpj}</CNPJ>" : "<CPF>{$this->config->cnpj}</CPF>" |
|
189 | 188 | ) |
190 | 189 | . $tagNSU . "</distDFeInt>"; |
191 | 190 | //valida o xml da requisição |
@@ -531,8 +530,7 @@ discard block |
||
531 | 530 | //monta a consulta |
532 | 531 | $consulta = "<consChNFe><chNFe>$chave</chNFe></consChNFe>" |
533 | 532 | . ((strlen($this->config->cnpj) == 14) ? |
534 | - "<CNPJ>{$this->config->cnpj}</CNPJ>" : |
|
535 | - "<CPF>{$this->config->cnpj}</CPF>" |
|
533 | + "<CNPJ>{$this->config->cnpj}</CNPJ>" : "<CPF>{$this->config->cnpj}</CPF>" |
|
536 | 534 | ) |
537 | 535 | . "</distDFeInt>"; |
538 | 536 | //valida o xml da requisição |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $this->dom->appChild($this->rodo, $this->infFretamento, 'Falta tag "infFretamento"'); |
301 | 301 | $this->dom->appChild($this->infModal, $this->rodo, 'Falta tag "rodo"'); |
302 | 302 | } |
303 | - if(!empty($this->infCteSub)) { // Caso seja um CT-e OS tipo substituição |
|
303 | + if (!empty($this->infCteSub)) { // Caso seja um CT-e OS tipo substituição |
|
304 | 304 | $this->dom->appChild($this->infCTeNorm, $this->infCteSub, 'Falta tag "infCteSub"'); |
305 | 305 | } |
306 | 306 | } |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | $std = $this->equilizeParameters($std, $possible); |
600 | 600 | $identificador = '#4 <infPercurso> - '; |
601 | 601 | $this->infPercurso[] = $this->dom->createElement('infPercurso'); |
602 | - $posicao = (int)count($this->infPercurso) - 1; |
|
602 | + $posicao = (int) count($this->infPercurso) - 1; |
|
603 | 603 | $this->dom->addChild( |
604 | 604 | $this->infPercurso[$posicao], |
605 | 605 | 'UFPer', |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | $identificador = '#91 <ObsCont> - '; |
679 | 679 | if (count($this->obsCont) <= 10) { |
680 | 680 | $this->obsCont[] = $this->dom->createElement('ObsCont'); |
681 | - $posicao = (int)count($this->obsCont) - 1; |
|
681 | + $posicao = (int) count($this->obsCont) - 1; |
|
682 | 682 | $this->obsCont[$posicao]->setAttribute('xCampo', $std->xCampo); |
683 | 683 | $this->dom->addChild( |
684 | 684 | $this->obsCont[$posicao], |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | $identificador = '#94 <ObsFisco> - '; |
717 | 717 | if (count($this->obsFisco) <= 10) { |
718 | 718 | $this->obsFisco[] = $this->dom->createElement('ObsFisco'); |
719 | - $posicao = (int)count($this->obsFisco) - 1; |
|
719 | + $posicao = (int) count($this->obsFisco) - 1; |
|
720 | 720 | $this->obsFisco[$posicao]->setAttribute('xCampo', $std->xCampo); |
721 | 721 | $this->dom->addChild( |
722 | 722 | $this->obsFisco[$posicao], |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | $std = $this->equilizeParameters($std, $possible); |
1107 | 1107 | $identificador = '#65 <Comp> - '; |
1108 | 1108 | $this->comp[] = $this->dom->createElement('Comp'); |
1109 | - $posicao = (int)count($this->comp) - 1; |
|
1109 | + $posicao = (int) count($this->comp) - 1; |
|
1110 | 1110 | $this->dom->addChild( |
1111 | 1111 | $this->comp[$posicao], |
1112 | 1112 | 'xNome', |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | true, |
1229 | 1229 | "$identificador Valor do ICMS" |
1230 | 1230 | ); |
1231 | - if($std->vICMSDeson > 0 && $std->cBenef) { |
|
1231 | + if ($std->vICMSDeson > 0 && $std->cBenef) { |
|
1232 | 1232 | $this->dom->addChild( |
1233 | 1233 | $icms, |
1234 | 1234 | 'vICMSDeson', |
@@ -1254,7 +1254,7 @@ discard block |
||
1254 | 1254 | true, |
1255 | 1255 | "$identificador Tributação do ICMS = 40" |
1256 | 1256 | ); |
1257 | - if($std->vICMSDeson > 0 && $std->cBenef) { |
|
1257 | + if ($std->vICMSDeson > 0 && $std->cBenef) { |
|
1258 | 1258 | $this->dom->addChild( |
1259 | 1259 | $icms, |
1260 | 1260 | 'vICMSDeson', |
@@ -1280,7 +1280,7 @@ discard block |
||
1280 | 1280 | true, |
1281 | 1281 | "$identificador Tributação do ICMS = 41" |
1282 | 1282 | ); |
1283 | - if($std->vICMSDeson > 0 && $std->cBenef) { |
|
1283 | + if ($std->vICMSDeson > 0 && $std->cBenef) { |
|
1284 | 1284 | $this->dom->addChild( |
1285 | 1285 | $icms, |
1286 | 1286 | 'vICMSDeson', |
@@ -1306,7 +1306,7 @@ discard block |
||
1306 | 1306 | true, |
1307 | 1307 | "$identificador Tributação do ICMS = 51" |
1308 | 1308 | ); |
1309 | - if($std->vICMSDeson > 0 && $std->cBenef) { |
|
1309 | + if ($std->vICMSDeson > 0 && $std->cBenef) { |
|
1310 | 1310 | $this->dom->addChild( |
1311 | 1311 | $icms, |
1312 | 1312 | 'vICMSDeson', |
@@ -1364,7 +1364,7 @@ discard block |
||
1364 | 1364 | true, |
1365 | 1365 | "$identificador Valor ICMS Outra UF" |
1366 | 1366 | ); |
1367 | - if($std->vICMSDeson > 0 && $std->cBenef) { |
|
1367 | + if ($std->vICMSDeson > 0 && $std->cBenef) { |
|
1368 | 1368 | $this->dom->addChild( |
1369 | 1369 | $icms, |
1370 | 1370 | 'vICMSDeson', |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | "$identificador Valor do Crédido" |
1429 | 1429 | ); |
1430 | 1430 | } |
1431 | - if($std->vICMSDeson > 0 && $std->cBenef) { |
|
1431 | + if ($std->vICMSDeson > 0 && $std->cBenef) { |
|
1432 | 1432 | $this->dom->addChild( |
1433 | 1433 | $icms, |
1434 | 1434 | 'vICMSDeson', |
@@ -1691,7 +1691,7 @@ discard block |
||
1691 | 1691 | $std = $this->equilizeParameters($std, $possible); |
1692 | 1692 | $ident = '#319 <infDocRef> - '; |
1693 | 1693 | $this->infDocRef[] = $this->dom->createElement('infDocRef'); |
1694 | - $posicao = (int)count($this->infDocRef) - 1; |
|
1694 | + $posicao = (int) count($this->infDocRef) - 1; |
|
1695 | 1695 | if (!empty($std->chBPe)) { |
1696 | 1696 | $this->dom->addChild( |
1697 | 1697 | $this->infDocRef[$posicao], |
@@ -1756,7 +1756,7 @@ discard block |
||
1756 | 1756 | $std = $this->equilizeParameters($std, $possible); |
1757 | 1757 | $identificador = '#360 <seg> - '; |
1758 | 1758 | $this->seg[] = $this->dom->createElement('seg'); |
1759 | - $posicao = (int)count($this->seg) - 1; |
|
1759 | + $posicao = (int) count($this->seg) - 1; |
|
1760 | 1760 | $this->dom->addChild( |
1761 | 1761 | $this->seg[$posicao], |
1762 | 1762 | 'respSeg', |
@@ -2186,7 +2186,7 @@ discard block |
||
2186 | 2186 | $std = $this->equilizeParameters($std, $possible); |
2187 | 2187 | $identificador = '#65 <comp> - '; |
2188 | 2188 | $this->infGTVe[] = $this->dom->createElement('infGTVe'); |
2189 | - $posicao = (int)count($this->infGTVe) - 1; |
|
2189 | + $posicao = (int) count($this->infGTVe) - 1; |
|
2190 | 2190 | $this->dom->addChild( |
2191 | 2191 | $this->infGTVe[$posicao], |
2192 | 2192 | 'chCTe', |
@@ -2237,7 +2237,7 @@ discard block |
||
2237 | 2237 | false, |
2238 | 2238 | $identificador . 'Nome do componente (informar apenas para outros)' |
2239 | 2239 | ); |
2240 | - $posicao = (int)count($this->infGTVe) - 1; |
|
2240 | + $posicao = (int) count($this->infGTVe) - 1; |
|
2241 | 2241 | $this->dom->appChild($this->infGTVe[$posicao], $comp, 'Inclui Comp na tag infGTVe'); |
2242 | 2242 | return $comp; |
2243 | 2243 | } |