@@ -72,7 +72,7 @@ |
||
| 72 | 72 | //então se não puderem ser simultâneas aqui podemos remover qq um dos itens |
| 73 | 73 | //adicionais |
| 74 | 74 | if ($this->std->cnpj != null) { |
| 75 | - $this->std->cpf = null; |
|
| 75 | + $this->std->cpf = null; |
|
| 76 | 76 | $this->std->idestrangeiro = null; |
| 77 | 77 | } elseif ($this->std->cpf != null) { |
| 78 | 78 | $this->std->idestrangeiro = null; |
@@ -142,16 +142,16 @@ discard block |
||
| 142 | 142 | $tpEmis, |
| 143 | 143 | $cDest |
| 144 | 144 | ) { |
| 145 | - $ver = $versao/100; |
|
| 145 | + $ver = $versao / 100; |
|
| 146 | 146 | $cscId = (int) $idToken; |
| 147 | 147 | $csc = $token; |
| 148 | 148 | if (strpos($url, '?p=') === false) { |
| 149 | - $url = $url.'?p='; |
|
| 149 | + $url = $url . '?p='; |
|
| 150 | 150 | } |
| 151 | 151 | if ($tpEmis != 9) { |
| 152 | 152 | //emissão on-line |
| 153 | 153 | $seq = "$chNFe|$ver|$tpAmb|$cscId"; |
| 154 | - $hash = strtoupper(sha1($seq.$csc)); |
|
| 154 | + $hash = strtoupper(sha1($seq . $csc)); |
|
| 155 | 155 | return "$url$seq|$hash"; |
| 156 | 156 | } |
| 157 | 157 | //emissão off-line |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $valor = number_format($vNF, 2, '.', ''); |
| 161 | 161 | $digHex = self::str2Hex($digVal); |
| 162 | 162 | $seq = "$chNFe|$ver|$tpAmb|$dia|$valor|$digHex|$cscId"; |
| 163 | - $hash = strtoupper(sha1($seq.$csc)); |
|
| 163 | + $hash = strtoupper(sha1($seq . $csc)); |
|
| 164 | 164 | return "$url$seq|$hash"; |
| 165 | 165 | } |
| 166 | 166 | |
@@ -295,8 +295,8 @@ |
||
| 295 | 295 | $mdec = strpos($n[1], '-'); |
| 296 | 296 | $numberasstring = number_format($value, 0, '.', ''); |
| 297 | 297 | $p = explode('.', $value); |
| 298 | - $ndec = !empty($p[1]) ? strlen((string) $p[1]) : 0;//decimal digits |
|
| 299 | - $nint = strlen($numberasstring);//integer digits |
|
| 298 | + $ndec = !empty($p[1]) ? strlen((string) $p[1]) : 0; //decimal digits |
|
| 299 | + $nint = strlen($numberasstring); //integer digits |
|
| 300 | 300 | if ($nint > $n[0]) { |
| 301 | 301 | $this->errors[] = "O numero [$value] é maior que o permitido [$format]."; |
| 302 | 302 | return $value; |
@@ -231,7 +231,7 @@ |
||
| 231 | 231 | $dt = new \DateTime(); |
| 232 | 232 | $dhEvento = $dt->format('Y-m-d\TH:i:sP'); |
| 233 | 233 | $sSeqEvento = str_pad($nSeqEvento, 2, "0", STR_PAD_LEFT); |
| 234 | - $eventId = "ID".$tpEvento.$chave.$sSeqEvento; |
|
| 234 | + $eventId = "ID" . $tpEvento . $chave . $sSeqEvento; |
|
| 235 | 235 | $cOrgao = UFList::getCodeByUF($uf); |
| 236 | 236 | $request = "<eventoBPe xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">" |
| 237 | 237 | . "<infEvento Id=\"$eventId\">" |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $html .= '<h2>body</h2>'; |
| 67 | 67 | $html .= str_replace( |
| 68 | 68 | ['<', '>'], |
| 69 | - ['<','>'], |
|
| 69 | + ['<', '>'], |
|
| 70 | 70 | str_replace( |
| 71 | 71 | '<?xml version="1.0"?>', |
| 72 | 72 | '<?xml version="1.0" encoding="UTF-8"?>', |
@@ -186,7 +186,7 @@ |
||
| 186 | 186 | } |
| 187 | 187 | if (is_array($this->$node)) { |
| 188 | 188 | $n = count($this->$node); |
| 189 | - if ($n > $occur[1]) { |
|
| 189 | + if ($n > $occur[1]) { |
|
| 190 | 190 | //existem mais objetos que o permitido |
| 191 | 191 | $this->errors[] = "Existem mais objetos [tag{$node}: $n] " |
| 192 | 192 | . "que o limite permitido [max: {$occur[1]}]!"; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * Canonical conversion options |
| 98 | 98 | * @var array |
| 99 | 99 | */ |
| 100 | - protected $canonical = [true,false,null,null]; |
|
| 100 | + protected $canonical = [true, false, null, null]; |
|
| 101 | 101 | /** |
| 102 | 102 | * Model of BPe 63 |
| 103 | 103 | * @var int |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $this->config = json_decode($configJson); |
| 185 | 185 | $this->pathwsfiles = realpath( |
| 186 | 186 | __DIR__ . '/../../storage' |
| 187 | - ).'/'; |
|
| 187 | + ) . '/'; |
|
| 188 | 188 | $this->version($this->config->versao); |
| 189 | 189 | $this->setEnvironmentTimeZone($this->config->siglaUF); |
| 190 | 190 | $this->certificate = $certificate; |
@@ -261,8 +261,8 @@ discard block |
||
| 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 | } |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | protected function isValid($version, $body, $method) |
| 394 | 394 | { |
| 395 | - $schema = $this->pathschemes.$method."_v$version.xsd"; |
|
| 395 | + $schema = $this->pathschemes . $method . "_v$version.xsd"; |
|
| 396 | 396 | if (!is_file($schema)) { |
| 397 | 397 | return true; |
| 398 | 398 | } |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | * @param array $opt |
| 421 | 421 | * @return array |
| 422 | 422 | */ |
| 423 | - public function canonicalOptions($opt = [true,false,null,null]) |
|
| 423 | + public function canonicalOptions($opt = [true, false, null, null]) |
|
| 424 | 424 | { |
| 425 | 425 | if (!empty($opt) && is_array($opt)) { |
| 426 | 426 | $this->canonical = $opt; |
@@ -510,8 +510,8 @@ discard block |
||
| 510 | 510 | { |
| 511 | 511 | $file = $this->pathwsfiles |
| 512 | 512 | . DIRECTORY_SEPARATOR |
| 513 | - . "wsbpe_".$this->versao."_mod63.xml"; |
|
| 514 | - if (! file_exists($file)) { |
|
| 513 | + . "wsbpe_" . $this->versao . "_mod63.xml"; |
|
| 514 | + if (!file_exists($file)) { |
|
| 515 | 515 | return ''; |
| 516 | 516 | } |
| 517 | 517 | return file_get_contents($file); |
@@ -25,7 +25,7 @@ discard block |
||
| 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 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $ret->loadXML($response); |
| 186 | 186 | //extrai a rag retEvento da resposta (retorno da SEFAZ) |
| 187 | 187 | $retEv = $ret->getElementsByTagName('retEventoBPe')->item(0); |
| 188 | - $cStat = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
| 188 | + $cStat = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
| 189 | 189 | $xMotivo = $retEv->getElementsByTagName('xMotivo')->item(0)->nodeValue; |
| 190 | 190 | $tpEvento = $retEv->getElementsByTagName('tpEvento')->item(0)->nodeValue; |
| 191 | 191 | $cStatValids = ['135', '136']; |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | { |
| 216 | 216 | $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" |
| 217 | 217 | . "<$nodename versao=\"$versao\" " |
| 218 | - . "xmlns=\"".self::$urlPortal."\">"; |
|
| 218 | + . "xmlns=\"" . self::$urlPortal . "\">"; |
|
| 219 | 219 | $xml .= $first; |
| 220 | 220 | $xml .= $second; |
| 221 | 221 | $xml .= "</$nodename>"; |