@@ -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 | } |
@@ -348,7 +348,7 @@ |
||
348 | 348 | * |
349 | 349 | * @param int $protocol |
350 | 350 | * |
351 | - * @return type Description |
|
351 | + * @return integer Description |
|
352 | 352 | */ |
353 | 353 | public function protocol($protocol = self::SSL_DEFAULT) |
354 | 354 | { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | ) { |
157 | 157 | $this->logger = $logger; |
158 | 158 | $this->certificate = $this->checkCertValidity($certificate); |
159 | - $this->setTemporaryFolder(sys_get_temp_dir().'/sped/'); |
|
159 | + $this->setTemporaryFolder(sys_get_temp_dir() . '/sped/'); |
|
160 | 160 | } |
161 | 161 | /** |
162 | 162 | * Check if certificate is valid |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | if ($this->disableCertValidation) { |
172 | 172 | return $certificate; |
173 | 173 | } |
174 | - if (! empty($certificate)) { |
|
174 | + if (!empty($certificate)) { |
|
175 | 175 | if ($certificate->isExpired()) { |
176 | 176 | throw new RuntimeException( |
177 | 177 | 'The validity of the certificate has expired.' |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | //utilize a API. Outra solução para remover arquivos "perdidos" pode ser |
226 | 226 | //encontrada oportunamente. |
227 | 227 | $dt = new \DateTime(); |
228 | - $tint = new \DateInterval("PT".$this->waitingTime."M"); |
|
228 | + $tint = new \DateInterval("PT" . $this->waitingTime . "M"); |
|
229 | 229 | $tint->invert = true; |
230 | 230 | $tsLimit = $dt->add($tint)->getTimestamp(); |
231 | 231 | foreach ($contents as $item) { |
@@ -380,15 +380,15 @@ discard block |
||
380 | 380 | */ |
381 | 381 | public function saveTemporarilyKeyFiles() |
382 | 382 | { |
383 | - if (! is_object($this->certificate)) { |
|
383 | + if (!is_object($this->certificate)) { |
|
384 | 384 | throw new RuntimeException( |
385 | 385 | 'Certificate not found.' |
386 | 386 | ); |
387 | 387 | } |
388 | - $this->certsdir = $this->certificate->getCnpj().'/certs/'; |
|
389 | - $this->prifile = $this->certsdir.Strings::randomString(10).'.pem'; |
|
390 | - $this->pubfile = $this->certsdir.Strings::randomString(10).'.pem'; |
|
391 | - $this->certfile = $this->certsdir.Strings::randomString(10).'.pem'; |
|
388 | + $this->certsdir = $this->certificate->getCnpj() . '/certs/'; |
|
389 | + $this->prifile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
390 | + $this->pubfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
391 | + $this->certfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
392 | 392 | $ret = true; |
393 | 393 | $private = $this->certificate->privateKey; |
394 | 394 | if ($this->encriptPrivateKey) { |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | ); |
414 | 414 | $ret &= $this->filesystem->put( |
415 | 415 | $this->certfile, |
416 | - $private."{$this->certificate}" |
|
416 | + $private . "{$this->certificate}" |
|
417 | 417 | ); |
418 | - if (! $ret) { |
|
418 | + if (!$ret) { |
|
419 | 419 | throw new RuntimeException( |
420 | 420 | 'Unable to save temporary key files in folder.' |
421 | 421 | ); |
@@ -432,19 +432,19 @@ discard block |
||
432 | 432 | */ |
433 | 433 | public function saveDebugFiles($operation, $request, $response) |
434 | 434 | { |
435 | - if (! $this->debugmode) { |
|
435 | + if (!$this->debugmode) { |
|
436 | 436 | return; |
437 | 437 | } |
438 | - $this->debugdir = $this->certificate->getCnpj().'/debug/'; |
|
438 | + $this->debugdir = $this->certificate->getCnpj() . '/debug/'; |
|
439 | 439 | $now = \DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', '')); |
440 | 440 | $time = substr($now->format("ymdHisu"), 0, 16); |
441 | 441 | try { |
442 | 442 | $this->filesystem->put( |
443 | - $this->debugdir.$time."_".$operation."_sol.txt", |
|
443 | + $this->debugdir . $time . "_" . $operation . "_sol.txt", |
|
444 | 444 | $request |
445 | 445 | ); |
446 | 446 | $this->filesystem->put( |
447 | - $this->debugdir.$time."_".$operation."_res.txt", |
|
447 | + $this->debugdir . $time . "_" . $operation . "_res.txt", |
|
448 | 448 | $response |
449 | 449 | ); |
450 | 450 | } catch (Exception $e) { |
@@ -473,10 +473,10 @@ discard block |
||
473 | 473 | foreach ($namespaces as $key => $value) { |
474 | 474 | $envelope .= " $key=\"$value\""; |
475 | 475 | } |
476 | - $envelope .= ">"; |
|
476 | + $envelope .= ">"; |
|
477 | 477 | $soapheader = "<$prefix:Header/>"; |
478 | - if (! empty($header)) { |
|
479 | - $ns = ! empty($header->namespace) ? $header->namespace : ''; |
|
478 | + if (!empty($header)) { |
|
479 | + $ns = !empty($header->namespace) ? $header->namespace : ''; |
|
480 | 480 | $name = $header->name; |
481 | 481 | $soapheader = "<$prefix:Header>"; |
482 | 482 | $soapheader .= "<$name xmlns=\"$ns\">"; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $this->dom->addChild( |
82 | 82 | $infoIrrf, |
83 | 83 | "nrRecArqBase", |
84 | - ! empty($this->std->infoirrf->nrrecarqbase) ? $this->std->infoirrf->nrrecarqbase : '', |
|
84 | + !empty($this->std->infoirrf->nrrecarqbase) ? $this->std->infoirrf->nrrecarqbase : '', |
|
85 | 85 | false |
86 | 86 | ); |
87 | 87 | $this->dom->addChild( |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->dom->addChild( |
72 | 72 | $ideEvento, |
73 | 73 | "nrRecArqBase", |
74 | - ! empty($this->std->nrrecarqbase) ? $this->std->nrrecarqbase : null, |
|
74 | + !empty($this->std->nrrecarqbase) ? $this->std->nrrecarqbase : null, |
|
75 | 75 | false |
76 | 76 | ); |
77 | 77 | $this->dom->addChild( |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $this->dom->addChild( |
167 | 167 | $infoCategIncid, |
168 | 168 | "matricula", |
169 | - ! empty($infocat->matricula) ? $infocat->matricula : null, |
|
169 | + !empty($infocat->matricula) ? $infocat->matricula : null, |
|
170 | 170 | false |
171 | 171 | ); |
172 | 172 | $this->dom->addChild( |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $this->dom->addChild( |
179 | 179 | $infoCategIncid, |
180 | 180 | "indSimples", |
181 | - ! empty($infocat->indsimples) ? $infocat->indsimples : null, |
|
181 | + !empty($infocat->indsimples) ? $infocat->indsimples : null, |
|
182 | 182 | false |
183 | 183 | ); |
184 | 184 | foreach ($infocat->infobasecs as $infobase) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $this->dom->addChild( |
78 | 78 | $ideEvento, |
79 | 79 | "nrRecibo", |
80 | - ! empty($this->std->nrrecibo) ? $this->std->nrrecibo : null, |
|
80 | + !empty($this->std->nrrecibo) ? $this->std->nrrecibo : null, |
|
81 | 81 | false |
82 | 82 | ); |
83 | 83 | $this->dom->addChild( |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | $this->dom->addChild( |
132 | 132 | $infoReintegr, |
133 | 133 | "nrProcJud", |
134 | - ! empty($this->std->nrprocjud) ? $this->std->nrprocjud : null, |
|
134 | + !empty($this->std->nrprocjud) ? $this->std->nrprocjud : null, |
|
135 | 135 | false |
136 | 136 | ); |
137 | 137 | $this->dom->addChild( |
138 | 138 | $infoReintegr, |
139 | 139 | "nrLeiAnistia", |
140 | - ! empty($this->std->nrleianistia) ? $this->std->nrleianistia : null, |
|
140 | + !empty($this->std->nrleianistia) ? $this->std->nrleianistia : null, |
|
141 | 141 | false |
142 | 142 | ); |
143 | 143 | $this->dom->addChild( |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $this->dom->addChild( |
106 | 106 | $ide, |
107 | 107 | "fimValid", |
108 | - ! empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
108 | + !empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
109 | 109 | false |
110 | 110 | ); |
111 | 111 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $this->dom->addChild( |
172 | 172 | $nova, |
173 | 173 | "fimValid", |
174 | - ! empty($this->std->novavalidade->fimvalid) |
|
174 | + !empty($this->std->novavalidade->fimvalid) |
|
175 | 175 | ? $this->std->novavalidade->fimvalid |
176 | 176 | : null, |
177 | 177 | false |
@@ -17,7 +17,6 @@ |
||
17 | 17 | |
18 | 18 | use NFePHP\Common\Certificate; |
19 | 19 | use NFePHP\eSocial\Common\Factory; |
20 | -use NFePHP\eSocial\Common\FactoryId; |
|
21 | 20 | use NFePHP\eSocial\Common\FactoryInterface; |
22 | 21 | use stdClass; |
23 | 22 |
@@ -171,7 +171,7 @@ |
||
171 | 171 | $this->dom->addChild( |
172 | 172 | $nova, |
173 | 173 | "fimValid", |
174 | - ! empty($this->std->novavalidade->fimvalid) |
|
174 | + !empty($this->std->novavalidade->fimvalid) |
|
175 | 175 | ? $this->std->novavalidade->fimvalid |
176 | 176 | : null, |
177 | 177 | false |
@@ -61,7 +61,7 @@ |
||
61 | 61 | */ |
62 | 62 | protected function toNode() |
63 | 63 | { |
64 | - $ideEmpregador = $this->node->getElementsByTagName('ideEmpregador')->item(0); |
|
64 | + $ideEmpregador = $this->node->getElementsByTagName('ideEmpregador')->item(0); |
|
65 | 65 | //o idEvento pode variar de evento para evento |
66 | 66 | //então cada factory individualmente terá de construir o seu |
67 | 67 | $ideEvento = $this->dom->createElement("ideEvento"); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $this->dom->addChild( |
101 | 101 | $ide, |
102 | 102 | "fimValid", |
103 | - ! empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
103 | + !empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
104 | 104 | false |
105 | 105 | ); |
106 | 106 | $dados = ''; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $this->dom->addChild( |
139 | 139 | $nova, |
140 | 140 | "fimValid", |
141 | - ! empty($this->std->novavalidade->fimvalid) |
|
141 | + !empty($this->std->novavalidade->fimvalid) |
|
142 | 142 | ? $this->std->novavalidade->fimvalid |
143 | 143 | : null, |
144 | 144 | false |
@@ -17,7 +17,6 @@ |
||
17 | 17 | |
18 | 18 | use NFePHP\Common\Certificate; |
19 | 19 | use NFePHP\eSocial\Common\Factory; |
20 | -use NFePHP\eSocial\Common\FactoryId; |
|
21 | 20 | use NFePHP\eSocial\Common\FactoryInterface; |
22 | 21 | use stdClass; |
23 | 22 |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $this->dom->addChild( |
106 | 106 | $ide, |
107 | 107 | "fimValid", |
108 | - ! empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
108 | + !empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
109 | 109 | false |
110 | 110 | ); |
111 | 111 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $this->dom->addChild( |
172 | 172 | $nova, |
173 | 173 | "fimValid", |
174 | - ! empty($this->std->novavalidade->fimvalid) |
|
174 | + !empty($this->std->novavalidade->fimvalid) |
|
175 | 175 | ? $this->std->novavalidade->fimvalid |
176 | 176 | : null, |
177 | 177 | false |