original_string: public function getComponent()
      {
          // Simple cache.
          if (!empty($this->component)) {
              return $this->component;
          }
  
          $filter = new StatementFilter();
          $parser = new CodeParser();
  
          $notFound   = 'The plugin must define the $plugin->component in the version.php file.';
          $statements = $parser->parseFile($this->directory.'/version.php');
  
          try {
              $assign = $filter->findFirstPropertyFetchAssignment($statements, 'plugin', 'component', $notFound);
          } catch (\Exception $e) {
              $assign = $filter->findFirstPropertyFetchAssignment($statements, 'module', 'component', $notFound);
          }
  
          if (!$assign->expr instanceof String_) {
              throw new \RuntimeException('The $plugin->component must be assigned to a string in the version.php file.');
          }
          $this->component = $assign->expr->value;
  
          return $this->component;
      }
code: public function getComponent()
      {
          // Simple cache.
          if (!empty($this->component)) {
              return $this->component;
          }
  
          $filter = new StatementFilter();
          $parser = new CodeParser();
  
          $notFound   = 'The plugin must define the $plugin->component in the version.php file.';
          $statements = $parser->parseFile($this->directory.'/version.php');
  
          try {
              $assign = $filter->findFirstPropertyFetchAssignment($statements, 'plugin', 'component', $notFound);
          } catch (\Exception $e) {
              $assign = $filter->findFirstPropertyFetchAssignment($statements, 'module', 'component', $notFound);
          }
  
          if (!$assign->expr instanceof String_) {
              throw new \RuntimeException('The $plugin->component must be assigned to a string in the version.php file.');
          }
          $this->component = $assign->expr->value;
  
          return $this->component;
      }
code_tokens: public function getComponent ( ) { // Simple cache. if ( ! empty ( $ this -> component ) ) { return $ this -> component ; } $ filter = new StatementFilter ( ) ; $ parser = new CodeParser ( ) ; $ notFound = 'The plugin must define the $plugin->component in the version.php file.' ; $ statements = $ parser -> parseFile ( $ this -> directory . '/version.php' ) ; try { $ assign = $ filter -> findFirstPropertyFetchAssignment ( $ statements , 'plugin' , 'component' , $ notFound ) ; } catch ( \ Exception $ e ) { $ assign = $ filter -> findFirstPropertyFetchAssignment ( $ statements , 'module' , 'component' , $ notFound ) ; } if ( ! $ assign -> expr instanceof String_ ) { throw new \ RuntimeException ( 'The $plugin->component must be assigned to a string in the version.php file.' ) ; } $ this -> component = $ assign -> expr -> value ; return $ this -> component ; }
docstring: Get a plugin's component name.
  
  @throws \RuntimeException
  
  @return string
docstring_tokens: Get a plugin s component name .