stephenyoung/php-foursquare — pull request #5 by Johntron (2011-10-20 00:14:14+00:00)
Title: I'm using your code for a project. Here's my changes :)

Hey Stephen. I made some changes for a project I'm working on. I left a pretty detailed commit message for your reference if you want to incorporate them.

* Stores redirect URI internally and added FoursquareApi::setRedirectUri() to change it -- if we can't mix and match redirect URIs between authentication/requests, we should just store it internally so users don't have to keep track of it.
* Also added redirect URI as (optional) constructor parameter. Allows for better use with dependency injection. This change shifts the version parameter to the fourth parameter so may break code that supplies this argument.
* Added method to parse the response from a JSON string and return an object -- This provides a single place to handle errors. We should be checking HTTP status codes, API status_code's, as well as verifying "response" exists in the response
* Adds FoursquareApiException to give us a standard way of handling exceptions
* Removes trailing "?>" -- not necessary, and whitespace after it can break things like session_start (because this whitespace may be flushed to browser before headers can be sent)
* Changed visibility of client credentials from private to protected to allow for inheritance

TODOs:

* Use FoursquareApi::RedirectUri throughout -- users can use FoursquareApi::setRedirectUri() to change it if necessary
* Verify responses
* Use FoursquareApiException for edge cases