Code Duplication    Length = 88-89 lines in 4 locations

src/Make.php 4 locations

@@ 1783-1871 (lines=89) @@
1780
     *
1781
     * @return \DOMElement
1782
     */
1783
    public function enderRemeTag(
1784
        $xLgr = '',
1785
        $nro = '',
1786
        $xCpl = '',
1787
        $xBairro = '',
1788
        $cMun = '',
1789
        $xMun = '',
1790
        $CEP = '',
1791
        $UF = '',
1792
        $cPais = '',
1793
        $xPais = ''
1794
    ) {
1795
        $identificador = '#119 <enderReme> - ';
1796
        $this->enderReme = $this->dom->createElement('enderReme');
1797
        $this->dom->addChild(
1798
            $this->enderReme,
1799
            'xLgr',
1800
            $xLgr,
1801
            true,
1802
            $identificador . 'Logradouro'
1803
        );
1804
        $this->dom->addChild(
1805
            $this->enderReme,
1806
            'nro',
1807
            $nro,
1808
            true,
1809
            $identificador . 'Número'
1810
        );
1811
        $this->dom->addChild(
1812
            $this->enderReme,
1813
            'xCpl',
1814
            $xCpl,
1815
            false,
1816
            $identificador . 'Complemento'
1817
        );
1818
        $this->dom->addChild(
1819
            $this->enderReme,
1820
            'xBairro',
1821
            $xBairro,
1822
            true,
1823
            $identificador . 'Bairro'
1824
        );
1825
        $this->dom->addChild(
1826
            $this->enderReme,
1827
            'cMun',
1828
            $cMun,
1829
            true,
1830
            $identificador . 'Código do município (utilizar a tabela do IBGE)'
1831
        );
1832
        $this->dom->addChild(
1833
            $this->enderReme,
1834
            'xMun',
1835
            $xMun,
1836
            true,
1837
            $identificador . 'Nome do município'
1838
        );
1839
        $this->dom->addChild(
1840
            $this->enderReme,
1841
            'CEP',
1842
            $CEP,
1843
            false,
1844
            $identificador . 'CEP'
1845
        );
1846
        $this->dom->addChild(
1847
            $this->enderReme,
1848
            'UF',
1849
            $UF,
1850
            true,
1851
            $identificador . 'Sigla da UF'
1852
        );
1853
        $this->dom->addChild(
1854
            $this->enderReme,
1855
            'cPais',
1856
            $cPais,
1857
            false,
1858
            $identificador . 'Código do país'
1859
        );
1860
        $this->dom->addChild(
1861
            $this->enderReme,
1862
            'xPais',
1863
            $xPais,
1864
            false,
1865
            $identificador . 'Nome do país'
1866
        );
1867
1868
        $node = $this->rem->getElementsByTagName("email")->item(0);
1869
        $this->rem->insertBefore($this->enderReme, $node);
1870
        return $this->enderReme;
1871
    }
1872
1873
    /**
1874
     * Gera as tags para o elemento: "exped" (Informações do Expedidor da Carga)
@@ 1976-2064 (lines=89) @@
1973
     *
1974
     * @return \DOMElement
1975
     */
