for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NFePHP\EFD\Elements\ICMSIPI;
use NFePHP\EFD\Common\Element;
use NFePHP\EFD\Common\ElementInterface;
use \stdClass;
class C425 extends Element implements ElementInterface
{
const REG = 'C425';
const LEVEL = 5;
const PARENT = 'C420';
protected $parameters = [
'COD_ITEM' => [
'type' => 'string',
'regex' => '^.{1,60}$',
'required' => true,
'info' => 'Código do item (campo 02 do Registro 0200)',
'format' => ''
],
'QTD' => [
'type' => 'numeric',
'regex' => '^\d+(\.\d*)?|\.\d+$',
'info' => 'Quantidade acumulada do item',
'format' => '15v3'
'UNID' => [
'regex' => '^.{1,6}$',
'info' => 'Unidade do item (Campo 02 do registro 0190)',
'VL_ITEM' => [
'info' => 'Valor acumulado do item',
'format' => '15v2'
'VL_PIS' => [
'required' => false,
'info' => 'Valor do PIS',
'VL_COFINS' => [
'info' => 'Valor da COFINS',
];
/**
* Constructor
* @param \stdClass $std
*/
public function __construct(\stdClass $std)
parent::__construct(self::REG);
$this->std = $this->standarize($std);
$this->postValidation();
}
public function postValidation()
if ($this->values->vl_item <= 0) {
throw new \InvalidArgumentException("[" . self::REG . "] " .
" O Valor acumulado do item (VL_ITEM) deve ser maior que 0");