github-php-client icon indicating copy to clipboard operation
github-php-client copied to clipboard

What's the purpose of isArray?

Open ryandesign opened this issue 9 years ago • 3 comments

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

ryandesign avatar Feb 07 '16 13:02 ryandesign

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

tan-tan-kanarek avatar Feb 08 '16 11:02 tan-tan-kanarek

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.

ryandesign avatar Feb 08 '16 11:02 ryandesign

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.

tan-tan-kanarek avatar Feb 08 '16 12:02 tan-tan-kanarek