1976
    public function enderExpedTag(
1977
        $xLgr = '',
1978
        $nro = '',
1979
        $xCpl = '',
1980
        $xBairro = '',
1981
        $cMun = '',
1982
        $xMun = '',
1983
        $CEP = '',
1984
        $UF = '',
1985
        $cPais = '',
1986
        $xPais = ''
1987
    ) {
1988
        $identificador = '#148 <enderExped> - ';
1989
        $this->enderExped = $this->dom->createElement('enderExped');
1990
        $this->dom->addChild(
1991
            $this->enderExped,
1992
            'xLgr',
1993
            $xLgr,
1994
            true,
1995
            $identificador . 'Logradouro'
1996
        );
1997
        $this->dom->addChild(
1998
            $this->enderExped,
1999
            'nro',
2000
            $nro,
2001
            true,
2002
            $identificador . 'Número'
2003
        );
2004
        $this->dom->addChild(
2005
            $this->enderExped,
2006
            'xCpl',
2007
            $xCpl,
2008
            false,
2009
            $identificador . 'Complemento'
2010
        );
2011
        $this->dom->addChild(
2012
            $this->enderExped,
2013
            'xBairro',
2014
            $xBairro,
2015
            true,
2016
            $identificador . 'Bairro'
2017
        );
2018
        $this->dom->addChild(
2019
            $this->enderExped,
2020
            'cMun',
2021
            $cMun,
2022
            true,
2023
            $identificador . 'Código do município (utilizar a tabela do IBGE)'
2024
        );
2025
        $this->dom->addChild(
2026
            $this->enderExped,
2027
            'xMun',
2028
            $xMun,
2029
            true,
2030
            $identificador . 'Nome do município'
2031
        );
2032
        $this->dom->addChild(
2033
            $this->enderExped,
2034
            'CEP',
2035
            $CEP,
2036
            false,
2037
            $identificador . 'CEP'
2038
        );
2039
        $this->dom->addChild(
2040
            $this->enderExped,
2041
            'UF',
2042
            $UF,
2043
            true,
2044
            $identificador . 'Sigla da UF'
2045
        );
2046
        $this->dom->addChild(
2047
            $this->enderExped,
2048
            'cPais',
2049
            $cPais,
2050
            false,
2051
            $identificador . 'Código do país'
2052
        );
2053
        $this->dom->addChild(
2054
            $this->enderExped,
2055
            'xPais',
2056
            $xPais,
2057
            false,
2058
            $identificador . 'Nome do país'
2059
        );
2060
2061
        $node = $this->exped->getElementsByTagName("email")->item(0);
2062
        $this->exped->insertBefore($this->enderExped, $node);
2063
        return $this->enderExped;
2064
    }
2065
2066
    /**
2067
     * Gera as tags para o elemento: "receb" (Informações do Recebedor da Carga)
@@ 2169-2257 (lines=89) @@
2166
     *
2167
     * @return \DOMElement
2168
     */
2169
    public function enderRecebTag(
2170
        $xLgr = '',
2171
        $nro = '',
2172
        $xCpl = '',
2173
        $xBairro = '',
2174
        $cMun = '',
2175
        $xMun = '',
2176
        $CEP = '',
2177
        $UF = '',
2178
        $cPais = '',
2179
        $xPais = ''
2180
    ) {
2181
        $identificador = '#160 <enderReceb> - ';
2182
        $this->enderReceb = $this->dom->createElement('enderReceb');
2183
        $this->dom->addChild(
2184
            $this->enderReceb,
2185
            'xLgr',
2186
            $xLgr,
2187
            true,
2188
            $identificador . 'Logradouro'
2189
        );
2190
        $this->dom->addChild(
2191
            $this->enderReceb,
2192
            'nro',
2193
            $nro,
2194
            true,
2195
            $identificador . 'Número'
2196
        );
2197
        $this->dom->addChild(
2198
            $this->enderReceb,
2199
            'xCpl',
2200
            $xCpl,
2201
            false,
2202
            $identificador . 'Complemento'
2203
        );
2204
        $this->dom->addChild(
2205
            $this->enderReceb,
2206
            'xBairro',
2207
            $xBairro,
2208
            true,
2209
            $identificador . 'Bairro'
2210
        );
2211
        $this->dom->addChild(
2212
            $this->enderReceb,
2213
            'cMun',
2214
            $cMun,
2215
            true,
2216
            $identificador . 'Código do município (utilizar a tabela do IBGE)'
2217
        );
2218
        $this->dom->addChild(
2219
            $this->enderReceb,
2220
            'xMun',
2221
            $xMun,
2222
            true,
2223
            $identificador . 'Nome do município'
2224
        );
2225
        $this->dom->addChild(
2226
            $this->enderReceb,
2227
            'CEP',
2228
            $CEP,
2229
            false,
2230
            $identificador . 'CEP'
2231
        );
2232
        $this->dom->addChild(
2233
            $this->enderReceb,
2234
            'UF',
2235
            $UF,
2236
            true,
2237
            $identificador . 'Sigla da UF'
2238
        );
2239
        $this->dom->addChild(
2240
            $this->enderReceb,
2241
            'cPais',
2242
            $cPais,
2243
            false,
2244
            $identificador . 'Código do país'
2245
        );
2246
        $this->dom->addChild(
2247
            $this->enderReceb,
2248
            'xPais',
2249
            $xPais,
2250
            false,
2251
            $identificador . 'Nome do país'
2252
        );
2253
2254
        $node = $this->receb->getElementsByTagName("email")->item(0);
2255
        $this->receb->insertBefore($this->enderReceb, $node);
2256
        return $this->enderReceb;
2257
    }
