Code Duplication    Length = 13-13 lines in 2 locations

lib/Sii.php 1 location

@@ 516-528 (lines=13) @@
513
            $args = [$args];
514
        }
515
        $options = ['cache_wsdl' => WSDL_CACHE_DISK, 'keep_alive' => false];
516
        if (!self::$verificar_ssl) {
517
            if (self::getAmbiente()==self::PRODUCCION) {
518
                $msg = Estado::get(Estado::ENVIO_SSL_SIN_VERIFICAR);
519
                \sasco\LibreDTE\Log::write(Estado::ENVIO_SSL_SIN_VERIFICAR, $msg, LOG_WARNING);
520
            }
521
            $options['stream_context'] = stream_context_create([
522
                'ssl' => [
523
                    'verify_peer' => false,
524
                    'verify_peer_name' => false,
525
                    'allow_self_signed' => true
526
                ]
527
            ]);
528
        }
529
        try {
530
            $soap = new \SoapClient(self::wsdl($wsdl), $options);
531
        } catch (\Exception $e) {

lib/Sii/RegistroCompraVenta.php 1 location

@@ 222-234 (lines=13) @@
219
    private function request($request, $args, $retry = 10)
220
    {
221
        $options = ['keep_alive' => false];
222
        if (!\sasco\LibreDTE\Sii::getVerificarSSL()) {
223
            if (\sasco\LibreDTE\Sii::getAmbiente()==\sasco\LibreDTE\Sii::PRODUCCION) {
224
                $msg = \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::ENVIO_SSL_SIN_VERIFICAR);
225
                \sasco\LibreDTE\Log::write(\sasco\LibreDTE\Estado::ENVIO_SSL_SIN_VERIFICAR, $msg, LOG_WARNING);
226
            }
227
            $options['stream_context'] = stream_context_create([
228
                'ssl' => [
229
                    'verify_peer' => false,
230
                    'verify_peer_name' => false,
231
                    'allow_self_signed' => true
232
                ]
233
            ]);
234
        }
235
        // buscar WSDL
236
        $ambiente = \sasco\LibreDTE\Sii::getAmbiente();
237
        $wsdl = dirname(dirname(dirname(__FILE__))).'/wsdl/'.self::$config['servidor'][$ambiente].'/registroreclamodteservice.xml';