@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | if (!$when) { |
263 | 263 | $when = date('Y-m-d').' 00:00:00'; |
264 | 264 | } |
265 | - return $this->getTo() > $when; |
|
265 | + return $this->getTo()>$when; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -378,10 +378,10 @@ discard block |
||
378 | 378 | */ |
379 | 379 | public function verify($data, $signature, $pub_key = null, $signature_alg = OPENSSL_ALGO_SHA1) |
380 | 380 | { |
381 | - if ($pub_key === null) |
|
381 | + if ($pub_key===null) |
|
382 | 382 | $pub_key = $this->certs['cert']; |
383 | 383 | $pub_key = $this->normalizeCert($pub_key); |
384 | - return openssl_verify($data, base64_decode($signature), $pub_key, $signature_alg) == 1 ? true : false; |
|
384 | + return openssl_verify($data, base64_decode($signature), $pub_key, $signature_alg)==1 ? true : false; |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | } else { |
521 | 521 | $digest_calculado = base64_encode(sha1($doc->C14N(), true)); |
522 | 522 | } |
523 | - return $digest_original == $digest_calculado; |
|
523 | + return $digest_original==$digest_calculado; |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | /** |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | // validar firma del SII sobre los folios |
64 | 64 | $firma = $this->getFirma(); |
65 | 65 | $idk = $this->getIDK(); |
66 | - if ($firma === false || $idk === false) { |
|
66 | + if ($firma===false || $idk===false) { |
|
67 | 67 | return false; |
68 | 68 | } |
69 | 69 | $pub_key = \sasco\LibreDTE\Sii::cert($idk); |
70 | - if ($pub_key === false || openssl_verify($this->xml->getFlattened('/AUTORIZACION/CAF/DA'), base64_decode($firma), $pub_key)!==1) { |
|
70 | + if ($pub_key===false || openssl_verify($this->xml->getFlattened('/AUTORIZACION/CAF/DA'), base64_decode($firma), $pub_key)!==1) { |
|
71 | 71 | \sasco\LibreDTE\Log::write( |
72 | 72 | \sasco\LibreDTE\Estado::FOLIOS_ERROR_FIRMA, |
73 | 73 | \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::FOLIOS_ERROR_FIRMA) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ); |
99 | 99 | return false; |
100 | 100 | } |
101 | - return $plain === $plain_firmado; |
|
101 | + return $plain===$plain_firmado; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | public function getCertificacion() |
262 | 262 | { |
263 | 263 | $idk = $this->getIDK(); |
264 | - return $idk ? $idk === 100 : null; |
|
264 | + return $idk ? $idk===100 : null; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /** |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | return true; |
277 | 277 | } |
278 | 278 | $fecha_autorizacion = $this->getFechaAutorizacion(); |
279 | - $fecha_vencimiento = date('Y-m-d', strtotime($fecha_autorizacion. ' + 180 days')); // 6 meses = 6 * 30 días |
|
280 | - return date('Y-m-d') < $fecha_vencimiento; |
|
279 | + $fecha_vencimiento = date('Y-m-d', strtotime($fecha_autorizacion.' + 180 days')); // 6 meses = 6 * 30 días |
|
280 | + return date('Y-m-d')<$fecha_vencimiento; |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |