Completed
Push — master ( 0f1750...fb3624 )
by Esteban De La Fuente
18s
created
lib/FirmaElectronica.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $logs = \sasco\LibreDTE\Log::readAll();
121 121
         if (!empty($logs)) {
122 122
             foreach ($logs as $Log) {
123
-                if ($Log->code == \sasco\LibreDTE\Estado::FIRMA_ERROR) {
123
+                if ($Log->code==\sasco\LibreDTE\Estado::FIRMA_ERROR) {
124 124
                     throw new \Exception($Log);
125 125
                 }
126 126
             }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         if (empty($run)) {
131 131
             throw new \Exception('No fue posible obtener el RUN de la firma electrónica (verificar contraseña).');
132 132
         }
133
-        if (explode('-', $run)[1] == 'k') {
133
+        if (explode('-', $run)[1]=='k') {
134 134
             throw new \Exception('El RUN '.$run.' asociado a la firma no es válido, termina en "k" (minúscula). Debe adquirir una nueva firma y al comprarla corroborar que la "K" sea mayúscula. Se recomienda no comprar con el mismo proveedor: '.$this->getIssuer().'.');
135 135
         }
136 136
         // validar que la firma está vigente
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         if (!$when) {
296 296
             $when = date('Y-m-d').' 00:00:00';
297 297
         }
298
-        return $this->getTo() > $when;
298
+        return $this->getTo()>$when;
299 299
     }
300 300
 
301 301
     /**
@@ -411,10 +411,10 @@  discard block
 block discarded – undo
411 411
      */
412 412
     public function verify($data, $signature, $pub_key = null, $signature_alg = OPENSSL_ALGO_SHA1)
413 413
     {
414
-        if ($pub_key === null)
414
+        if ($pub_key===null)
415 415
             $pub_key = $this->certs['cert'];
416 416
         $pub_key = $this->normalizeCert($pub_key);
417
-        return openssl_verify($data, base64_decode($signature), $pub_key, $signature_alg) == 1 ? true : false;
417
+        return openssl_verify($data, base64_decode($signature), $pub_key, $signature_alg)==1 ? true : false;
418 418
     }
419 419
 
420 420
     /**
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
         } else {
554 554
             $digest_calculado = base64_encode(sha1($doc->C14N(), true));
555 555
         }
556
-        return $digest_original == $digest_calculado;
556
+        return $digest_original==$digest_calculado;
557 557
     }
558 558
 
559 559
     /**
Please login to merge, or discard this patch.