original_string: public function createCommand($name, $type, $extension = null, $vendor = null)
      {
          // Prepare the component name
          $name = GeneralUtility::trimExplode('/', $name, true);
          if (!count($name)) {
              throw new CommandException('Empty / invalid component name', 1507996606);
          }
  
          // Prepare the component type
          $type = strtolower($type);
          if (!in_array($type, ComponentInterface::TYPES)) {
              throw new CommandException(sprintf('Invalid component type "%s"', $type), 1507996917);
          }
  
          // Prepare the provider extension name
          $extension = trim($extension ?: $GLOBALS['TYPO3_CONF_VARS']['EXT']['extParams']['tw_componentlibrary']['defaultextension']);
          if (!strlen($extension) || !ExtensionManagementUtility::isLoaded($extension)) {
              throw new CommandException(sprintf('Invalid provider extension "%s"', $extension), 1507997408);
          }
  
          // Prepare the provider extension vendor name
          $vendor = trim($vendor ?: $GLOBALS['TYPO3_CONF_VARS']['EXT']['extParams']['tw_componentlibrary']['defaultvendor']);
          if (!strlen($vendor)) {
              throw new CommandException(sprintf('Invalid provider extension vendor name "%s"', $vendor), 1507998569);
          }
  
          Kickstarter::create($name, $type, $extension, $vendor);
      }
code: public function createCommand($name, $type, $extension = null, $vendor = null)
      {
          // Prepare the component name
          $name = GeneralUtility::trimExplode('/', $name, true);
          if (!count($name)) {
              throw new CommandException('Empty / invalid component name', 1507996606);
          }
  
          // Prepare the component type
          $type = strtolower($type);
          if (!in_array($type, ComponentInterface::TYPES)) {
              throw new CommandException(sprintf('Invalid component type "%s"', $type), 1507996917);
          }
  
          // Prepare the provider extension name
          $extension = trim($extension ?: $GLOBALS['TYPO3_CONF_VARS']['EXT']['extParams']['tw_componentlibrary']['defaultextension']);
          if (!strlen($extension) || !ExtensionManagementUtility::isLoaded($extension)) {
              throw new CommandException(sprintf('Invalid provider extension "%s"', $extension), 1507997408);
          }
  
          // Prepare the provider extension vendor name
          $vendor = trim($vendor ?: $GLOBALS['TYPO3_CONF_VARS']['EXT']['extParams']['tw_componentlibrary']['defaultvendor']);
          if (!strlen($vendor)) {
              throw new CommandException(sprintf('Invalid provider extension vendor name "%s"', $vendor), 1507998569);
          }
  
          Kickstarter::create($name, $type, $extension, $vendor);
      }
code_tokens: public function createCommand ( $ name , $ type , $ extension = null , $ vendor = null ) { // Prepare the component name $ name = GeneralUtility :: trimExplode ( '/' , $ name , true ) ; if ( ! count ( $ name ) ) { throw new CommandException ( 'Empty / invalid component name' , 1507996606 ) ; } // Prepare the component type $ type = strtolower ( $ type ) ; if ( ! in_array ( $ type , ComponentInterface :: TYPES ) ) { throw new CommandException ( sprintf ( 'Invalid component type "%s"' , $ type ) , 1507996917 ) ; } // Prepare the provider extension name $ extension = trim ( $ extension ? : $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXT' ] [ 'extParams' ] [ 'tw_componentlibrary' ] [ 'defaultextension' ] ) ; if ( ! strlen ( $ extension ) || ! ExtensionManagementUtility :: isLoaded ( $ extension ) ) { throw new CommandException ( sprintf ( 'Invalid provider extension "%s"' , $ extension ) , 1507997408 ) ; } // Prepare the provider extension vendor name $ vendor = trim ( $ vendor ? : $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXT' ] [ 'extParams' ] [ 'tw_componentlibrary' ] [ 'defaultvendor' ] ) ; if ( ! strlen ( $ vendor ) ) { throw new CommandException ( sprintf ( 'Invalid provider extension vendor name "%s"' , $ vendor ) , 1507998569 ) ; } Kickstarter :: create ( $ name , $ type , $ extension , $ vendor ) ; }
docstring: Create a new component
  
  @param string $name      Component path and name
  @param string $type      Component type
  @param string $extension Host extension
  @param string $vendor    Host extension vendor name
  
  @throws CommandException If the component name is empty / invalid
  @throws CommandException If the component type is invalid
  @throws CommandException If the provider extension is invalid
  @throws CommandException If the provider extension vendor name is invalid
docstring_tokens: Create a new component