Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returntype invalid #68

Open
padhie opened this issue Jan 29, 2019 · 0 comments
Open

Returntype invalid #68

padhie opened this issue Jan 29, 2019 · 0 comments

Comments

@padhie
Copy link

padhie commented Jan 29, 2019

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
     */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant