tan-tan-kanarek / github-php-client

MIT License
184 stars 120 forks source link

What's the purpose of isArray? #85

Open ryandesign opened 8 years ago

ryandesign commented 8 years ago

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

tan-tan-kanarek commented 8 years ago

It's used, here are few examples: https://github.com/tan-tan-kanarek/github-php-client/blob/83d80d7d94d7ca4b40cdcd042853a5fa9dc5542c/client/services/GitHubIssuesLabels.php#L20 https://github.com/tan-tan-kanarek/github-php-client/blob/83d80d7d94d7ca4b40cdcd042853a5fa9dc5542c/client/services/GitHubPulls.php#L61 https://github.com/tan-tan-kanarek/github-php-client/blob/83d80d7d94d7ca4b40cdcd042853a5fa9dc5542c/client/services/GitHubOrgsTeams.php#L23 https://github.com/tan-tan-kanarek/github-php-client/blob/83d80d7d94d7ca4b40cdcd042853a5fa9dc5542c/client/services/GitHubGistsComments.php#L20 https://github.com/tan-tan-kanarek/github-php-client/blob/83d80d7d94d7ca4b40cdcd042853a5fa9dc5542c/client/services/GitHubOrgsMembers.php#L20 https://github.com/tan-tan-kanarek/github-php-client/blob/12412cc7b75e31ae32fb74a819f4e512209e5e9e/client/services/GitHubReposCollaborators.php#L19

ryandesign commented 8 years ago

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 commented 8 years ago

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.