Factory.php
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;
  }
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;
  }
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 ; }
Helper function to get the desired Task class.

@param $task_type
The type of the task. This is the class name without the Drupal core
version suffix.

@return
A fully qualified class name for the type and, if it exists, version, e.g.
'DrupalCodeBuilder\Task\Collect7'.

@throws
Throws \DrupalCodeBuilder\Exception\InvalidInputException if the task type
does not correspond to a Task class.
Helper function to get the desired Task class .