Code Duplication    Length = 15-15 lines in 2 locations

lib/Sii.php 1 location

@@ 174-188 (lines=15) @@
171
            $retry = self::$retry;
172
        if ($args and !is_array($args))
173
            $args = [$args];
174
        if (!self::$verificar_ssl) {
175
            if (self::getAmbiente()==self::PRODUCCION) {
176
                $msg = Estado::get(Estado::ENVIO_SSL_SIN_VERIFICAR);
177
                \sasco\LibreDTE\Log::write(Estado::ENVIO_SSL_SIN_VERIFICAR, $msg, LOG_WARNING);
178
            }
179
            $options = ['stream_context' => stream_context_create([
180
                'ssl' => [
181
                    'verify_peer' => false,
182
                    'verify_peer_name' => false,
183
                    'allow_self_signed' => true
184
                ]
185
            ])];
186
        } else {
187
            $options = [];
188
        }
189
        try {
190
            $soap = new \SoapClient(self::wsdl($wsdl), $options);
191
        } 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);