Skip to content

Commit

Permalink
Renombrado setSigningTime()
Browse files Browse the repository at this point in the history
- Renombrado método Facturae::setSigningTime()
- Actualizada documentación
  • Loading branch information
josemmo committed Oct 12, 2022
1 parent 7dd9dbf commit 4db8a5d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/firma-electronica/firma-electronica.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $fac->sign("certificado.pfx", null, "passphrase");
## Fecha de la firma
Por defecto, al firmar una factura se utilizan la fecha y hora actuales como sello de tiempo. Si se quiere indicar otro valor, se debe utilizar el siguiente método:
```php
$fac->setSignTime("2017-01-01T12:34:56+02:00");
$fac->setSigningTime("2017-01-01T12:34:56+02:00");
```
> #### NOTA
Expand Down
20 changes: 17 additions & 3 deletions src/FacturaeTraits/SignableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,25 @@ trait SignableTrait {
private $signatureObjectID;

/**
* Set sign time
* @param int|string $time Time of the signature
* Set signing time
* @param int|string $time Time of the signature
* @return self This instance
*/
public function setSignTime($time) {
public function setSigningTime($time) {
$this->signTime = is_string($time) ? strtotime($time) : $time;
return $this;
}


/**
* Set signing time
*
* Same as `Facturae::setSigningTime()` for backwards compatibility
* @param int|string $time Time of the signature
* @return self This instance
*/
public function setSignTime($time) {
return $this->setSigningTime($time);
}


Expand Down

0 comments on commit 4db8a5d

Please # to comment.