Implemented Euros and test

This commit is contained in:
Kevin Frantz
2018-07-14 11:41:40 +02:00
parent 9785ebf5a2
commit 523d8f68ec
2 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?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 '€';
}
}