From e7b0c8f0324b3147a60f35cb26fe92a32754d1a8 Mon Sep 17 00:00:00 2001 From: Jarrett Croll Date: Wed, 7 Sep 2016 15:03:02 +0000 Subject: [PATCH] change method name --- README.md | 2 +- src/Client/FoursquareClient.php | 14 +++++++++++++- tests/Client/FoursquareClientTest.php | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7bb60de..8246d94 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ $client = FoursquareClient::factory([ 'mode' => 'foursquare', // optional (one of 'foursquare' or 'swarm') ]); -$client->addToken($oauthToken); // optionally pass in for user specific requests +$client->setToken($oauthToken); // optionally pass in for user specific requests $client->setMode('swarm'); // switch from mode 'foursquare' to 'swarm' diff --git a/src/Client/FoursquareClient.php b/src/Client/FoursquareClient.php index 04a298e..90cc6ec 100644 --- a/src/Client/FoursquareClient.php +++ b/src/Client/FoursquareClient.php @@ -51,13 +51,25 @@ public static function factory($config = []) * * @return $this */ - public function addToken($token) + public function setToken($token) { $this->getHttpClient()->setDefaultOption('query/oauth_token', $token); return $this; } + /** + * @param string $token + * + * @return $this + * + * @deprecated since version 2.1. Use setToken() instead. + */ + public function addToken($token) + { + return $this->setToken($token); + } + /** * @param string $mode * diff --git a/tests/Client/FoursquareClientTest.php b/tests/Client/FoursquareClientTest.php index 143f76a..c767fd6 100644 --- a/tests/Client/FoursquareClientTest.php +++ b/tests/Client/FoursquareClientTest.php @@ -66,7 +66,7 @@ public function testAddToken($clientId, $clientSecret) $token = 'secretToken'; $client = FoursquareClient::factory($config); - $client->addToken($token); + $client->setToken($token); $defaultOptions = $client->getHttpClient()->getDefaultOption('query');