jasny/social — pull request #3 by jbroudou (2013-12-24 01:24:18+00:00)
Title: LinkedIn work in progress

Hi,

I made a few changes.

1) I made headers an optional argument to post(), which is eventually used by the curlInit() method. I think it makes sense at this level rather than at the connection level (like you do with https://github.com/jasny/social/blob/master/src/Social/LinkedIn/Connection.php#L53) as headers like Content-Type should be per request. Also at line 500 it was reading from $headers['Content-Type'], when $headers is an sequential indexed array.

2) To support JSON I made curlInit() look at the Content-Type headers and automatically serialise to JSON if it is set to "application/json". This seemed consistent with the way you currently handle 'multipart/form-data'.

3) It wasn't clear to me how the "Me" objects should have access to the underlying connection object, so I added a setConnection() method, which could be added to the underlying base class. Maybe you had something better in mind?

4) The static method getCurrentUrl() was making a non static call.

Cheers