@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | public function __construct($config, Certificate $certificate) |
| 119 | 119 | { |
| 120 | 120 | parent::__construct($config, $certificate); |
| 121 | - $this->xsdassincrono = __DIR__.'/../schemes/v2_01_01/envioLoteEventosAssincrono-v1_00_00.xsd'; |
|
| 121 | + $this->xsdassincrono = __DIR__ . '/../schemes/v2_01_01/envioLoteEventosAssincrono-v1_00_00.xsd'; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $properties = [ |
| 290 | 290 | 'perapur' => [ |
| 291 | 291 | 'required' => false, |
| 292 | - 'type' => ['string',"null"], |
|
| 292 | + 'type' => ['string', "null"], |
|
| 293 | 293 | 'regex' => '^(19[0-9][0-9]|2[0-9][0-9][0-9])[-](0?[1-9]|1[0-2])$' |
| 294 | 294 | ], |
| 295 | 295 | 'tpinscestab' => [ |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | . "<sped:tpInsc>{$this->tpInsc}</sped:tpInsc>" |
| 319 | 319 | . "<sped:nrInsc>{$this->doc}</sped:nrInsc>"; |
| 320 | 320 | if (!empty($std->perapur)) { |
| 321 | - $request .= "<sped:perApur>{$std->perapur}</sped:perApur>"; |
|
| 321 | + $request .= "<sped:perApur>{$std->perapur}</sped:perApur>"; |
|
| 322 | 322 | } |
| 323 | 323 | $request .= "<sped:tpInscEstab>{$std->tpinscestab}</sped:tpInscEstab>" |
| 324 | 324 | . "<sped:nrInscEstab>" |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $properties = [ |
| 343 | 343 | 'perapur' => [ |
| 344 | 344 | 'required' => false, |
| 345 | - 'type' => ['string',"null"], |
|
| 345 | + 'type' => ['string', "null"], |
|
| 346 | 346 | 'regex' => '^(19[0-9][0-9]|2[0-9][0-9][0-9])[-](0?[1-9]|1[0-2])$' |
| 347 | 347 | ], |
| 348 | 348 | 'nrinscestabprest' => [ |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | $properties = [ |
| 394 | 394 | 'perapur' => [ |
| 395 | 395 | 'required' => false, |
| 396 | - 'type' => ['string',"null"], |
|
| 396 | + 'type' => ['string', "null"], |
|
| 397 | 397 | 'regex' => '^(19[0-9][0-9]|2[0-9][0-9][0-9])[-](0?[1-9]|1[0-2])$' |
| 398 | 398 | ], |
| 399 | 399 | 'nrinscestab' => [ |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | $properties = [ |
| 437 | 437 | 'perapur' => [ |
| 438 | 438 | 'required' => false, |
| 439 | - 'type' => ['string',"null"], |
|
| 439 | + 'type' => ['string', "null"], |
|
| 440 | 440 | 'regex' => '^(19[0-9][0-9]|2[0-9][0-9][0-9])[-](0?[1-9]|1[0-2])$' |
| 441 | 441 | ], |
| 442 | 442 | 'nrinscestab' => [ |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | $properties = [ |
| 482 | 482 | 'perapur' => [ |
| 483 | 483 | 'required' => false, |
| 484 | - 'type' => ['string',"null"], |
|
| 484 | + 'type' => ['string', "null"], |
|
| 485 | 485 | 'regex' => '^(19[0-9][0-9]|2[0-9][0-9][0-9])[-](0?[1-9]|1[0-2])$' |
| 486 | 486 | ], |
| 487 | 487 | 'nrinscestabprest' => [ |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | $properties = [ |
| 532 | 532 | 'perapur' => [ |
| 533 | 533 | 'required' => false, |
| 534 | - 'type' => ['string',"null"], |
|
| 534 | + 'type' => ['string', "null"], |
|
| 535 | 535 | 'regex' => '^(19[0-9][0-9]|2[0-9][0-9][0-9])[-](0?[1-9]|1[0-2])$' |
| 536 | 536 | ], |
| 537 | 537 | ]; |
@@ -615,20 +615,20 @@ discard block |
||
| 615 | 615 | throw ProcessException::wrongArgument(2002, ''); |
| 616 | 616 | } |
| 617 | 617 | //verifica se o evento pertence ao grupo indicado |
| 618 | - if (! in_array($evt->alias(), $this->grupos[$grupo])) { |
|
| 618 | + if (!in_array($evt->alias(), $this->grupos[$grupo])) { |
|
| 619 | 619 | throw new \RuntimeException( |
| 620 | 620 | 'O evento ' . $evt->alias() . ' não pertence a este grupo [ ' |
| 621 | 621 | . $this->eventGroup[$grupo] . ' ].' |
| 622 | 622 | ); |
| 623 | 623 | } |
| 624 | 624 | $this->checkCertificate($evt); |
| 625 | - $xml .= "<evento id=\"".$evt->getId()."\">"; |
|
| 625 | + $xml .= "<evento id=\"" . $evt->getId() . "\">"; |
|
| 626 | 626 | $xml .= $evt->toXML(); |
| 627 | 627 | $xml .= "</evento>"; |
| 628 | 628 | } |
| 629 | 629 | //build request |
| 630 | 630 | $request = "<Reinf xmlns=\"http://www.reinf.esocial.gov.br/schemas/envioLoteEventos/v" |
| 631 | - . $this->serviceVersion."\" >" |
|
| 631 | + . $this->serviceVersion . "\" >" |
|
| 632 | 632 | . "<loteEventos>" |
| 633 | 633 | . $xml |
| 634 | 634 | . "</loteEventos>" |
@@ -670,20 +670,20 @@ discard block |
||
| 670 | 670 | throw ProcessException::wrongArgument(2002, ''); |
| 671 | 671 | } |
| 672 | 672 | //verifica se o evento pertence ao grupo indicado |
| 673 | - if (! in_array($evt->alias(), $this->grupos[$grupo])) { |
|
| 673 | + if (!in_array($evt->alias(), $this->grupos[$grupo])) { |
|
| 674 | 674 | throw new \RuntimeException( |
| 675 | 675 | 'O evento ' . $evt->alias() . ' não pertence a este grupo [ ' |
| 676 | 676 | . $this->eventGroup[$grupo] . ' ].' |
| 677 | 677 | ); |
| 678 | 678 | } |
| 679 | 679 | $this->checkCertificate($evt); |
| 680 | - $xml .= "<evento Id=\"".$evt->getId()."\">"; |
|
| 680 | + $xml .= "<evento Id=\"" . $evt->getId() . "\">"; |
|
| 681 | 681 | $xml .= $evt->toXML(); |
| 682 | 682 | $xml .= "</evento>"; |
| 683 | 683 | } |
| 684 | 684 | $content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" |
| 685 | 685 | . "<Reinf xmlns=\"http://www.reinf.esocial.gov.br/schemas/envioLoteEventosAssincrono/v" |
| 686 | - . $this->serviceVersion."\">" |
|
| 686 | + . $this->serviceVersion . "\">" |
|
| 687 | 687 | . "<envioLoteEventos>" |
| 688 | 688 | . "<ideContribuinte>" |
| 689 | 689 | . "<tpInsc>{$this->tpInsc}</tpInsc>" |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | } |
| 748 | 748 | $content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" |
| 749 | 749 | . "<Reinf xmlns=\"http://www.reinf.esocial.gov.br/schemas/envioLoteEventosAssincrono/v" |
| 750 | - . $this->serviceVersion."\">" |
|
| 750 | + . $this->serviceVersion . "\">" |
|
| 751 | 751 | . "<envioLoteEventos>" |
| 752 | 752 | . "<ideContribuinte>" |
| 753 | 753 | . "<tpInsc>{$this->tpInsc}</tpInsc>" |
@@ -107,16 +107,16 @@ discard block |
||
| 107 | 107 | * @var array |
| 108 | 108 | */ |
| 109 | 109 | protected $grupos = [ |
| 110 | - 1 => [ //EVENTOS INICIAIS grupo [1] |
|
| 110 | + 1 => [//EVENTOS INICIAIS grupo [1] |
|
| 111 | 111 | 'R-1000', |
| 112 | 112 | 'R-1050', |
| 113 | 113 | 'R-1070' |
| 114 | 114 | ], |
| 115 | - 2 => [ //EVENTOS NÃO PERIÓDICOS grupo [2] |
|
| 115 | + 2 => [//EVENTOS NÃO PERIÓDICOS grupo [2] |
|
| 116 | 116 | 'R-3010', |
| 117 | 117 | 'R-9000' |
| 118 | 118 | ], |
| 119 | - 3 => [ //EVENTOS PERIÓDICOS grupo [3] |
|
| 119 | + 3 => [//EVENTOS PERIÓDICOS grupo [3] |
|
| 120 | 120 | 'R-2010', |
| 121 | 121 | 'R-2020', |
| 122 | 122 | 'R-2030', |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | 'R-4040', |
| 132 | 132 | 'R-4080' |
| 133 | 133 | ], |
| 134 | - 4 => [ //EVENTOS FINAIS grupo [4] |
|
| 134 | + 4 => [//EVENTOS FINAIS grupo [4] |
|
| 135 | 135 | 'R-2099', |
| 136 | 136 | 'R-4099' |
| 137 | 137 | ] |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | $this->path = realpath( |
| 169 | 169 | __DIR__ . '/../../' |
| 170 | - ).'/'; |
|
| 170 | + ) . '/'; |
|
| 171 | 171 | |
| 172 | 172 | $this->serviceXsd = XsdSeeker::seek( |
| 173 | 173 | $this->path . "schemes/comunicacao/v$this->serviceVersion/" |