Skip to content

Instantly share code, notes, and snippets.

@hungtrinh
Created November 3, 2019 15:30
Show Gist options
  • Save hungtrinh/24480e39574b19d5a76e6c14206cf639 to your computer and use it in GitHub Desktop.
Save hungtrinh/24480e39574b19d5a76e6c14206cf639 to your computer and use it in GitHub Desktop.
minimal production code pass business rule for 'platinum', 'gold' customer
<?php
function discountRateByMembershipType ($membershipType) {
if ('platinum' === $membershipType) return 0.15;
if ('gold' === $membershipType) return 0.1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment