Skip to content

Instantly share code, notes, and snippets.

@genkovich
Last active Apr 14, 2021
Embed
What would you like to do?
<?php
class Money {}
class Dollars extends Money {}
class Customer
{
protected Money $account;
public function putMoneyIntoAccount(Dollars $sum): void
{
$this->account = $sum;
}
}
class VIPCustomer extends Customer
{
public function putMoneyIntoAccount(Money $sum): void
{
$this->account = $sum;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment