@@ -17,7 +17,6 @@ |
||
| 17 | 17 | |
| 18 | 18 | use NFePHP\Common\Certificate; |
| 19 | 19 | use NFePHP\EFDReinf\Common\Soap\SoapInterface; |
| 20 | -use NFePHP\Common\Exception\SoapException; |
|
| 21 | 20 | use NFePHP\Common\Exception\RuntimeException; |
| 22 | 21 | use NFePHP\Common\Strings; |
| 23 | 22 | use League\Flysystem\Filesystem; |
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | /** |
| 165 | 165 | * Check if certificate is valid |
| 166 | 166 | * @param Certificate $certificate |
| 167 | - * @return mixed |
|
| 167 | + * @return null|Certificate |
|
| 168 | 168 | * @throws RuntimeException |
| 169 | 169 | */ |
| 170 | 170 | private function checkCertValidity(Certificate $certificate = null) |
@@ -384,9 +384,9 @@ discard block |
||
| 384 | 384 | ); |
| 385 | 385 | } |
| 386 | 386 | $this->certsdir = $this->certificate->getCnpj() . '/certs/'; |
| 387 | - $this->prifile = $this->certsdir. Strings::randomString(10).'.pem'; |
|
| 388 | - $this->pubfile = $this->certsdir . Strings::randomString(10).'.pem'; |
|
| 389 | - $this->certfile = $this->certsdir . Strings::randomString(10).'.pem'; |
|
| 387 | + $this->prifile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
| 388 | + $this->pubfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
| 389 | + $this->certfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
| 390 | 390 | $ret = true; |
| 391 | 391 | $private = $this->certificate->privateKey; |
| 392 | 392 | if ($this->encriptPrivateKey) { |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | ); |
| 412 | 412 | $ret &= $this->filesystem->put( |
| 413 | 413 | $this->certfile, |
| 414 | - $private."{$this->certificate}" |
|
| 414 | + $private . "{$this->certificate}" |
|
| 415 | 415 | ); |
| 416 | 416 | if (!$ret) { |
| 417 | 417 | throw new RuntimeException( |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | //utilize a API. Outra solução para remover arquivos "perdidos" pode ser |
| 438 | 438 | //encontrada oportunamente. |
| 439 | 439 | $dt = new \DateTime(); |
| 440 | - $tint = new \DateInterval("PT".$this->waitingTime."M"); |
|
| 440 | + $tint = new \DateInterval("PT" . $this->waitingTime . "M"); |
|
| 441 | 441 | $tint->invert = 1; |
| 442 | 442 | $tsLimit = $dt->add($tint)->getTimestamp(); |
| 443 | 443 | foreach ($contents as $item) { |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | public static function info($code) |
| 24 | 24 | { |
| 25 | - $codes = (array) json_decode(file_get_contents(__DIR__.'/httpcodes.json'), true); |
|
| 25 | + $codes = (array) json_decode(file_get_contents(__DIR__ . '/httpcodes.json'), true); |
|
| 26 | 26 | if (array_key_exists($code, $codes)) { |
| 27 | 27 | return $codes[$code]; |
| 28 | 28 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | curl_setopt($oCurl, CURLOPT_KEYPASSWD, $this->temppass); |
| 79 | 79 | } |
| 80 | 80 | curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true); |
| 81 | - if (! empty($envelope)) { |
|
| 81 | + if (!empty($envelope)) { |
|
| 82 | 82 | curl_setopt($oCurl, CURLOPT_POST, true); |
| 83 | 83 | curl_setopt($oCurl, CURLOPT_POSTFIELDS, $envelope); |
| 84 | 84 | curl_setopt($oCurl, CURLOPT_HTTPHEADER, $parameters); |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | if ($this->proxyIP != '') { |
| 160 | 160 | curl_setopt($oCurl, CURLOPT_HTTPPROXYTUNNEL, 1); |
| 161 | 161 | curl_setopt($oCurl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); |
| 162 | - curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP.':'.$this->proxyPort); |
|
| 162 | + curl_setopt($oCurl, CURLOPT_PROXY, $this->proxyIP . ':' . $this->proxyPort); |
|
| 163 | 163 | if ($this->proxyUser != '') { |
| 164 | - curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser.':'.$this->proxyPass); |
|
| 164 | + curl_setopt($oCurl, CURLOPT_PROXYUSERPWD, $this->proxyUser . ':' . $this->proxyPass); |
|
| 165 | 165 | curl_setopt($oCurl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); |
| 166 | 166 | } |
| 167 | 167 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $html .= '<h2>body</h2>'; |
| 51 | 51 | $html .= str_replace( |
| 52 | 52 | ['<', '>'], |
| 53 | - ['<','>'], |
|
| 53 | + ['<', '>'], |
|
| 54 | 54 | str_replace( |
| 55 | 55 | '<?xml version="1.0"?>', |
| 56 | 56 | '<?xml version="1.0" encoding="UTF-8"?>', |
@@ -216,7 +216,7 @@ |
||
| 216 | 216 | return true; |
| 217 | 217 | } |
| 218 | 218 | $validator = new JsonValid(); |
| 219 | - $validator->check($data, (object)['$ref' => 'file://' . $this->jsonschema]); |
|
| 219 | + $validator->check($data, (object) ['$ref' => 'file://' . $this->jsonschema]); |
|
| 220 | 220 | if (!$validator->isValid()) { |
| 221 | 221 | $msg = ""; |
| 222 | 222 | foreach ($validator->getErrors() as $error) { |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | |
| 108 | 108 | $this->path = realpath( |
| 109 | 109 | __DIR__ . '/../../' |
| 110 | - ).'/'; |
|
| 110 | + ) . '/'; |
|
| 111 | 111 | |
| 112 | 112 | $this->serviceXsd = XsdSeeker::seek( |
| 113 | 113 | $this->path . "schemes/comunicacao/v$this->serviceVersion/" |
@@ -17,7 +17,6 @@ |
||
| 17 | 17 | |
| 18 | 18 | use NFePHP\EFDReinf\Common\Factory; |
| 19 | 19 | use NFePHP\EFDReinf\Common\FactoryInterface; |
| 20 | -use NFePHP\EFDReinf\Common\FactoryId; |
|
| 21 | 20 | use NFePHP\Common\Certificate; |
| 22 | 21 | use stdClass; |
| 23 | 22 | |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | $this->node->insertBefore($ideEvento, $ideContri); |
| 74 | 74 | //tag deste evento em particular |
| 75 | 75 | $info = $this->dom->createElement("infoProcesso"); |
| 76 | - $ideProcesso = $this->dom->createElement("ideProcesso"); |
|
| 76 | + $ideProcesso = $this->dom->createElement("ideProcesso"); |
|
| 77 | 77 | $this->dom->addChild( |
| 78 | 78 | $ideProcesso, |
| 79 | 79 | "tpProc", |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | return ''; |
| 100 | 100 | } |
| 101 | 101 | $this->method = "ConsultaInformacoesConsolidadas"; |
| 102 | - $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/".$this->method; |
|
| 102 | + $this->action = "http://sped.fazenda.gov.br/ConsultasReinf/" . $this->method; |
|
| 103 | 103 | $request = "<sped:tipoInscricaoContribuinte>$this->tpInsc</sped:tipoInscricaoContribuinte>"; |
| 104 | 104 | $request .= "<sped:numeroInscricaoContribuinte>$this->nrInsc</sped:numeroInscricaoContribuinte>"; |
| 105 | 105 | $request .= "<sped:numeroReciboFechamento>$recibofechamento</sped:numeroReciboFechamento>"; |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | throw ProcessException::wrongArgument(2002, ''); |
| 135 | 135 | } |
| 136 | 136 | $this->checkCertificate($evt); |
| 137 | - $xml .= "<evento id=\"".$evt->getId()."\">"; |
|
| 137 | + $xml .= "<evento id=\"" . $evt->getId() . "\">"; |
|
| 138 | 138 | $xml .= $evt->toXML(); |
| 139 | 139 | $xml .= "</evento>"; |
| 140 | 140 | } |
| 141 | 141 | //build request |
| 142 | 142 | $request = "<Reinf xmlns=\"http://www.reinf.esocial.gov.br/schemas/envioLoteEventos/v" |
| 143 | - . $this->serviceVersion."\" >" |
|
| 143 | + . $this->serviceVersion . "\" >" |
|
| 144 | 144 | . "<loteEventos>" |
| 145 | 145 | . $xml |
| 146 | 146 | . "</loteEventos>" |