Completed
Push — master ( 4ca886...f7ce7e )
by Esteban De La Fuente
02:15
created
lib/Sii.php 1 patch
Braces   +20 added lines, -14 removed lines patch added patch discarded remove patch
@@ -476,8 +476,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
@@ -777,8 +779,9 @@  discard block
 block discarded – undo
777 779
     {
778 780
         // solicitar token
779 781
         $token = \sasco\LibreDTE\Sii\Autenticacion::getToken($Firma);
780
-        if (!$token)
781
-            return false;
782
+        if (!$token) {
783
+                    return false;
784
+        }
782 785
         // definir ambiente y servidor
783 786
         $ambiente = self::getAmbiente($ambiente);
784 787
         $servidor = self::$config['servidor'][$ambiente];
@@ -807,8 +810,9 @@  discard block
 block discarded – undo
807 810
         }
808 811
         // realizar consulta curl
809 812
         $response = curl_exec($curl);
810
-        if (!$response)
811
-            return false;
813
+        if (!$response) {
814
+                    return false;
815
+        }
812 816
         // cerrar sesión curl
813 817
         curl_close($curl);
814 818
         // entregar datos del archivo CSV
@@ -819,10 +823,12 @@  discard block
 block discarded – undo
819 823
         for ($i=1; $i<$n_lines; $i++) {
820 824
             $row = str_getcsv($lines[$i], ';', '');
821 825
             unset($lines[$i]);
822
-            if (!isset($row[5]))
823
-                continue;
824
-            for ($j=0; $j<6; $j++)
825
-                $row[$j] = trim($row[$j]);
826
+            if (!isset($row[5])) {
827
+                            continue;
828
+            }
829
+            for ($j=0; $j<6; $j++) {
830
+                            $row[$j] = trim($row[$j]);
831
+            }
826 832
             $row[1] = utf8_decode($row[1]);
827 833
             $row[4] = strtolower($row[4]);
828 834
             $row[5] = strtolower($row[5]);
Please login to merge, or discard this patch.