| Total Complexity | 4 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class InMemoryWallet implements Wallet |
||
| 10 | { |
||
| 11 | private $balance; |
||
| 12 | |||
| 13 | public function __construct(int $balance) |
||
| 14 | { |
||
| 15 | $this->balance = Credit::fromInteger($balance); |
||
| 16 | } |
||
| 17 | |||
| 18 | public function balance(): Credit |
||
| 19 | { |
||
| 20 | return $this->balance; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function deposit(Credit $credit): void |
||
| 24 | { |
||
| 25 | $this->balance = $this->balance->add($credit); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function withdraw(Credit $credit): void |
||
| 31 | } |
||
| 32 | } |
||
| 33 |