| Total Complexity | 6 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class IncomeServiceItem implements \JsonSerializable |
||
| 12 | { |
||
| 13 | private string $name; |
||
| 14 | |||
| 15 | /** @var float|int|string */ |
||
| 16 | private $amount; |
||
| 17 | |||
| 18 | /** @var float|int */ |
||
| 19 | private $quantity; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param float|int|string $amount |
||
| 23 | * @param float|int $quantity |
||
| 24 | */ |
||
| 25 | public function __construct(string $name, $amount, $quantity) |
||
| 26 | { |
||
| 27 | $this->name = $name; |
||
| 28 | $this->amount = $amount; |
||
| 29 | $this->quantity = $quantity; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function jsonSerialize(): array |
||
| 33 | { |
||
| 34 | return [ |
||
| 35 | 'name' => $this->name, |
||
| 36 | 'amount' => $this->amount, |
||
| 37 | 'quantity' => $this->quantity, |
||
| 38 | ]; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getName(): string |
||
| 42 | { |
||
| 43 | return $this->name; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return float|int|string |
||
| 48 | */ |
||
| 49 | public function getAmount() |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return float|int |
||
| 56 | */ |
||
| 57 | public function getQuantity() |
||
| 60 | } |
||
| 61 | |||
| 62 | public function getTotalAmount(): BigDecimal |
||
| 66 | ; |
||
| 67 | } |
||
| 69 |