original_string: public function createItem($itemRouteName, array $itemOptions)
      {
          if (isset($itemOptions['item_class']))
          {
              $class = $itemOptions['item_class'];
          }
          else
          {
              $class = $this->getDefaultItemClass();
          }
  
          if (isset($this->itemClassAliases[$class]))
          {
              $class = $this->itemClassAliases[$class];
          }
  
          if (!$this->isValidMenuItemClass($class))
          {
              throw new NoMenuItemClassException(sprintf('Item class %s does not extend \C33s\MenuBundle\Item\MenuItem', $itemOptions['item_class']));
          }
  
          $item = new $class($itemRouteName, $itemOptions, $this);
  
          return $item;
      }
code: public function createItem($itemRouteName, array $itemOptions)
      {
          if (isset($itemOptions['item_class']))
          {
              $class = $itemOptions['item_class'];
          }
          else
          {
              $class = $this->getDefaultItemClass();
          }
  
          if (isset($this->itemClassAliases[$class]))
          {
              $class = $this->itemClassAliases[$class];
          }
  
          if (!$this->isValidMenuItemClass($class))
          {
              throw new NoMenuItemClassException(sprintf('Item class %s does not extend \C33s\MenuBundle\Item\MenuItem', $itemOptions['item_class']));
          }
  
          $item = new $class($itemRouteName, $itemOptions, $this);
  
          return $item;
      }
code_tokens: public function createItem ( $ itemRouteName , array $ itemOptions ) { if ( isset ( $ itemOptions [ 'item_class' ] ) ) { $ class = $ itemOptions [ 'item_class' ] ; } else { $ class = $ this -> getDefaultItemClass ( ) ; } if ( isset ( $ this -> itemClassAliases [ $ class ] ) ) { $ class = $ this -> itemClassAliases [ $ class ] ; } if ( ! $ this -> isValidMenuItemClass ( $ class ) ) { throw new NoMenuItemClassException ( sprintf ( 'Item class %s does not extend \C33s\MenuBundle\Item\MenuItem' , $ itemOptions [ 'item_class' ] ) ) ; } $ item = new $ class ( $ itemRouteName , $ itemOptions , $ this ) ; return $ item ; }
docstring: MenuItem factory method.
  
  @param string $itemRouteName
  @param array $itemOptions
  @throws NoMenuItemClassException
  
  @return MenuItem
docstring_tokens: MenuItem factory method .