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

What's the purpose of isArray? #85

Open
ryandesign opened this issue Feb 7, 2016 · 3 comments
Open

What's the purpose of isArray? #85

ryandesign opened this issue Feb 7, 2016 · 3 comments

Comments

@ryandesign
Copy link
Contributor

What's the purpose of isArray? It doesn't seem to be used anywhere. Can it be removed?

@tan-tan-kanarek
Copy link
Owner

It's used, here are few examples:

return $this->client->request("/repos/$owner/$repo/labels", 'GET', $data, 200, 'GitHubLabel', true);

return $this->client->request("/repos/$owner/$repo/pulls", 'GET', $data, 200, 'GitHubPull', true);

return $this->client->request("/orgs/$org/teams", 'GET', $data, 200, 'GitHubTeam', true);

return $this->client->request("/gists/$gist_id/comments", 'GET', $data, 200, 'GitHubGistComment', true);

return $this->client->request("/orgs/$org/members", 'GET', $data, 200, 'GitHubUser', true);

return $this->client->request("/repos/$owner/$repo/collaborators", 'GET', $data, 200, 'GitHubUser', true);

@ryandesign
Copy link
Contributor Author

Ok, those lines of code set the isArray parameter of the request method to true instead of the default of false. But then what happens? request and the rest of GitHubClientBase don't appear to use isArray to do anything different.

@tan-tan-kanarek
Copy link
Owner

You're right, I don't use it anymore.
It could be removed, same as lastReturnIsArray, but we will have to modify all the methods that use request method.

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

2 participants