%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/sljcon/vendor/phpunit/php-code-coverage/tests/_files/
Upload File :
Create Path :
Current File : /var/www/html/sljcon/vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php

<?php
class BankAccount
{
    protected $balance = 0;

    public function getBalance()
    {
        return $this->balance;
    }

    protected function setBalance($balance)
    {
        if ($balance >= 0) {
            $this->balance = $balance;
        } else {
            throw new RuntimeException;
        }
    }

    public function depositMoney($balance)
    {
        $this->setBalance($this->getBalance() + $balance);

        return $this->getBalance();
    }

    public function withdrawMoney($balance)
    {
        $this->setBalance($this->getBalance() - $balance);

        return $this->getBalance();
    }
}

Zerion Mini Shell 1.0