original_string: protected function _prepareItemAttrs($item, array $info, array $options)
      {
          $options = Hash::merge($options, [
              'childAttrs' => ['class' => []],
              'linkAttrs' => ['class' => []],
          ]);
          $childAttrs = $options['childAttrs'];
          $linkAttrs = $options['linkAttrs'];
  
          if (is_string($childAttrs['class'])) {
              $childAttrs['class'] = [$childAttrs['class']];
          }
  
          if (is_string($linkAttrs['class'])) {
              $linkAttrs['class'] = [$linkAttrs['class']];
          }
  
          if ($info['index'] === 1) {
              $childAttrs['class'][] = $this->config('firstClass');
          }
  
          if ($info['index'] === $info['total']) {
              $childAttrs['class'][] = $this->config('lastClass');
          }
  
          if ($info['hasChildren']) {
              $childAttrs['class'][] = $this->config('hasChildrenClass');
              if ($this->config('dropdown')) {
                  $childAttrs['class'][] = 'dropdown';
                  $linkAttrs['data-toggle'] = 'dropdown';
              }
          }
  
          if (!empty($item->description)) {
              $linkAttrs['title'] = $item->description;
          }
  
          if (!empty($item->target)) {
              $linkAttrs['target'] = $item->target;
          }
  
          if ($info['active']) {
              $childAttrs['class'][] = $this->config('activeClass');
              $linkAttrs['class'][] = $this->config('activeClass');
          }
  
          $id = $this->_calculateItemId($item);
          if (!empty($id)) {
              $childAttrs['class'][] = "menu-link-{$id}";
          }
  
          $childAttrs['class'] = array_unique($childAttrs['class']);
          $linkAttrs['class'] = array_unique($linkAttrs['class']);
  
          return [
              'link' => $linkAttrs,
              'child' => $childAttrs,
          ];
      }
code: protected function _prepareItemAttrs($item, array $info, array $options)
      {
          $options = Hash::merge($options, [
              'childAttrs' => ['class' => []],
              'linkAttrs' => ['class' => []],
          ]);
          $childAttrs = $options['childAttrs'];
          $linkAttrs = $options['linkAttrs'];
  
          if (is_string($childAttrs['class'])) {
              $childAttrs['class'] = [$childAttrs['class']];
          }
  
          if (is_string($linkAttrs['class'])) {
              $linkAttrs['class'] = [$linkAttrs['class']];
          }
  
          if ($info['index'] === 1) {
              $childAttrs['class'][] = $this->config('firstClass');
          }
  
          if ($info['index'] === $info['total']) {
              $childAttrs['class'][] = $this->config('lastClass');
          }
  
          if ($info['hasChildren']) {
              $childAttrs['class'][] = $this->config('hasChildrenClass');
              if ($this->config('dropdown')) {
                  $childAttrs['class'][] = 'dropdown';
                  $linkAttrs['data-toggle'] = 'dropdown';
              }
          }
  
          if (!empty($item->description)) {
              $linkAttrs['title'] = $item->description;
          }
  
          if (!empty($item->target)) {
              $linkAttrs['target'] = $item->target;
          }
  
          if ($info['active']) {
              $childAttrs['class'][] = $this->config('activeClass');
              $linkAttrs['class'][] = $this->config('activeClass');
          }
  
          $id = $this->_calculateItemId($item);
          if (!empty($id)) {
              $childAttrs['class'][] = "menu-link-{$id}";
          }
  
          $childAttrs['class'] = array_unique($childAttrs['class']);
          $linkAttrs['class'] = array_unique($linkAttrs['class']);
  
          return [
              'link' => $linkAttrs,
              'child' => $childAttrs,
          ];
      }
code_tokens: protected function _prepareItemAttrs ( $ item , array $ info , array $ options ) { $ options = Hash :: merge ( $ options , [ 'childAttrs' => [ 'class' => [ ] ] , 'linkAttrs' => [ 'class' => [ ] ] , ] ) ; $ childAttrs = $ options [ 'childAttrs' ] ; $ linkAttrs = $ options [ 'linkAttrs' ] ; if ( is_string ( $ childAttrs [ 'class' ] ) ) { $ childAttrs [ 'class' ] = [ $ childAttrs [ 'class' ] ] ; } if ( is_string ( $ linkAttrs [ 'class' ] ) ) { $ linkAttrs [ 'class' ] = [ $ linkAttrs [ 'class' ] ] ; } if ( $ info [ 'index' ] === 1 ) { $ childAttrs [ 'class' ] [ ] = $ this -> config ( 'firstClass' ) ; } if ( $ info [ 'index' ] === $ info [ 'total' ] ) { $ childAttrs [ 'class' ] [ ] = $ this -> config ( 'lastClass' ) ; } if ( $ info [ 'hasChildren' ] ) { $ childAttrs [ 'class' ] [ ] = $ this -> config ( 'hasChildrenClass' ) ; if ( $ this -> config ( 'dropdown' ) ) { $ childAttrs [ 'class' ] [ ] = 'dropdown' ; $ linkAttrs [ 'data-toggle' ] = 'dropdown' ; } } if ( ! empty ( $ item -> description ) ) { $ linkAttrs [ 'title' ] = $ item -> description ; } if ( ! empty ( $ item -> target ) ) { $ linkAttrs [ 'target' ] = $ item -> target ; } if ( $ info [ 'active' ] ) { $ childAttrs [ 'class' ] [ ] = $ this -> config ( 'activeClass' ) ; $ linkAttrs [ 'class' ] [ ] = $ this -> config ( 'activeClass' ) ; } $ id = $ this -> _calculateItemId ( $ item ) ; if ( ! empty ( $ id ) ) { $ childAttrs [ 'class' ] [ ] = "menu-link-{$id}" ; } $ childAttrs [ 'class' ] = array_unique ( $ childAttrs [ 'class' ] ) ; $ linkAttrs [ 'class' ] = array_unique ( $ linkAttrs [ 'class' ] ) ; return [ 'link' => $ linkAttrs , 'child' => $ childAttrs , ] ; }
docstring: Prepares item's attributes for rendering.
  
  @param \Cake\Datasource\EntityInterface $item The item being rendered
  @param array $info Item's rendering info
  @param array $options Item's rendering options
  @return array Associative array with two keys, `link` and `child`
  @see \Menu\View\Helper\MenuHelper::formatter()
docstring_tokens: Prepares item s attributes for rendering .