public function fetchCurrentMenu ()
    {
        $request = new Request("GET", "https://api.weixin.qq.com/cgi-bin/menu/get");
        $response = $this->client->send($request);
        $json = json_decode((string)$response->getBody());

        if (! isset($json->menu->button)) {
            throw new Exception('Unexpected menu JSON structure: `menu.button` not found', $response);
        }

        $menu = new Menu();

        foreach ($json->menu->button as $item) {
            $menu = $menu->withItem($this->inflateItem($item));
        }

        return $menu;
    }
public function fetchCurrentMenu ()
    {
        $request = new Request("GET", "https://api.weixin.qq.com/cgi-bin/menu/get");
        $response = $this->client->send($request);
        $json = json_decode((string)$response->getBody());

        if (! isset($json->menu->button)) {
            throw new Exception('Unexpected menu JSON structure: `menu.button` not found', $response);
        }

        $menu = new Menu();

        foreach ($json->menu->button as $item) {
            $menu = $menu->withItem($this->inflateItem($item));
        }

        return $menu;
    }
public function fetchCurrentMenu ( ) { $ request = new Request ( "GET" , "https://api.weixin.qq.com/cgi-bin/menu/get" ) ; $ response = $ this -> client -> send ( $ request ) ; $ json = json_decode ( ( string ) $ response -> getBody ( ) ) ; if ( ! isset ( $ json -> menu -> button ) ) { throw new Exception ( 'Unexpected menu JSON structure: `menu.button` not found' , $ response ) ; } $ menu = new Menu ( ) ; foreach ( $ json -> menu -> button as $ item ) { $ menu = $ menu -> withItem ( $ this -> inflateItem ( $ item ) ) ; } return $ menu ; }
Retrieve the current menu for the OA, and return it as an instance of `Garbetjie\WeChatClient\Menu\Menu`.

@return Menu

@throws Exception
Retrieve the current menu for the OA and return it as an instance of Garbetjie \ WeChatClient \ Menu \ Menu .