Skip to content

Commit

Permalink
[UPD] PHPCS PSR2
Browse files Browse the repository at this point in the history
  • Loading branch information
robmachado committed Aug 13, 2019
1 parent d08d87a commit 87849f9
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 561 deletions.
11 changes: 5 additions & 6 deletions src/Common/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ public function __construct($configJson, Certificate $certificate)
{
$this->config = json_decode($configJson);
$this->pathwsfiles = realpath(
__DIR__ . '/../../storage'
) . '/';
__DIR__ . '/../../storage'
) . '/';
$this->version($this->config->versao);
$this->setEnvironmentTimeZone($this->config->siglaUF);
$this->certificate = $certificate;
Expand Down Expand Up @@ -262,8 +262,8 @@ public function version($version = '')
$this->versao = $version;
$this->config->schemes = $this->availableVersions[$version];
$this->pathschemes = realpath(
__DIR__ . '/../../schemes/' . $this->config->schemes
) . '/';
__DIR__ . '/../../schemes/' . $this->config->schemes
) . '/';
}
return $this->versao;
}
Expand Down Expand Up @@ -440,8 +440,7 @@ protected function servico(
$uf,
$tpAmb,
$ignoreContingency = false
)
{
) {
$ambiente = $tpAmb == 1 ? "producao" : "homologacao";
$webs = new Webservices($this->getXmlUrlPath());
$sigla = $uf;
Expand Down
4 changes: 1 addition & 3 deletions src/Factories/QRCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ class QRCode
*/
public static function putQRTag(
\DOMDocument $dom
)
{
) {
$cte = $dom->getElementsByTagName('CTe')->item(0);
$infCte = $dom->getElementsByTagName('infCte')->item(0);
$ide = $dom->getElementsByTagName('ide')->item(0);
Expand All @@ -43,5 +42,4 @@ public static function putQRTag(
$dom->formatOutput = false;
return $dom->saveXML();
}

}
49 changes: 42 additions & 7 deletions src/Make.php
Original file line number Diff line number Diff line change
Expand Up @@ -3174,8 +3174,13 @@ public function taginfQ($std)
Unidade de Medida');
$this->dom->addChild($this->infQ[$posicao], 'tpMed', $std->tpMed, true, $identificador . 'Tipo da Medida');
$this->dom->addChild($this->infQ[$posicao], 'qCarga', $std->qCarga, true, $identificador . 'Quantidade');
$this->dom->addChild($this->infQ[$posicao], 'vCargaAverb', $std->vCargaAverb, false, $identificador . 'Valor da Carga para efeito de averbação');

$this->dom->addChild(
$this->infQ[$posicao],
'vCargaAverb',
$std->vCargaAverb,
false,
$identificador . 'Valor da Carga para efeito de averbação'
);
return $this->infQ[$posicao];
}

Expand Down Expand Up @@ -3381,7 +3386,13 @@ public function tagidDocAntEle($std)
$identificador = '#358 <idDocAntEle> - ';
$this->idDocAntEle[count($this->emiDocAnt) - 1][] = $this->dom->createElement('idDocAntEle');
$posicao = (int)count($this->idDocAntEle[count($this->emiDocAnt) - 1]) - 1;
$this->dom->addChild($this->idDocAntEle[count($this->emiDocAnt) - 1][$posicao], 'chCTe', $std->chCTe, true, $identificador . 'Chave de Acesso do CT-e');
$this->dom->addChild(
$this->idDocAntEle[count($this->emiDocAnt) - 1][$posicao],
'chCTe',
$std->chCTe,
true,
$identificador . 'Chave de Acesso do CT-e'
);
return $this->idDocAntEle[count($this->emiDocAnt) - 1][$posicao];
}

Expand Down Expand Up @@ -3419,10 +3430,34 @@ public function tagidDocAntPap($std)
$this->idDocAntPap[count($this->emiDocAnt) - 1][] = $this->dom->createElement('idDocAntPap');
$posicao = (int)count($this->idDocAntPap[count($this->emiDocAnt) - 1]) - 1;

$this->dom->addChild($this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao], 'tpDoc', $std->tpDoc, true, $identificador . 'Tipo do Documento de Transporte Anterior');
$this->dom->addChild($this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao], 'serie', $std->serie, true, $identificador . 'Série do Documento Fiscal');
$this->dom->addChild($this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao], 'subser', $std->subser, false, $identificador . 'Série do Documento Fiscal');
$this->dom->addChild($this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao], 'nDoc', $std->nDoc, true, $identificador . 'Número do Documento Fiscal');
$this->dom->addChild(
$this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao],
'tpDoc',
$std->tpDoc,
true,
$identificador . 'Tipo do Documento de Transporte Anterior'
);
$this->dom->addChild(
$this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao],
'serie',
$std->serie,
true,
$identificador . 'Série do Documento Fiscal'
);
$this->dom->addChild(
$this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao],
'subser',
$std->subser,
false,
$identificador . 'Série do Documento Fiscal'
);
$this->dom->addChild(
$this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao],
'nDoc',
$std->nDoc,
true,
$identificador . 'Número do Documento Fiscal'
);
$this->dom->addChild($this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao], 'dEmi', $std->dEmi, true, $identificador . 'Data de emissão (AAAA-MM-DD)');
return $this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao];
}
Expand Down
1 change: 1 addition & 0 deletions tests/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

37 changes: 0 additions & 37 deletions tests/CTeTestCase.php

This file was deleted.

30 changes: 0 additions & 30 deletions tests/Common/ValidTXTTest.php

This file was deleted.

153 changes: 0 additions & 153 deletions tests/MakeTest.php

This file was deleted.

Loading

0 comments on commit 87849f9

Please sign in to comment.