Task/Generate/ComponentClassHandler.php
public function getGeneratorClass($type) {
    $type = ucfirst($type);

    if (!isset($this->classes[$type])) {
      $version  = \DrupalCodeBuilder\Factory::getEnvironment()->getCoreMajorVersion();
      $class    = 'DrupalCodeBuilder\\Generator\\' . $type . $version;

      // If there is no version-specific class, use the base class.
      if (!class_exists($class)) {
        $class  = 'DrupalCodeBuilder\\Generator\\' . $type;
      }

      $this->classes[$type] = $class;
    }

    return $this->classes[$type];
  }
public function getGeneratorClass($type) {
    $type = ucfirst($type);

    if (!isset($this->classes[$type])) {
      $version  = \DrupalCodeBuilder\Factory::getEnvironment()->getCoreMajorVersion();
      $class    = 'DrupalCodeBuilder\\Generator\\' . $type . $version;

      // If there is no version-specific class, use the base class.
      if (!class_exists($class)) {
        $class  = 'DrupalCodeBuilder\\Generator\\' . $type;
      }

      $this->classes[$type] = $class;
    }

    return $this->classes[$type];
  }
public function getGeneratorClass ( $ type ) { $ type = ucfirst ( $ type ) ; if ( ! isset ( $ this -> classes [ $ type ] ) ) { $ version = \ DrupalCodeBuilder \ Factory :: getEnvironment ( ) -> getCoreMajorVersion ( ) ; $ class = 'DrupalCodeBuilder\\Generator\\' . $ type . $ version ; // If there is no version-specific class, use the base class. if ( ! class_exists ( $ class ) ) { $ class = 'DrupalCodeBuilder\\Generator\\' . $ type ; } $ this -> classes [ $ type ] = $ class ; } return $ this -> classes [ $ type ] ; }
Helper function to get the desired Generator class.

@param $type
The type of the component. This is the name of the class, without the
version suffix. For classes in camel case, the string given here may be
all in lower case.

@return
A fully qualified class name for the type and, if it exists, version, e.g.
'DrupalCodeBuilder\Generator\Info6'.
Helper function to get the desired Generator class .