Code Duplication    Length = 4-4 lines in 3 locations

lib/Sii/RegistroCompraVenta.php 1 location

@@ 252-255 (lines=4) @@
249
                $body = null;
250
            }
251
        }
252
        if ($body===null) {
253
            \sasco\LibreDTE\Log::write(\sasco\LibreDTE\Estado::REQUEST_ERROR_BODY, \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::REQUEST_ERROR_BODY, $wsdl, $retry));
254
            return false;
255
        }
256
        return $body;
257
    }
258

lib/Sii.php 2 locations

@@ 557-560 (lines=4) @@
554
                usleep(200000); // pausa de 0.2 segundos antes de volver a intentar el envĂ­o
555
            }
556
        }
557
        if ($body===null) {
558
            \sasco\LibreDTE\Log::write(Estado::REQUEST_ERROR_BODY, Estado::get(Estado::REQUEST_ERROR_BODY, $wsdl, $retry));
559
            return false;
560
        }
561
        return new \SimpleXMLElement($body, LIBXML_COMPACT);
562
    }
563
@@ 612-615 (lines=4) @@
609
        } while (file_exists($file));
610
        if ($gzip) {
611
            $dte = gzencode($dte);
612
            if ($dte===false) {
613
                \sasco\LibreDTE\Log::write(Estado::ENVIO_ERROR_GZIP, Estado::get(Estado::ENVIO_ERROR_GZIP));
614
                return false;
615
            }
616
        }
617
        file_put_contents($file, $dte);
618
        $data = [