Skip to content

Commit

Permalink
ajustes phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
robmachado committed Oct 22, 2021
1 parent 5f6ac5b commit 996201b
Show file tree
Hide file tree
Showing 43 changed files with 572 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"scripts": {
"phpcbf": "vendor/bin/phpcbf --standard=psr2 src/",
"phpcs": "vendor/bin/phpcs --standard=psr2 src/",
"stan": "vendor/bin/phpstan analyse src/",
"stan": "vendor/bin/phpstan analyse --level=6 src/",
"test": "phpunit --colors=always"
},
"config": {
Expand Down
19 changes: 18 additions & 1 deletion src/Blocks/Block1.php
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'],
Expand Down
15 changes: 15 additions & 0 deletions src/Blocks/Block5.php
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;
Expand All @@ -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'],
Expand Down
15 changes: 15 additions & 0 deletions src/Blocks/Block6.php
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;
Expand All @@ -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'],
Expand Down
15 changes: 15 additions & 0 deletions src/Blocks/Block7.php
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;
Expand All @@ -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'],
Expand Down
15 changes: 15 additions & 0 deletions src/Blocks/Block8.php
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;
Expand All @@ -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'],
Expand Down
24 changes: 23 additions & 1 deletion src/Common/BaseSintegra.php
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
Expand All @@ -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)
{
Expand All @@ -30,6 +46,8 @@ public function add(BlockInterface $block = null)

/**
* Create a SINTEGRA string
*
* @return string
*/
public function get()
{
Expand All @@ -46,7 +64,9 @@ public function get()

/**
* Totals blocks contents
*
* @param string $sintegra
*
* @return string
*/
protected function totalize($sintegra)
Expand All @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions src/Common/Block.php
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;

/**
Expand Down
17 changes: 17 additions & 0 deletions src/Common/BlockInterface.php
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();
}
18 changes: 17 additions & 1 deletion src/Common/Element.php
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;
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -233,6 +248,7 @@ protected function formater(
*
* @param float $value
* @param string $format
* @param string $fieldname
*
* @return string
*/
Expand Down
18 changes: 18 additions & 0 deletions src/Common/ElementInterface.php
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();
}
12 changes: 12 additions & 0 deletions src/Common/Enum.php
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;

/**
Expand Down
Loading

0 comments on commit 996201b

Please sign in to comment.