Code Duplication    Length = 15-15 lines in 2 locations

lib/Sii.php 1 location

@@ 503-517 (lines=15) @@
500
            $retry = self::$retry;
501
        if ($args and !is_array($args))
502
            $args = [$args];
503
        if (!self::$verificar_ssl) {
504
            if (self::getAmbiente()==self::PRODUCCION) {
505
                $msg = Estado::get(Estado::ENVIO_SSL_SIN_VERIFICAR);
506
                \sasco\LibreDTE\Log::write(Estado::ENVIO_SSL_SIN_VERIFICAR, $msg, LOG_WARNING);
507
            }
508
            $options = ['stream_context' => stream_context_create([
509
                'ssl' => [
510
                    'verify_peer' => false,
511
                    'verify_peer_name' => false,
512
                    'allow_self_signed' => true
513
                ]
514
            ])];
515
        } else {
516
            $options = [];
517
        }
518
        try {
519
            $soap = new \SoapClient(self::wsdl($wsdl), $options);
520
        } catch (\Exception $e) {

lib/Sii/RegistroCompraVenta.php 1 location

@@ 212-226 (lines=15) @@
209
     */
210
    private function request($request, $args, $retry = 10)
211
    {
212
        if (!\sasco\LibreDTE\Sii::getVerificarSSL()) {
213
            if (\sasco\LibreDTE\Sii::getAmbiente()==\sasco\LibreDTE\Sii::PRODUCCION) {
214
                $msg = \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::ENVIO_SSL_SIN_VERIFICAR);
215
                \sasco\LibreDTE\Log::write(\sasco\LibreDTE\Estado::ENVIO_SSL_SIN_VERIFICAR, $msg, LOG_WARNING);
216
            }
217
            $options = ['stream_context' => stream_context_create([
218
                'ssl' => [
219
                    'verify_peer' => false,
220
                    'verify_peer_name' => false,
221
                    'allow_self_signed' => true
222
                ]
223
            ])];
224
        } else {
225
            $options = [];
226
        }
227
        try {
228
            $wsdl = self::$wsdl[\sasco\LibreDTE\Sii::getAmbiente()];
229
            $soap = new \SoapClient($wsdl, $options);