17 lines
375 B
PHP
17 lines
375 B
PHP
<?php
|
|
|
|
namespace App\Domain\Model\Value;
|
|
|
|
class Price
|
|
{
|
|
public function __construct(
|
|
public readonly int $price,
|
|
public readonly Currency $currency,
|
|
public readonly ?bool $includesVat = null,
|
|
) {}
|
|
|
|
public function __toString(): string
|
|
{
|
|
return number_format($this->price, 0, ',', '.') . ' ' . $this->currency->symbol();
|
|
}
|
|
} |