Completed
Push — master ( 601c82...391562 )
by Esteban De La Fuente
39s queued 33s
created
lib/Sii/Factoring/Aec.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
     {
185 185
         // definir datos que se usarán en el envío
186 186
         list($rutCompany, $dvCompany) = explode('-', str_replace('.', '', $empresa));
187
-        if (strpos($dte, '<?xml') === false) {
188
-            $dte = '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n" . $dte;
187
+        if (strpos($dte, '<?xml')===false) {
188
+            $dte = '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n".$dte;
189 189
         }
190 190
         do {
191
-            $file = sys_get_temp_dir() . '/aec_' . md5(microtime() . $token . $dte) . '.xml';
191
+            $file = sys_get_temp_dir().'/aec_'.md5(microtime().$token.$dte).'.xml';
192 192
         } while (file_exists($file));
193 193
         file_put_contents($file, $dte);
194 194
         $data = [
@@ -228,17 +228,17 @@  discard block
 block discarded – undo
228 228
             curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
229 229
         }
230 230
         // enviar XML al SII
231
-        for ($i = 0; $i < $retry; $i++) {
231
+        for ($i = 0; $i<$retry; $i++) {
232 232
             $response = curl_exec($curl);
233
-            if ($response and $response != 'Error 500')
233
+            if ($response and $response!='Error 500')
234 234
                 break;
235 235
         }
236 236
         unlink($file);
237 237
         // verificar respuesta del envío y entregar error en caso que haya uno
238
-        if (!$response or $response == 'Error 500') {
238
+        if (!$response or $response=='Error 500') {
239 239
             if (!$response)
240 240
                 \sasco\LibreDTE\Log::write(\sasco\LibreDTE\Estado::ENVIO_ERROR_CURL, \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::ENVIO_ERROR_CURL, curl_error($curl)));
241
-            if ($response == 'Error 500')
241
+            if ($response=='Error 500')
242 242
                 \sasco\LibreDTE\Log::write(\sasco\LibreDTE\Estado::ENVIO_ERROR_500, \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::ENVIO_ERROR_500));
243 243
             return false;
244 244
         }
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
             9 => 'Error Interno',
271 271
             10 => 'Error Interno'
272 272
         ];
273
-        if ($xml->STATUS != 0) {
273
+        if ($xml->STATUS!=0) {
274 274
             \sasco\LibreDTE\Log::write(
275 275
                 $xml->STATUS,
276 276
                 $error[(int)$xml->STATUS]
Please login to merge, or discard this patch.