protected function reduceMenu (Menu $menu)
    {
        $reduced = ['button' => []];

        foreach ($menu->getItems() as $menuItem) {
            $reduced['button'][] = $this->reduceItem($menuItem);
        }

        return $reduced;
    }
protected function reduceMenu (Menu $menu)
    {
        $reduced = ['button' => []];

        foreach ($menu->getItems() as $menuItem) {
            $reduced['button'][] = $this->reduceItem($menuItem);
        }

        return $reduced;
    }
protected function reduceMenu ( Menu $ menu ) { $ reduced = [ 'button' => [ ] ] ; foreach ( $ menu -> getItems ( ) as $ menuItem ) { $ reduced [ 'button' ] [ ] = $ this -> reduceItem ( $ menuItem ) ; } return $ reduced ; }
Reduces the supplied menu into its array equivalent, ready for sending to the WeChat API.

@param Menu $menu

@return array
Reduces the supplied menu into its array equivalent ready for sending to the WeChat API .