@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | \sasco\LibreDTE\Log::write(Estado::REQUEST_ERROR_SOAP, Estado::get(Estado::REQUEST_ERROR_SOAP, $msg)); |
537 | 537 | return false; |
538 | 538 | } |
539 | - for ($i=0; $i<$retry; $i++) { |
|
539 | + for ($i = 0; $i<$retry; $i++) { |
|
540 | 540 | try { |
541 | 541 | if ($args) { |
542 | 542 | $body = call_user_func_array([$soap, $request], $args); |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | $dte = '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n".$dte; |
606 | 606 | } |
607 | 607 | do { |
608 | - $file = sys_get_temp_dir().'/dte_'.md5(microtime().$token.$dte).'.'.($gzip?'gz':'xml'); |
|
608 | + $file = sys_get_temp_dir().'/dte_'.md5(microtime().$token.$dte).'.'.($gzip ? 'gz' : 'xml'); |
|
609 | 609 | } while (file_exists($file)); |
610 | 610 | if ($gzip) { |
611 | 611 | $dte = gzencode($dte); |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); |
655 | 655 | } |
656 | 656 | // enviar XML al SII |
657 | - for ($i=0; $i<$retry; $i++) { |
|
657 | + for ($i = 0; $i<$retry; $i++) { |
|
658 | 658 | $response = curl_exec($curl); |
659 | 659 | if ($response and $response!='Error 500') { |
660 | 660 | break; |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | if ($xml->STATUS!=0) { |
684 | 684 | \sasco\LibreDTE\Log::write( |
685 | 685 | $xml->STATUS, |
686 | - Estado::get($xml->STATUS).(isset($xml->DETAIL)?'. '.implode("\n", (array)$xml->DETAIL->ERROR):'') |
|
686 | + Estado::get($xml->STATUS).(isset($xml->DETAIL) ? '. '.implode("\n", (array)$xml->DETAIL->ERROR) : '') |
|
687 | 687 | ); |
688 | 688 | } |
689 | 689 | return $xml; |
@@ -476,8 +476,9 @@ discard block |
||
476 | 476 | // entregar WSDL local (modificados para ambiente de certificación) |
477 | 477 | if ($ambiente==self::CERTIFICACION) { |
478 | 478 | $wsdl = dirname(dirname(__FILE__)).'/wsdl/'.self::$config['servidor'][$ambiente].'/'.$servicio.'.jws'; |
479 | - if (is_readable($wsdl)) |
|
480 | - return $wsdl; |
|
479 | + if (is_readable($wsdl)) { |
|
480 | + return $wsdl; |
|
481 | + } |
|
481 | 482 | } |
482 | 483 | // entregar WSDL oficial desde SII |
483 | 484 | $location = isset(self::$config['wsdl'][$servicio]) ? self::$config['wsdl'][$servicio] : self::$config['wsdl']['*']; |
@@ -748,10 +749,11 @@ discard block |
||
748 | 749 | public static function getAmbiente($ambiente = null) |
749 | 750 | { |
750 | 751 | if ($ambiente===null) { |
751 | - if (defined('_LibreDTE_CERTIFICACION_')) |
|
752 | - $ambiente = (int)_LibreDTE_CERTIFICACION_; |
|
753 | - else |
|
754 | - $ambiente = self::$ambiente; |
|
752 | + if (defined('_LibreDTE_CERTIFICACION_')) { |
|
753 | + $ambiente = (int)_LibreDTE_CERTIFICACION_; |
|
754 | + } else { |
|
755 | + $ambiente = self::$ambiente; |
|
756 | + } |
|
755 | 757 | } |
756 | 758 | return $ambiente; |
757 | 759 | } |