Completed
Push — master ( e40032...5caa47 )
by Esteban De La Fuente
01:55
created
lib/CSV.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public static function read($archivo, $separador = ';', $delimitadortexto = '"')
48 48
     {
49
-        if (($handle = fopen($archivo, 'r')) !== FALSE) {
49
+        if (($handle = fopen($archivo, 'r'))!==FALSE) {
50 50
             $data = array();
51 51
             $i = 0;
52
-            while (($row = fgetcsv($handle, 0, $separador, $delimitadortexto)) !== FALSE) {
52
+            while (($row = fgetcsv($handle, 0, $separador, $delimitadortexto))!==FALSE) {
53 53
                 $j = 0;
54 54
                 foreach ($row as &$col) {
55 55
                     $data[$i][$j++] = $col;
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
         header('Content-Disposition: attachment; filename='.$archivo.'.csv');
78 78
         header('Pragma: no-cache');
79 79
         header('Expires: 0');
80
-        foreach($data as &$row) {
81
-            foreach($row as &$col) {
80
+        foreach ($data as &$row) {
81
+            foreach ($row as &$col) {
82 82
                 $col = $delimitadortexto.rtrim(str_replace('<br />', ', ', strip_tags($col, '<br>')), " \t\n\r\0\x0B,").$delimitadortexto;
83 83
             }
84
-            echo implode($separador, $row),"\r\n";
84
+            echo implode($separador, $row), "\r\n";
85 85
             unset($row);
86 86
         }
87 87
         unset($data);
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
     public static function save(array $data, $archivo, $separador = ';', $delimitadortexto = '"')
101 101
     {
102 102
         $fd = fopen($archivo, 'w');
103
-        foreach($data as &$row) {
104
-            foreach($row as &$col) {
103
+        foreach ($data as &$row) {
104
+            foreach ($row as &$col) {
105 105
                 $col = $delimitadortexto.rtrim(str_replace('<br />', ', ', strip_tags($col, '<br>')), " \t\n\r\0\x0B,").$delimitadortexto;
106 106
             }
107 107
             fwrite($fd, implode($separador, $row)."\r\n");
Please login to merge, or discard this patch.
lib/Estado.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -174,12 +174,14 @@
 block discarded – undo
174 174
     public static function get($codigo, $args = null)
175 175
     {
176 176
         // si no hay glosa asociada al código se entrega el mismo código
177
-        if (!isset(self::$glosas[(int)$codigo]))
178
-            return (int)$codigo;
177
+        if (!isset(self::$glosas[(int)$codigo])) {
178
+                    return (int)$codigo;
179
+        }
179 180
         // si los argumentos no son un arreglo se obtiene arreglo a partir
180 181
         // de los argumentos pasados a la función
181
-        if (!is_array($args))
182
-            $args = array_slice(func_get_args(), 1);
182
+        if (!is_array($args)) {
183
+                    $args = array_slice(func_get_args(), 1);
184
+        }
183 185
         // entregar glosa
184 186
         return vsprintf(I18n::translate(self::$glosas[(int)$codigo], 'estados'), $args);
185 187
     }
Please login to merge, or discard this patch.
lib/Sii/Factoring/DteCedido.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 
69 69
     /**
70 70
      * Método que realiza la firma del DTE cedido
71
-     * @param Firma objeto que representa la Firma Electrónca
71
+     * @param Firma \sasco\LibreDTE\FirmaElectronica que representa la Firma Electrónca
72 72
      * @return =true si el DTE pudo ser fimado o =false si no se pudo firmar
73 73
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
74 74
      * @version 2016-12-10
Please login to merge, or discard this patch.
examples/016-etapa_intercambio_EnvioRecibos.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 
67 67
 // si hubo errores mostrar
68 68
 foreach (\sasco\LibreDTE\Log::readAll() as $error)
69
-    echo $error,"\n";
69
+    echo $error, "\n";
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,5 +98,6 @@
 block discarded – undo
98 98
 }
99 99
 
100 100
 // si hubo errores mostrar
101
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
101
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
102 102
     echo $error,"\n";
103
+}
Please login to merge, or discard this patch.
examples/027-ventas_sin_movimiento.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 
67 67
 // si hubo errores mostrar
68 68
 foreach (\sasco\LibreDTE\Log::readAll() as $error)
69
-    echo $error,"\n";
69
+    echo $error, "\n";
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,5 +65,6 @@
 block discarded – undo
65 65
 var_dump($track_id);
66 66
 
67 67
 // si hubo errores mostrar
68
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
68
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
69 69
     echo $error,"\n";
70
+}
Please login to merge, or discard this patch.
examples/030-boleta_consumo_folio.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 
67 67
 // si hubo errores mostrar
68 68
 foreach (\sasco\LibreDTE\Log::readAll() as $error)
69
-    echo $error,"\n";
69
+    echo $error, "\n";
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,5 +98,6 @@
 block discarded – undo
98 98
 }
99 99
 
100 100
 // si hubo errores mostrar
101
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
101
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
102 102
     echo $error,"\n";
103
+}
Please login to merge, or discard this patch.
examples/034-xml_entities.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,5 +83,6 @@
 block discarded – undo
83 83
 echo $XML2->getFlattened('/nodo1/nodo2')."\n\n";
84 84
 
85 85
 // si hubo errores mostrar
86
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
86
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
87 87
     echo $error, "\n";
88
+}
Please login to merge, or discard this patch.
examples/011-set_pruebas_factura_exenta.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 
67 67
 // si hubo errores mostrar
68 68
 foreach (\sasco\LibreDTE\Log::readAll() as $error)
69
-    echo $error,"\n";
69
+    echo $error, "\n";
Please login to merge, or discard this patch.
Braces   +10 added lines, -6 removed lines patch added patch discarded remove patch
@@ -411,17 +411,20 @@  discard block
 block discarded – undo
411 411
 // Objetos de Firma, Folios y EnvioDTE
412 412
 $Firma = new \sasco\LibreDTE\FirmaElectronica($config['firma']);
413 413
 $Folios = [];
414
-foreach ($folios as $tipo => $cantidad)
414
+foreach ($folios as $tipo => $cantidad) {
415 415
     $Folios[$tipo] = new \sasco\LibreDTE\Sii\Folios(file_get_contents('xml/folios/'.$tipo.'.xml'));
416
+}
416 417
 $EnvioDTE = new \sasco\LibreDTE\Sii\EnvioDte();
417 418
 
418 419
 // generar cada DTE, timbrar, firmar y agregar al sobre de EnvioDTE
419 420
 foreach ($set_pruebas as $documento) {
420 421
     $DTE = new \sasco\LibreDTE\Sii\Dte($documento);
421
-    if (!$DTE->timbrar($Folios[$DTE->getTipo()]))
422
-        break;
423
-    if (!$DTE->firmar($Firma))
424
-        break;
422
+    if (!$DTE->timbrar($Folios[$DTE->getTipo()])) {
423
+            break;
424
+    }
425
+    if (!$DTE->firmar($Firma)) {
426
+            break;
427
+    }
425 428
     $EnvioDTE->agregar($DTE);
426 429
 }
427 430
 
@@ -433,5 +436,6 @@  discard block
 block discarded – undo
433 436
 var_dump($track_id);
434 437
 
435 438
 // si hubo errores mostrar
436
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
439
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
437 440
     echo $error,"\n";
441
+}
Please login to merge, or discard this patch.
examples/015-etapa_intercambio_RecepcionDTE.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 
67 67
 // si hubo errores mostrar
68 68
 foreach (\sasco\LibreDTE\Log::readAll() as $error)
69
-    echo $error,"\n";
69
+    echo $error, "\n";
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,5 +98,6 @@
 block discarded – undo
98 98
 }
99 99
 
100 100
 // si hubo errores mostrar
101
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
101
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
102 102
     echo $error,"\n";
103
+}
Please login to merge, or discard this patch.