Skip to content

Instantly share code, notes, and snippets.

@genkovich
Last active April 14, 2021 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save genkovich/9a37e090a40d80a41aec67a36493321c to your computer and use it in GitHub Desktop.
Save genkovich/9a37e090a40d80a41aec67a36493321c to your computer and use it in GitHub Desktop.
<?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