Skip to content

Fix return type #677

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

Merged
merged 1 commit into from
Feb 18, 2018
Merged

Fix return type #677

merged 1 commit into from
Feb 18, 2018

Conversation

patrik-csak
Copy link
Contributor

\Github\Api\Repository\Contents::archive() claims to return an array, but in my testing it returns a string.

echo gettype(
    (new \Github\Client())->api('repo')
        ->contents()
        ->archive('twbs', 'bootstrap', 'tarball', 'tags/v4.0.0')
); // `string`

I spun up a small test project to test it. Here's the gist.

@acrobat
Copy link
Collaborator

acrobat commented Feb 18, 2018

In the api docs they state they do (return) a redirect

This method will return a 302 to a URL to download a tarball or zipball archive for a repository. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location header to make a second GET request.

What's the actual result in your example? The url of the archive or the content of the archive?

@patrik-csak
Copy link
Contributor Author

The result is the contents of the archive.

@acrobat
Copy link
Collaborator

acrobat commented Feb 18, 2018

@ptrkcsk ok, thanks for the feedback and the fix!

@acrobat acrobat merged commit 8465bbb into KnpLabs:master Feb 18, 2018
@patrik-csak
Copy link
Contributor Author

Happy to help!

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

Successfully merging this pull request may close these issues.

2 participants