original_string: protected function determineExtensionName()
      {
          $reflectionClass   = new \ReflectionClass($this);
          $componentFilePath = dirname($reflectionClass->getFileName());
  
          // If the file path is invalid
          $extensionDirPosition = strpos($componentFilePath, 'ext'.DIRECTORY_SEPARATOR);
          if ($extensionDirPosition === false) {
              throw new \RuntimeException('Invalid component path', 1481360976);
          }
  
          // Extract the extension key
          $componentPath = explode(
              DIRECTORY_SEPARATOR,
              substr($componentFilePath, $extensionDirPosition + strlen('ext'.DIRECTORY_SEPARATOR))
          );
          $extensionKey  = array_shift($componentPath);
  
          // If the extension is unknown
          if (!in_array($extensionKey, ExtensionManagementUtility::getLoadedExtensionListArray())) {
              throw new \RuntimeException(sprintf('Unknown extension key "%s"', $extensionKey), 1481361198);
          }
  
          // Register the extension key & name
          $this->extensionKey  = $extensionKey;
          $this->extensionName = GeneralUtility::underscoredToUpperCamelCase($extensionKey);
  
          // Process the component path
          if (array_shift($componentPath) !== 'Components') {
              throw new \RuntimeException('Invalid component path', 1481360976);
          }
          $this->componentPath = array_map([static::class, 'expandComponentName'], $componentPath);
      }
code: protected function determineExtensionName()
      {
          $reflectionClass   = new \ReflectionClass($this);
          $componentFilePath = dirname($reflectionClass->getFileName());
  
          // If the file path is invalid
          $extensionDirPosition = strpos($componentFilePath, 'ext'.DIRECTORY_SEPARATOR);
          if ($extensionDirPosition === false) {
              throw new \RuntimeException('Invalid component path', 1481360976);
          }
  
          // Extract the extension key
          $componentPath = explode(
              DIRECTORY_SEPARATOR,
              substr($componentFilePath, $extensionDirPosition + strlen('ext'.DIRECTORY_SEPARATOR))
          );
          $extensionKey  = array_shift($componentPath);
  
          // If the extension is unknown
          if (!in_array($extensionKey, ExtensionManagementUtility::getLoadedExtensionListArray())) {
              throw new \RuntimeException(sprintf('Unknown extension key "%s"', $extensionKey), 1481361198);
          }
  
          // Register the extension key & name
          $this->extensionKey  = $extensionKey;
          $this->extensionName = GeneralUtility::underscoredToUpperCamelCase($extensionKey);
  
          // Process the component path
          if (array_shift($componentPath) !== 'Components') {
              throw new \RuntimeException('Invalid component path', 1481360976);
          }
          $this->componentPath = array_map([static::class, 'expandComponentName'], $componentPath);
      }
code_tokens: protected function determineExtensionName ( ) { $ reflectionClass = new \ ReflectionClass ( $ this ) ; $ componentFilePath = dirname ( $ reflectionClass -> getFileName ( ) ) ; // If the file path is invalid $ extensionDirPosition = strpos ( $ componentFilePath , 'ext' . DIRECTORY_SEPARATOR ) ; if ( $ extensionDirPosition === false ) { throw new \ RuntimeException ( 'Invalid component path' , 1481360976 ) ; } // Extract the extension key $ componentPath = explode ( DIRECTORY_SEPARATOR , substr ( $ componentFilePath , $ extensionDirPosition + strlen ( 'ext' . DIRECTORY_SEPARATOR ) ) ) ; $ extensionKey = array_shift ( $ componentPath ) ; // If the extension is unknown if ( ! in_array ( $ extensionKey , ExtensionManagementUtility :: getLoadedExtensionListArray ( ) ) ) { throw new \ RuntimeException ( sprintf ( 'Unknown extension key "%s"' , $ extensionKey ) , 1481361198 ) ; } // Register the extension key & name $ this -> extensionKey = $ extensionKey ; $ this -> extensionName = GeneralUtility :: underscoredToUpperCamelCase ( $ extensionKey ) ; // Process the component path if ( array_shift ( $ componentPath ) !== 'Components' ) { throw new \ RuntimeException ( 'Invalid component path' , 1481360976 ) ; } $ this -> componentPath = array_map ( [ static :: class , 'expandComponentName' ] , $ componentPath ) ; }
docstring: Find the extension name the current component belongs to
  
  @throws \RuntimeException If the component path is invalid
  @throws \ReflectionException
docstring_tokens: Find the extension name the current component belongs to