added invoice model to invoice created event (#3079)

* added model to InvoiceCreatedEvent
* allow to switch formatter locale
This commit is contained in:
Kevin Papst
2022-01-20 18:41:55 +01:00
committed by GitHub
parent fd4cbb43c1
commit 49bb9980b8
8 changed files with 109 additions and 123 deletions

View File

@@ -16,49 +16,21 @@ use DateTime;
*/
interface InvoiceFormatter
{
/**
* @param DateTime $date
* @return mixed
*/
public function getFormattedDateTime(DateTime $date);
public function getLocale(): string;
/**
* @param DateTime $date
* @return mixed
*/
public function getFormattedTime(DateTime $date);
public function setLocale(string $locale): void;
/**
* @param int|float $amount
* @param string|null $currency
* @param bool $withCurrency
* @return string
*/
public function getFormattedMoney($amount, ?string $currency, bool $withCurrency = true);
public function getFormattedDateTime(DateTime $date): string;
/**
* @param DateTime $date
* @return mixed
*/
public function getFormattedMonthName(DateTime $date);
public function getFormattedTime(DateTime $date): string;
/**
* @param int $seconds
* @return mixed
*/
public function getFormattedDuration($seconds);
public function getFormattedMoney(float $amount, ?string $currency, bool $withCurrency = true): string;
/**
* @param int $seconds
* @return mixed
*/
public function getFormattedDecimalDuration($seconds);
public function getFormattedMonthName(DateTime $date): string;
public function getFormattedDuration(int $seconds): string;
public function getFormattedDecimalDuration(int $seconds): string;
/**
* Returns the currency symbol for the given currency by name.
*
* @param string $currency
* @return string
*/
public function getCurrencySymbol(string $currency): string;
}