Code Duplication    Length = 9-9 lines in 5 locations

lib/Sii/Dte.php 5 locations

@@ 265-273 (lines=9) @@
262
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
263
     * @version 2015-09-07
264
     */
265
    public function getEmisor()
266
    {
267
        $nodo = $this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/Emisor/RUTEmisor')->item(0);
268
        if ($nodo)
269
            return $nodo->nodeValue;
270
        if (!$this->getDatos())
271
            return false;
272
        return $this->datos['Encabezado']['Emisor']['RUTEmisor'];
273
    }
274
275
    /**
276
     * Método que entrega rut del receptor del DTE
@@ 281-289 (lines=9) @@
278
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
279
     * @version 2015-09-07
280
     */
281
    public function getReceptor()
282
    {
283
        $nodo = $this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/Receptor/RUTRecep')->item(0);
284
        if ($nodo)
285
            return $nodo->nodeValue;
286
        if (!$this->getDatos())
287
            return false;
288
        return $this->datos['Encabezado']['Receptor']['RUTRecep'];
289
    }
290
291
    /**
292
     * Método que entrega fecha de emisión del DTE
@@ 297-305 (lines=9) @@
294
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
295
     * @version 2015-09-07
296
     */
297
    public function getFechaEmision()
298
    {
299
        $nodo = $this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/IdDoc/FchEmis')->item(0);
300
        if ($nodo)
301
            return $nodo->nodeValue;
302
        if (!$this->getDatos())
303
            return false;
304
        return $this->datos['Encabezado']['IdDoc']['FchEmis'];
305
    }
306
307
    /**
308
     * Método que entrega el monto total del DTE
@@ 313-321 (lines=9) @@
310
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
311
     * @version 2015-09-07
312
     */
313
    public function getMontoTotal()
314
    {
315
        $nodo = $this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/Totales/MntTotal')->item(0);
316
        if ($nodo)
317
            return $nodo->nodeValue;
318
        if (!$this->getDatos())
319
            return false;
320
        return $this->datos['Encabezado']['Totales']['MntTotal'];
321
    }
322
323
    /**
324
     * Método que entrega el tipo de moneda del documento
@@ 329-337 (lines=9) @@
326
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
327
     * @version 2016-07-16
328
     */
329
    public function getMoneda()
330
    {
331
        $nodo = $this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/Totales/TpoMoneda')->item(0);
332
        if ($nodo)
333
            return $nodo->nodeValue;
334
        if (!$this->getDatos())
335
            return false;
336
        return $this->datos['Encabezado']['Totales']['TpoMoneda'];
337
    }
338
339
    /**
340
     * Método que entrega el string XML del tag TED