-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f6ac5b
commit 996201b
Showing
43 changed files
with
572 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Blocks; | ||
|
||
use NFePHP\Sintegra\Common\Block; | ||
use NFePHP\Sintegra\Elements; | ||
|
||
/** | ||
* Classe constutora do bloco 010 (inicial) Sintegra | ||
* Classe constutora do bloco 10 (inicial) Sintegra | ||
* REGISTRO 10 - Mestre do estabelecimento: dados da empresa | ||
* Registro 11 - Dados complementares do informante: endereço,nome do contato | ||
* | ||
* Esta classe irá usar um recurso para invocar as classes de cada um dos elementos | ||
* constituintes listados. | ||
*/ | ||
final class Block1 extends Block | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
public $elements = [ | ||
'z10' => ['class' => Elements\Z10::class, 'level' => 0, 'type' => 'single'], | ||
'z11' => ['class' => Elements\Z11::class, 'level' => 0, 'type' => 'single'], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Blocks; | ||
|
||
use NFePHP\Sintegra\Common\Block; | ||
|
@@ -14,6 +26,9 @@ | |
*/ | ||
final class Block5 extends Block implements BlockInterface | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
public $elements = [ | ||
'z50' => ['class' => Elements\Z50::class, 'level' => 0, 'type' => 'single'], | ||
'z51' => ['class' => Elements\Z51::class, 'level' => 0, 'type' => 'single'], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Blocks; | ||
|
||
use NFePHP\Sintegra\Common\Block; | ||
|
@@ -14,6 +26,9 @@ | |
*/ | ||
final class Block6 extends Block implements BlockInterface | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
public $elements = [ | ||
'z60' => ['class' => Elements\Z60M::class, 'level' => 0, 'type' => 'single'], | ||
'z61' => ['class' => Elements\Z61::class, 'level' => 0, 'type' => 'single'], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Blocks; | ||
|
||
use NFePHP\Sintegra\Common\Block; | ||
|
@@ -18,6 +30,9 @@ | |
*/ | ||
final class Block7 extends Block implements BlockInterface | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
public $elements = [ | ||
'z70' => ['class' => Elements\Z70::class, 'level' => 0, 'type' => 'single'], | ||
'z71' => ['class' => Elements\Z71::class, 'level' => 0, 'type' => 'single'], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Blocks; | ||
|
||
use NFePHP\Sintegra\Common\Block; | ||
|
@@ -14,6 +26,9 @@ | |
*/ | ||
final class Block8 extends Block implements BlockInterface | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
public $elements = [ | ||
'z85' => ['class' => Elements\Z85::class, 'level' => 0, 'type' => 'single'], | ||
'z86' => ['class' => Elements\Z86::class, 'level' => 0, 'type' => 'single'], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Common; | ||
|
||
abstract class BaseSintegra | ||
|
@@ -8,13 +20,17 @@ abstract class BaseSintegra | |
* @var array | ||
*/ | ||
public $errors = []; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $possibles = []; | ||
|
||
/** | ||
* Add blocks to class | ||
* | ||
* @param BlockInterface $block | ||
* | ||
* @return void | ||
*/ | ||
public function add(BlockInterface $block = null) | ||
{ | ||
|
@@ -30,6 +46,8 @@ public function add(BlockInterface $block = null) | |
|
||
/** | ||
* Create a SINTEGRA string | ||
* | ||
* @return string | ||
*/ | ||
public function get() | ||
{ | ||
|
@@ -46,7 +64,9 @@ public function get() | |
|
||
/** | ||
* Totals blocks contents | ||
* | ||
* @param string $sintegra | ||
* | ||
* @return string | ||
*/ | ||
protected function totalize($sintegra) | ||
|
@@ -67,7 +87,9 @@ protected function totalize($sintegra) | |
|
||
/** | ||
* Get start of every line of register 90 | ||
* | ||
* @param string $inicioArquivo | ||
* | ||
* @return string | ||
*/ | ||
private function getInicioLinha($inicioArquivo) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,39 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Common; | ||
|
||
/** | ||
* Classe abstrata basica de onde cada bloco é cunstruido | ||
*/ | ||
abstract class Block implements BlockInterface | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
public $elements = []; | ||
/** | ||
* @var array | ||
*/ | ||
public $errors = []; | ||
/** | ||
* @var string | ||
*/ | ||
protected $bloco = ''; | ||
/** | ||
* @var int | ||
*/ | ||
protected $elementTotal; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Common; | ||
|
||
interface BlockInterface | ||
{ | ||
/** | ||
* Retorna o bloco em uma string | ||
* | ||
* @return string | ||
*/ | ||
public function get(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Common; | ||
|
||
use NFePHP\Common\Strings; | ||
|
@@ -136,6 +148,8 @@ protected function standarize(\stdClass $std) | |
* @param string|integer|float|null $input | ||
* @param stdClass $param | ||
* @param string $fieldname | ||
* @param string $element | ||
* @param bool $required | ||
* | ||
* @return string|void | ||
*/ | ||
|
@@ -191,8 +205,9 @@ protected function isFieldInError($input, $param, $fieldname, $element, $require | |
* Formata os campos float | ||
* | ||
* @param string|integer|float|null $value | ||
* @param string $format | ||
* @param int $length | ||
* @param string $fieldname | ||
* @param string|null $format | ||
* | ||
* @return int|string|float|null | ||
*/ | ||
|
@@ -233,6 +248,7 @@ protected function formater( | |
* | ||
* @param float $value | ||
* @param string $format | ||
* @param string $fieldname | ||
* | ||
* @return string | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Common; | ||
|
||
interface ElementInterface | ||
{ | ||
/** | ||
* Este método será usado para validar dados após a validação inicial | ||
* é um processo complementar usado em alguns casos especificos | ||
* | ||
* @return void | ||
*/ | ||
public function postValidation(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* This file belongs to the NFePHP project | ||
* php version 7.0 or higher | ||
* | ||
* @category Library | ||
* @package NFePHP\Sintegra | ||
* @copyright 2019 NFePHP Copyright (c) | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @author Roberto L. Machado <[email protected]> | ||
* @link http://github.com/nfephp-org/sped-sintegra | ||
*/ | ||
|
||
namespace NFePHP\Sintegra\Common; | ||
|
||
/** | ||
|
Oops, something went wrong.