2258
2259
    /**
2260
     * Gera as tags para o elemento: "dest" (Informações do Destinatário do CT-e)
@@ 2370-2457 (lines=88) @@
2367
     *
2368
     * @return \DOMElement
2369
     */
2370
    public function enderDestTag(
2371
        $xLgr = '',
2372
        $nro = '',
2373
        $xCpl = '',
2374
        $xBairro = '',
2375
        $cMun = '',
2376
        $xMun = '',
2377
        $CEP = '',
2378
        $UF = '',
2379
        $cPais = '',
2380
        $xPais = ''
2381
    ) {
2382
        $identificador = '#185 <enderDest> - ';
2383
        $this->enderDest = $this->dom->createElement('enderDest');
2384
        $this->dom->addChild(
2385
            $this->enderDest,
2386
            'xLgr',
2387
            $xLgr,
2388
            true,
2389
            $identificador . 'Logradouro'
2390
        );
2391
        $this->dom->addChild(
2392
            $this->enderDest,
2393
            'nro',
2394
            $nro,
2395
            true,
2396
            $identificador . 'Número'
2397
        );
2398
        $this->dom->addChild(
2399
            $this->enderDest,
2400
            'xCpl',
2401
            $xCpl,
2402
            false,
2403
            $identificador . 'Complemento'
2404
        );
2405
        $this->dom->addChild(
2406
            $this->enderDest,
2407
            'xBairro',
2408
            $xBairro,
2409
            true,
2410
            $identificador . 'Bairro'
2411
        );
2412
        $this->dom->addChild(
2413
            $this->enderDest,
2414
            'cMun',
2415
            $cMun,
2416
            true,
2417
            $identificador . 'Código do município (utilizar a tabela do IBGE)'
2418
        );
2419
        $this->dom->addChild(
2420
            $this->enderDest,
2421
            'xMun',
2422
            $xMun,
2423
            true,
2424
            $identificador . 'Nome do município'
2425
        );
2426
        $this->dom->addChild(
2427
            $this->enderDest,
2428
            'CEP',
2429
            $CEP,
2430
            false,
2431
            $identificador . 'CEP'
2432
        );
2433
        $this->dom->addChild(
2434
            $this->enderDest,
2435
            'UF',
2436
            $UF,
2437
            true,
2438
            $identificador . 'Sigla da UF'
2439
        );
2440
        $this->dom->addChild(
2441
            $this->enderDest,
2442
            'cPais',
2443
            $cPais,
2444
            false,
2445
            $identificador . 'Código do país'
2446
        );
2447
        $this->dom->addChild(
2448
            $this->enderDest,
2449
            'xPais',
2450
            $xPais,
2451
            false,
2452
            $identificador . 'Nome do país'
2453
        );
2454
        $node = $this->dest->getElementsByTagName("email")->item(0);
2455
        $this->dest->insertBefore($this->enderDest, $node);
2456
        return $this->enderDest;
2457
    }
2458
2459
    /**
2460
     * Gera as tags para o elemento: "vPrest" (Local de Entrega constante na Nota Fiscal)