public static function getTaskClass($task_type) {
    $type     = ucfirst($task_type);
    $version  = self::$environment->getCoreMajorVersion();

    $versioned_class = "DrupalCodeBuilder\\Task\\$task_type$version";
    $common_class    = "DrupalCodeBuilder\\Task\\$task_type";

    if (class_exists($versioned_class)) {
      $class    = $versioned_class;
    }
    elseif (class_exists($common_class)) {
      $class    = $common_class;
    }
    else {
      throw new InvalidInputException("Task class not found.");
    }

    return $class;
  }