php-youtube-api icon indicating copy to clipboard operation
php-youtube-api copied to clipboard

Returntype invalid

Open padhie opened this issue 6 years ago • 0 comments
trafficstars

Namespace: \Madcoda\Youtube\Youtube Method: getVideosInfo()

The Docblock of Method getVideosInfo say, the return value is always \StdClass. First the type call \stdClass (lowercase s) and secondary in the method will be the method \Madcoda\Youtube\Youtube::decodeList called. There it can be return \stdClass OR array.

Docblock getVideoInfo()

    /**
     * @param $vIds
     * @return \StdClass
     * @throws \Exception
     */

Docblock decodeList()

    /**
     * Decode the response from youtube, extract the list of resource objects
     *
     * @param  string $apiData response string from youtube
     * @throws \Exception
     * @return array Array of StdClass objects
     */

The correct Docblock sould be looks like this: Docblock getVideoInfo()

    /**
     * @param array|string $vIds
     * @return \stdClass|array
     * @throws \Exception
     */

Docblock decodeList()

    /**
     * Decode the response from youtube, extract the list of resource objects
     *
     * @param  string $apiData response string from youtube
     * @throws \Exception
     * @return \stdClass|array Array of StdClass objects
     */

padhie avatar Jan 29 '19 17:01 padhie