| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace NFePHP\EFD\Elements\ICMSIPI; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | use NFePHP\EFD\Common\Element; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | use NFePHP\EFD\Common\ElementInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | use \stdClass; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 9 |  | View Code Duplication | class G126 extends Element implements ElementInterface | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |     const REG = 'G126'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |     const LEVEL = 4; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |     const PARENT = 'G!20'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |     protected $parameters = [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |         'DT_INI' => [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |             'type' => 'string', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |             'regex' => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |             'required' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |             'info' => 'Data inicial do período de apuração ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |             'format' => '' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |         ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |         'DT_FIM' => [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |             'type' => 'string', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |             'regex' => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |             'required' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |             'info' => 'Data final do período de apuração ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |             'format' => '' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |         ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |         'NUM_PARC' => [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |             'type' => 'numeric', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |             'regex' => '^(\d{1,3})$', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |             'required' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |             'info' => 'Número da parcela do ICMS ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |             'format' => '' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |         ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |         'VL_PARC_PASS' => [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |             'type' => 'numeric', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |             'regex' => '^\d+(\.\d*)?|\.\d+$', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |             'required' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |             'info' => 'Valor da parcela de ICMS passível de apropriação - antes da aplicação da ' . | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |                 'totais ' . | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |                 'participação percentual do valor das saídas tributadas/exportação sobre as saídas ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |             'format' => '15v2' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |         ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |         'VL_TRIB_OC' => [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |             'type' => 'numeric', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |             'regex' => '^\d+(\.\d*)?|\.\d+$', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |             'required' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |             'info' => 'Valor do somatório das saídas tributadas e saídas para exportação no período ' . | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |                 'indicado neste registro ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |             'format' => '15v2' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |         ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |         'VL_TOTAL' => [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |             'type' => 'numeric', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |             'regex' => '^\d+(\.\d*)?|\.\d+$', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |             'required' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |             'info' => 'Valor total de saídas no período indicado neste registro ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |             'format' => '15v2' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |         ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |         'IND_PER_SAI' => [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |             'type' => 'numeric', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |             'regex' => '^\d+(\.\d*)?|\.\d+$', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |             'required' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |             'info' => 'Índice de participação do valor do somatório das saídas tributadas e saídas para ' . | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |                 'exportação no valor total de saídas (Campo 06 dividido pelo campo 07) ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |             'format' => '15v8' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |         ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |         'VL_PARC_APROP' => [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |             'type' => 'numeric', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |             'regex' => '^\d+(\.\d*)?|\.\d+$', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |             'required' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |             'info' => 'Valor de outros créditos de ICMS a ser apropriado na apuração (campo 05 vezes o campo ' . | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |                 '08) ', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |             'format' => '15v2' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |         ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |     ]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |      * Constructor | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |      * @param \stdClass $std | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 83 |  |  |      */ | 
            
                                                        
            
                                    
            
            
                | 84 |  |  |     public function __construct(\stdClass $std) | 
            
                                                        
            
                                    
            
            
                | 85 |  |  |     { | 
            
                                                        
            
                                    
            
            
                | 86 |  |  |         parent::__construct(self::REG); | 
            
                                                        
            
                                    
            
            
                | 87 |  |  |         $this->std = $this->standarize($std); | 
            
                                                        
            
                                    
            
            
                | 88 |  |  |     } | 
            
                                                        
            
                                    
            
            
                | 89 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 90 |  |  |  | 
            
                        
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.