mirror of
https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
synced 2025-04-22 21:22:25 +02:00
43 lines
600 B
PHP
43 lines
600 B
PHP
<?php
|
|
namespace entity\currency;
|
|
|
|
/**
|
|
*
|
|
* @author kevinfrantz
|
|
*
|
|
*/
|
|
final class Euro implements CurrencyInterface
|
|
{
|
|
/**
|
|
*
|
|
* @var int
|
|
*/
|
|
private $cents;
|
|
|
|
public function getName(): string
|
|
{
|
|
return 'Euro';
|
|
}
|
|
|
|
public function getCents(): int
|
|
{
|
|
return $this->cents;
|
|
}
|
|
|
|
public function setCents(int $cents): void
|
|
{
|
|
$this->cents = $cents;
|
|
}
|
|
|
|
public function getFloat(): float
|
|
{
|
|
return ($this->cents/100);
|
|
}
|
|
|
|
public function getSymbol(): string
|
|
{
|
|
return '€';
|
|
}
|
|
}
|
|
|