original_string: public function hasComponent($componentName)
      {
          $componentManager = ComponentManager::instance();
          $componentName = $componentManager->resolve($componentName);
  
          foreach ($this->settings['components'] as $sectionName => $values) {
  
              $result = $sectionName;
  
              if ($sectionName == $componentName) {
                  return $result;
              }
  
              $parts = explode(' ', $sectionName);
              if (count($parts) > 1) {
                  $sectionName = trim($parts[0]);
  
                  if ($sectionName == $componentName) {
                      return $result;
                  }
              }
  
              $sectionName = $componentManager->resolve($sectionName);
              if ($sectionName == $componentName) {
                  return $result;
              }
  
          }
  
          return false;
      }
code: public function hasComponent($componentName)
      {
          $componentManager = ComponentManager::instance();
          $componentName = $componentManager->resolve($componentName);
  
          foreach ($this->settings['components'] as $sectionName => $values) {
  
              $result = $sectionName;
  
              if ($sectionName == $componentName) {
                  return $result;
              }
  
              $parts = explode(' ', $sectionName);
              if (count($parts) > 1) {
                  $sectionName = trim($parts[0]);
  
                  if ($sectionName == $componentName) {
                      return $result;
                  }
              }
  
              $sectionName = $componentManager->resolve($sectionName);
              if ($sectionName == $componentName) {
                  return $result;
              }
  
          }
  
          return false;
      }
code_tokens: public function hasComponent ( $ componentName ) { $ componentManager = ComponentManager :: instance ( ) ; $ componentName = $ componentManager -> resolve ( $ componentName ) ; foreach ( $ this -> settings [ 'components' ] as $ sectionName => $ values ) { $ result = $ sectionName ; if ( $ sectionName == $ componentName ) { return $ result ; } $ parts = explode ( ' ' , $ sectionName ) ; if ( count ( $ parts ) > 1 ) { $ sectionName = trim ( $ parts [ 0 ] ) ; if ( $ sectionName == $ componentName ) { return $ result ; } } $ sectionName = $ componentManager -> resolve ( $ sectionName ) ; if ( $ sectionName == $ componentName ) { return $ result ; } } return false ; }
docstring: Checks if the object has a component with the specified name.
  @param string $componentName Specifies the component name.
  @return mixed Return false or the full component name used on the page (it could include the alias).
docstring_tokens: Checks if the object has a component with the specified name .