original_string: public function addMainMenuItem($owner, $code, array $definition)
      {
          $itemKey = $this->makeItemKey($owner, $code);
  
          if (isset($this->items[$itemKey])) {
              $definition = array_merge((array) $this->items[$itemKey], $definition);
          }
  
          $item = (object) array_merge(self::$mainItemDefaults, array_merge($definition, [
              'code'  => $code,
              'owner' => $owner
          ]));
  
          $this->items[$itemKey] = $item;
  
          if ($item->sideMenu) {
              $this->addSideMenuItems($owner, $code, $item->sideMenu);
          }
      }
code: public function addMainMenuItem($owner, $code, array $definition)
      {
          $itemKey = $this->makeItemKey($owner, $code);
  
          if (isset($this->items[$itemKey])) {
              $definition = array_merge((array) $this->items[$itemKey], $definition);
          }
  
          $item = (object) array_merge(self::$mainItemDefaults, array_merge($definition, [
              'code'  => $code,
              'owner' => $owner
          ]));
  
          $this->items[$itemKey] = $item;
  
          if ($item->sideMenu) {
              $this->addSideMenuItems($owner, $code, $item->sideMenu);
          }
      }
code_tokens: public function addMainMenuItem ( $ owner , $ code , array $ definition ) { $ itemKey = $ this -> makeItemKey ( $ owner , $ code ) ; if ( isset ( $ this -> items [ $ itemKey ] ) ) { $ definition = array_merge ( ( array ) $ this -> items [ $ itemKey ] , $ definition ) ; } $ item = ( object ) array_merge ( self :: $ mainItemDefaults , array_merge ( $ definition , [ 'code' => $ code , 'owner' => $ owner ] ) ) ; $ this -> items [ $ itemKey ] = $ item ; if ( $ item -> sideMenu ) { $ this -> addSideMenuItems ( $ owner , $ code , $ item -> sideMenu ) ; } }
docstring: Dynamically add a single main menu item
  @param string $owner
  @param string $code
  @param array  $definitions
docstring_tokens: Dynamically add a single main menu item