/**
  * Increment the user's Mission Control subscription by the given number of seconds if they are a
  * Mission Control subscriber.
  *
  * This method has safeguards to prevent users with higher roles (charter subscribers, admins) from
  * being awarded extra time on a nonexistent subscription.
  *
  * @param User $user    The user to award
  * @param Award $award The award for which we can calculate the subscription length
  */
 public function incrementSubscription(User $user, Award $award)
 {
     if ($user->role_id == UserRole::Subscriber) {
         // Calculate the seconds to extend by
         $seconds = (new DeltaVCalculator())->toSeconds($award->value);
         // Fetch the current subscription/trial end
         $endDate = is_null($user->getTrialEndDate()) ? $user->getSubscriptionEndDate() : $user->getTrialEndDate();
         // Calculate the new end date
         $newEndDate = $endDate->addSeconds($seconds);
         // Extend trial to that date
         $user->subscription($this->currentPlan)->noProrate()->trialFor($newEndDate)->swap();
         // Update the database
         $user->trial_ends_at = $user->subsription()->getTrialEndDate();
         $user->save();
     }
 }