public static function create(User $user)
 {
     $grade = $user->getGrade();
     $sex = $user->getSex();
     if ($grade === 'ゴールド') {
         return new NineDiscountAmountStrategy();
     }
     if ($grade === 'シルバー') {
         return new NineFiveDiscountAmountStrategy();
     }
     if ($grade === '一般' && $sex === '女性') {
         return new NineFiveDiscountAmountStrategy();
     }
     return new NormalAmountStrategy();
 }
 public function calc(User $user, Amount $amount)
 {
     $grade = $user->getGrade();
     $sex = $user->getSex();
     if ($grade === 'ゴールド') {
         return (new NineDiscountAmountStrategy())->calc($amount);
     }
     if ($grade === 'シルバー') {
         return (new NineFiveDiscountAmountStrategy())->calc($amount);
     }
     if ($grade === '一般' && $sex === '女性') {
         return (new NineFiveDiscountAmountStrategy())->calc($amount);
     }
     return (new NormalAmountStrategy())->calc($amount);
 }
 public function calc(User $user, Amount $amount)
 {
     $grade = $user->getGrade();
     $sex = $user->getSex();
     if ($grade === 'ゴールド') {
         return new Amount(floor($amount->getValue() * 0.9));
     }
     if ($grade === 'シルバー') {
         return new Amount(floor($amount->getValue() * 0.95));
     }
     if ($grade === '一般' && $sex === '女性') {
         return new Amount(floor($amount->getValue() * 0.95));
     }
     return new Amount($amount->getValue());
 }