This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Deposit | |
{ | |
protected float $account = 0; | |
public function __construct(float $sum) | |
{ | |
if ($sum < 0) { | |
throw new Exception('Сумма вклада не может быть меньше нуля'); | |
} | |
$this->account += $sum; | |
} | |
} | |
class VipDeposit extends Deposit | |
{ | |
public function getMoney(float $sum) | |
{ | |
$this->account -= $sum; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment