Skip to content

Commit

Permalink
Ajustes phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
robmachado committed Jun 12, 2024
1 parent 3ddaff7 commit df3f4c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@ parameters:
count: 1
path: src/Exception/DocumentsException.php

-
message: "#^Variable \\$tpEmis might not be defined\\.$#"
count: 1
path: src/Factories/Contingency.php

6 changes: 3 additions & 3 deletions src/Common/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ class Tools
public $tpAmb = 2;
/**
* contingency class
* @var Contingency
* @var Contingency|null
*/
public $contingency;
public $contingency = null;
/**
* soap class
* @var ?SoapInterface
Expand Down Expand Up @@ -395,7 +395,7 @@ protected function isValid(string $version, string $body, string $method): bool
*/
protected function checkContingencyForWebServices(string $service)
{
$type = $this->contingency->type ?? null;
$type = !empty($this->contingency) ? $this->contingency->type : '';
$mod = $this->modelo;
if (!empty($type)) {
if ($this->modelo == 65) {
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/TraitEPECNfce.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function sefazEpecNfce(string &$xml, string $verAplic = null): string
$dom->loadXML($xml);
$infNFe = $dom->getElementsByTagName('infNFe')->item(0);
$ide = $dom->getElementsByTagName('ide')->item(0);
$tpEmis = (int) $ide->getElementsByTagName('tpEmis')->item(0)->nodeValue ?? 0;
$tpEmis = (int) $ide->getElementsByTagName('tpEmis')->item(0)->nodeValue;
$dhCont = $ide->getElementsByTagName('dhCont')->item(0)->nodeValue ?? '';
$xJust = $ide->getElementsByTagName('xJust')->item(0)->nodeValue ?? '';
if ($tpEmis !== 4 || empty($dhCont) || empty($xJust)) {
Expand Down

0 comments on commit df3f4c7

Please sign in to comment.