kousik / simple-linkedinphp

Automatically exported from code.google.com/p/simple-linkedinphp
0 stars 0 forks source link

Use of PHP closures in v3.2.0 #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install version 3.2.0 of the library.
2. Run the demo scripts on a version of PHP < 5.3.x
3. Attempt to join a group using LinkedIn->joinGroup($gid)

What is the expected output? What do you see instead?

In the joinGroup() method, there are two possible codes that can be returned, 
200 or 201, depending on if the group is 'open' or not. To support passing 
multiple 'correct' response codes to the private checkResponse() method, I 
modified checkResponse() to walk the passed array of response codes using an 
anonymous function (line 259). Also none as a closure, this pattern is not 
supported in PHP prior to 5.3.0, thus breaking joinGroup() support on any PHP 
version prior to that.

I will be releasing a new version, 3.2.1 shortly that will address this bug.

Original issue reported on code.google.com by p...@fiftymission.net on 19 Nov 2011 at 10:38

GoogleCodeExporter commented 8 years ago
Correction, new version will be 3.3.0, as I will be adding in support for a 
couple of new methods as well.

Original comment by p...@fiftymission.net on 19 Nov 2011 at 10:45

GoogleCodeExporter commented 8 years ago
Issue 13 has been merged into this issue.

Original comment by p...@fiftymission.net on 9 Dec 2011 at 9:08

GoogleCodeExporter commented 8 years ago
Fixed the issue in the newly released v3.3.0, swapped out using the anonymous 
function closure method for a simple iteration of the array to a depth of 1 (as 
that is the only depth that is used anyways).

Original comment by p...@fiftymission.net on 10 Dec 2011 at 6:16