Skip to content

Commit 0d6c347

Browse files
authored
Merge pull request #42 from vredeling/master
Update oauth2 client to v2.3 & replace PEST with Guzzle.
2 parents 291006e + 32c4dd0 commit 0d6c347

File tree

6 files changed

+376
-360
lines changed

6 files changed

+376
-360
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: php
22
php:
3-
- 5.5
3+
- 5.6
44
install:
55
- composer --no-interaction install
66
script: phpunit --configuration phpunit.xml --coverage-clover=coverage.clover

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ use Strava\API\Exception;
7878
use Strava\API\Service\REST;
7979

8080
try {
81-
$adapter = new Pest('https://www.strava.com/api/v3');
81+
$adapter = new \GuzzleHttp\Client(['base_uri' => 'https://www.strava.com/api/v3']);
8282
$service = new REST($token, $adapter); // Define your user token here.
8383
$client = new Client($service);
8484

@@ -146,8 +146,8 @@ $oauth->getAccessToken($grant = 'authorization_code', $params = []);
146146
### Strava\API\Client
147147
#### Usage
148148
```php
149-
// REST adapter (We use `Pest` in this project)
150-
$adapter = new Pest('https://www.strava.com/api/v3');
149+
// REST adapter (We use `Guzzle` in this project)
150+
$adapter = new \GuzzleHttp\Client(['base_uri' => 'https://www.strava.com/api/v3']);
151151
// Service to use (Service\Stub is also available for test purposes)
152152
$service = new Service\REST('RECEIVED-TOKEN', $adapter);
153153

@@ -207,7 +207,7 @@ $client->getStreamsRoute($id);
207207
### Used libraries
208208
- [Strava API](https://strava.github.io/api/)
209209
- [thephpleague/oauth2-client](https://github.com/thephpleague/oauth2-client/)
210-
- [educoder/pest](https://github.com/educoder/pest)
210+
- [guzzlehttp/guzzle](https://github.com/guzzle/guzzle)
211211

212212
### Development
213213
The StravaPHP library was created by Bas van Dorst, [software engineer](https://www.linkedin.com/in/basvandorst) and cyclist enthusiast.

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"StravaPHP"
1010
],
1111
"require": {
12-
"php": ">=5.5.0",
13-
"educoder/pest": "~1.0",
14-
"league/oauth2-client": "~1.0"
12+
"php": ">=5.6",
13+
"league/oauth2-client": "~2.3",
14+
"guzzlehttp/guzzle": "~6.3"
1515
},
1616
"require-dev": {
17-
"phpunit/phpunit": "~4.0"
17+
"phpunit/phpunit": "^5"
1818
},
1919
"license": "MIT",
2020
"authors": [

src/Strava/API/Factory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22
namespace Strava\API;
33

4-
use Pest;
5-
64
/**
75
* Factory class
86
*
@@ -45,7 +43,7 @@ public function getOAuthClient($client_id, $client_secret, $redirect_uri)
4543
*/
4644
public function getAPIClient($token)
4745
{
48-
$adapter = new Pest(self::$endpoint);
46+
$adapter = new \GuzzleHttp\Client(['base_uri' => self::$endpoint]);
4947
$service = new Service\REST($token, $adapter);
5048

5149
$APIClient = new Client($service);

0 commit comments

Comments
 (0)