4
protected $balance = 0;
6
public function getBalance()
11
protected function setBalance($balance)
14
$this->balance = $balance;
16
throw new RuntimeException;
20
public function depositMoney($balance)
22
$this->setBalance($this->getBalance() + $balance);
24
return $this->getBalance();
27
public function withdrawMoney($balance)
29
$this->setBalance($this->getBalance() - $balance);
31
return $this->getBalance();