@@ -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 | { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | ) { |
187 | 187 | $this->logger = $logger; |
188 | 188 | $this->certificate = $this->checkCertValidity($certificate); |
189 | - $this->setTemporaryFolder(sys_get_temp_dir().'/sped/'); |
|
189 | + $this->setTemporaryFolder(sys_get_temp_dir() . '/sped/'); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | if ($this->disableCertValidation) { |
203 | 203 | return $certificate; |
204 | 204 | } |
205 | - if (! empty($certificate)) { |
|
205 | + if (!empty($certificate)) { |
|
206 | 206 | if ($certificate->isExpired()) { |
207 | 207 | throw new RuntimeException( |
208 | 208 | 'The validity of the certificate has expired.' |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | //utilize a API. Outra solução para remover arquivos "perdidos" pode ser |
262 | 262 | //encontrada oportunamente. |
263 | 263 | $dt = new \DateTime(); |
264 | - $tint = new \DateInterval("PT".$this->waitingTime."M"); |
|
264 | + $tint = new \DateInterval("PT" . $this->waitingTime . "M"); |
|
265 | 265 | $tint->invert = true; |
266 | 266 | $tsLimit = $dt->add($tint)->getTimestamp(); |
267 | 267 | foreach ($contents as $item) { |
@@ -431,15 +431,15 @@ discard block |
||
431 | 431 | */ |
432 | 432 | public function saveTemporarilyKeyFiles() |
433 | 433 | { |
434 | - if (! is_object($this->certificate)) { |
|
434 | + if (!is_object($this->certificate)) { |
|
435 | 435 | throw new RuntimeException( |
436 | 436 | 'Certificate not found.' |
437 | 437 | ); |
438 | 438 | } |
439 | - $this->certsdir = $this->certificate->getCnpj().'/certs/'; |
|
440 | - $this->prifile = $this->certsdir.Strings::randomString(10).'.pem'; |
|
441 | - $this->pubfile = $this->certsdir.Strings::randomString(10).'.pem'; |
|
442 | - $this->certfile = $this->certsdir.Strings::randomString(10).'.pem'; |
|
439 | + $this->certsdir = $this->certificate->getCnpj() . '/certs/'; |
|
440 | + $this->prifile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
441 | + $this->pubfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
442 | + $this->certfile = $this->certsdir . Strings::randomString(10) . '.pem'; |
|
443 | 443 | $ret = true; |
444 | 444 | $private = $this->certificate->privateKey; |
445 | 445 | if ($this->encriptPrivateKey) { |
@@ -464,9 +464,9 @@ discard block |
||
464 | 464 | ); |
465 | 465 | $ret &= $this->filesystem->put( |
466 | 466 | $this->certfile, |
467 | - $private."{$this->certificate}" |
|
467 | + $private . "{$this->certificate}" |
|
468 | 468 | ); |
469 | - if (! $ret) { |
|
469 | + if (!$ret) { |
|
470 | 470 | throw new RuntimeException( |
471 | 471 | 'Unable to save temporary key files in folder.' |
472 | 472 | ); |
@@ -484,19 +484,19 @@ discard block |
||
484 | 484 | */ |
485 | 485 | public function saveDebugFiles($operation, $request, $response) |
486 | 486 | { |
487 | - if (! $this->debugmode) { |
|
487 | + if (!$this->debugmode) { |
|
488 | 488 | return; |
489 | 489 | } |
490 | - $this->debugdir = $this->certificate->getCnpj().'/debug/'; |
|
490 | + $this->debugdir = $this->certificate->getCnpj() . '/debug/'; |
|
491 | 491 | $now = \DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', '')); |
492 | 492 | $time = substr($now->format("ymdHisu"), 0, 16); |
493 | 493 | try { |
494 | 494 | $this->filesystem->put( |
495 | - $this->debugdir.$time."_".$operation."_sol.txt", |
|
495 | + $this->debugdir . $time . "_" . $operation . "_sol.txt", |
|
496 | 496 | $request |
497 | 497 | ); |
498 | 498 | $this->filesystem->put( |
499 | - $this->debugdir.$time."_".$operation."_res.txt", |
|
499 | + $this->debugdir . $time . "_" . $operation . "_res.txt", |
|
500 | 500 | $response |
501 | 501 | ); |
502 | 502 | } catch (Exception $e) { |
@@ -526,10 +526,10 @@ discard block |
||
526 | 526 | foreach ($namespaces as $key => $value) { |
527 | 527 | $envelope .= " $key=\"$value\""; |
528 | 528 | } |
529 | - $envelope .= ">"; |
|
529 | + $envelope .= ">"; |
|
530 | 530 | $soapheader = "<$prefix:Header/>"; |
531 | - if (! empty($header)) { |
|
532 | - $ns = ! empty($header->namespace) ? $header->namespace : ''; |
|
531 | + if (!empty($header)) { |
|
532 | + $ns = !empty($header->namespace) ? $header->namespace : ''; |
|
533 | 533 | $name = $header->name; |
534 | 534 | $soapheader = "<$prefix:Header>"; |
535 | 535 | $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( |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $this->dom->addChild( |
115 | 115 | $ideEstab, |
116 | 116 | "fimValid", |
117 | - ! empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
117 | + !empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
118 | 118 | false |
119 | 119 | ); |
120 | 120 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } |
128 | 128 | $node->appendChild($ideEstab); |
129 | 129 | |
130 | - if (! empty($this->std->dadosestab)) { |
|
130 | + if (!empty($this->std->dadosestab)) { |
|
131 | 131 | $dadosEstab = $this->dom->createElement("dadosEstab"); |
132 | 132 | $this->dom->addChild( |
133 | 133 | $dadosEstab, |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $this->std->dadosestab->aliqgilrat->aliqrat, |
143 | 143 | true |
144 | 144 | ); |
145 | - $fap = ! empty($this->std->dadosestab->aliqgilrat->fap) ? $this->std->dadosestab->aliqgilrat->fap : null; |
|
145 | + $fap = !empty($this->std->dadosestab->aliqgilrat->fap) ? $this->std->dadosestab->aliqgilrat->fap : null; |
|
146 | 146 | if ($fap) { |
147 | 147 | $fap = number_format($fap, 4, '.', ''); |
148 | 148 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $fap, |
153 | 153 | false |
154 | 154 | ); |
155 | - $aliqrata = ! empty($this->std->dadosestab->aliqgilrat->aliqratajust) |
|
155 | + $aliqrata = !empty($this->std->dadosestab->aliqgilrat->aliqratajust) |
|
156 | 156 | ? $this->std->dadosestab->aliqgilrat->aliqratajust |
157 | 157 | : null; |
158 | 158 | if ($aliqrata) { |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $aliqrata, |
165 | 165 | false |
166 | 166 | ); |
167 | - if (! empty($this->std->dadosestab->aliqgilrat->procadmjudrat)) { |
|
167 | + if (!empty($this->std->dadosestab->aliqgilrat->procadmjudrat)) { |
|
168 | 168 | $procAdmJudRat = $this->dom->createElement("procAdmJudRat"); |
169 | 169 | $this->dom->addChild( |
170 | 170 | $procAdmJudRat, |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | ); |
187 | 187 | $aliqGilrat->appendChild($procAdmJudRat); |
188 | 188 | } |
189 | - if (! empty($this->std->dadosestab->aliqgilrat->procadmjudfap)) { |
|
189 | + if (!empty($this->std->dadosestab->aliqgilrat->procadmjudfap)) { |
|
190 | 190 | $procAdmJudFap = $this->dom->createElement("procAdmJudFap"); |
191 | 191 | $this->dom->addChild( |
192 | 192 | $procAdmJudFap, |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } |
211 | 211 | $dadosEstab->appendChild($aliqGilrat); |
212 | 212 | |
213 | - if (! empty($this->std->dadosestab->infocaepf)) { |
|
213 | + if (!empty($this->std->dadosestab->infocaepf)) { |
|
214 | 214 | $infoCaepf = $this->dom->createElement("infoCaepf"); |
215 | 215 | $this->dom->addChild( |
216 | 216 | $infoCaepf, |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $dadosEstab->appendChild($infoCaepf); |
222 | 222 | } |
223 | 223 | |
224 | - if (! empty($this->std->dadosestab->infoobra)) { |
|
224 | + if (!empty($this->std->dadosestab->infoobra)) { |
|
225 | 225 | $infoObra = $this->dom->createElement("infoObra"); |
226 | 226 | $this->dom->addChild( |
227 | 227 | $infoObra, |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $this->dom->addChild( |
251 | 251 | $infoApr, |
252 | 252 | "nrProcJud", |
253 | - ! empty($this->std->dadosestab->infotrab->infoapr->nrprocjud) |
|
253 | + !empty($this->std->dadosestab->infotrab->infoapr->nrprocjud) |
|
254 | 254 | ? $this->std->dadosestab->infotrab->infoapr->nrprocjud |
255 | 255 | : null, |
256 | 256 | false |
@@ -258,13 +258,13 @@ discard block |
||
258 | 258 | $this->dom->addChild( |
259 | 259 | $infoApr, |
260 | 260 | "contEntEd", |
261 | - ! empty($this->std->dadosestab->infotrab->infoapr->contented) |
|
261 | + !empty($this->std->dadosestab->infotrab->infoapr->contented) |
|
262 | 262 | ? $this->std->dadosestab->infotrab->infoapr->contented |
263 | 263 | : null, |
264 | 264 | false |
265 | 265 | ); |
266 | 266 | |
267 | - if (! empty($this->std->dadosestab->infotrab->infoapr->infoenteduc)) { |
|
267 | + if (!empty($this->std->dadosestab->infotrab->infoapr->infoenteduc)) { |
|
268 | 268 | foreach ($this->std->dadosestab->infotrab->infoapr->infoenteduc as $edu) { |
269 | 269 | $infoEntEduc = $this->dom->createElement("infoEntEduc"); |
270 | 270 | $this->dom->addChild( |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | |
280 | 280 | $infoTrab->appendChild($infoApr); |
281 | - if (! empty($this->std->dadosestab->infotrab->infopdc)) { |
|
281 | + if (!empty($this->std->dadosestab->infotrab->infopdc)) { |
|
282 | 282 | $infoPCD = $this->dom->createElement("infoPCD"); |
283 | 283 | $this->dom->addChild( |
284 | 284 | $infoPCD, |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $this->dom->addChild( |
290 | 290 | $infoPCD, |
291 | 291 | "nrProcJud", |
292 | - ! empty($this->std->dadosestab->infotrab->infopdc->nrprocjud) |
|
292 | + !empty($this->std->dadosestab->infotrab->infopdc->nrprocjud) |
|
293 | 293 | ? $this->std->dadosestab->infotrab->infopdc->nrprocjud |
294 | 294 | : null, |
295 | 295 | false |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $node->appendChild($dadosEstab); |
301 | 301 | } |
302 | 302 | |
303 | - if (! empty($this->std->novavalidade) && $this->std->modo == 'ALT') { |
|
303 | + if (!empty($this->std->novavalidade) && $this->std->modo == 'ALT') { |
|
304 | 304 | $newVal = $this->std->novavalidade; |
305 | 305 | $novaValidade = $this->dom->createElement("novaValidade"); |
306 | 306 | $this->dom->addChild( |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $this->dom->addChild( |
313 | 313 | $ideRubrica, |
314 | 314 | "fimValid", |
315 | - ! empty($newVal->fimvalid) ? $newVal->fimvalid : null, |
|
315 | + !empty($newVal->fimvalid) ? $newVal->fimvalid : null, |
|
316 | 316 | false |
317 | 317 | ); |
318 | 318 | $node->appendChild($novaValidade); |
@@ -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( |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $this->dom->addChild( |
114 | 114 | $ideRubrica, |
115 | 115 | "fimValid", |
116 | - ! empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
116 | + !empty($this->std->fimvalid) ? $this->std->fimvalid : null, |
|
117 | 117 | false |
118 | 118 | ); |
119 | 119 | //seleção do modo |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | $node->appendChild($ideRubrica); |
128 | 128 | |
129 | - if (! empty($this->std->dadosrubrica)) { |
|
129 | + if (!empty($this->std->dadosrubrica)) { |
|
130 | 130 | $dadosRubrica = $this->dom->createElement("dadosRubrica"); |
131 | 131 | $this->dom->addChild( |
132 | 132 | $dadosRubrica, |
@@ -197,13 +197,13 @@ discard block |
||
197 | 197 | $this->dom->addChild( |
198 | 198 | $dadosRubrica, |
199 | 199 | "observacao", |
200 | - ! empty($this->std->dadosrubrica->observacao) |
|
200 | + !empty($this->std->dadosrubrica->observacao) |
|
201 | 201 | ? $this->std->dadosrubrica->observacao |
202 | 202 | : null, |
203 | 203 | false |
204 | 204 | ); |
205 | 205 | |
206 | - if (! empty($this->std->dadosrubrica->ideprocessocp)) { |
|
206 | + if (!empty($this->std->dadosrubrica->ideprocessocp)) { |
|
207 | 207 | foreach ($this->std->dadosrubrica->ideprocessocp as $cp) { |
208 | 208 | $ideProcessoCP = $this->dom->createElement("ideProcessoCP"); |
209 | 209 | $this->dom->addChild( |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } |
235 | 235 | } |
236 | 236 | |
237 | - if (! empty($this->std->dadosrubrica->ideprocessoirrf)) { |
|
237 | + if (!empty($this->std->dadosrubrica->ideprocessoirrf)) { |
|
238 | 238 | foreach ($this->std->dadosrubrica->ideprocessoirrf as $irrf) { |
239 | 239 | $ideProcessoIRRF = $this->dom->createElement("ideProcessoIRRF"); |
240 | 240 | $this->dom->addChild( |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $dadosRubrica->appendChild($ideProcessoIRRF); |
253 | 253 | } |
254 | 254 | } |
255 | - if (! empty($this->std->dadosrubrica->ideprocessofgts)) { |
|
255 | + if (!empty($this->std->dadosrubrica->ideprocessofgts)) { |
|
256 | 256 | foreach ($this->std->dadosrubrica->ideprocessofgts as $fgts) { |
257 | 257 | $ideProcessoFGTS = $this->dom->createElement("ideProcessoFGTS"); |
258 | 258 | $this->dom->addChild( |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $dadosRubrica->appendChild($ideProcessoFGTS); |
271 | 271 | } |
272 | 272 | } |
273 | - if (! empty($this->std->dadosrubrica->ideprocessosind)) { |
|
273 | + if (!empty($this->std->dadosrubrica->ideprocessosind)) { |
|
274 | 274 | foreach ($this->std->dadosrubrica->ideprocessosind as $sind) { |
275 | 275 | $ideProcessoSIND = $this->dom->createElement("ideProcessoSIND"); |
276 | 276 | $this->dom->addChild( |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | } |
291 | 291 | $node->appendChild($dadosRubrica); |
292 | 292 | } |
293 | - if (! empty($this->std->novavalidade) && $this->std->modo == 'ALT') { |
|
293 | + if (!empty($this->std->novavalidade) && $this->std->modo == 'ALT') { |
|
294 | 294 | $newVal = $this->std->novavalidade; |
295 | 295 | $novaValidade = $this->dom->createElement("novaValidade"); |
296 | 296 | $this->dom->addChild( |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $this->dom->addChild( |
303 | 303 | $ideRubrica, |
304 | 304 | "fimValid", |
305 | - ! empty($newVal->fimvalid) ? $newVal->fimvalid : null, |
|
305 | + !empty($newVal->fimvalid) ? $newVal->fimvalid : null, |
|
306 | 306 | false |
307 | 307 | ); |
308 | 308 | $node->appendChild($novaValidade); |
@@ -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 |