Skip to content

Instantly share code, notes, and snippets.

@genkovich

genkovich/deposit.php Secret

Created Apr 20, 2021
Embed
What would you like to do?
<?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