Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Created March 13, 2025 19:50
Show Gist options
  • Save trikitrok/24a1646952eadfd9802628c74ef3ffea to your computer and use it in GitHub Desktop.
Save trikitrok/24a1646952eadfd9802628c74ef3ffea to your computer and use it in GitHub Desktop.
<?php
interface Customer {
public function getEarnedDiscount(): float;
public function addToOrdersHistory(Order $order): void;
}
// Null Customer's implementation
class NotFoundCustomer implements Customer {
private float $DEFAULT_DISCOUNT = 1.0;
public function getEarnedDiscount(): float {
return $this->DEFAULT_DISCOUNT;
}
// Refused bequest???
public function addToOrdersHistory(Order $order): void {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment