Skip to content

Commit a06ecad

Browse files
committed
Merge branch 'develop' into pull/46
2 parents 4965845 + 678606c commit a06ecad

File tree

18 files changed

+987
-942
lines changed

18 files changed

+987
-942
lines changed

.scrutinizer.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@ checks:
22
php:
33
code_rating: true
44
duplication: true
5+
build:
6+
tests:
7+
before:
8+
- 'composer install --dev --prefer-source'
9+
override:
10+
-
11+
command: 'vendor/bin/phpunit -c /home/scrutinizer/build/phpunit.xml --coverage-clover=clover-file'
12+
coverage:
13+
file: 'clover-file'
14+
format: 'clover'
515
filter:
616
excluded_paths: [vendor/*, tests/*]
717
before_commands:
818
- 'composer install --dev --prefer-source'
919
tools:
10-
external_code_coverage: true
20+
external_code_coverage: false
1121
php_mess_detector: true
1222
php_code_sniffer: true
1323
sensiolabs_security_checker: true

.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.6
3+
- 7.1
44
install:
55
- composer --no-interaction install
66
script: phpunit --configuration phpunit.xml --coverage-clover=coverage.clover

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Use composer to install this StravaPHP package.
2727
```
2828
{
2929
"require": {
30-
"basvandorst/StravaPHP": "1.2.0"
30+
"basvandorst/stravaphp": "1.3.1"
3131
}
3232
}
3333
```
@@ -78,7 +78,7 @@ use Strava\API\Exception;
7878
use Strava\API\Service\REST;
7979

8080
try {
81-
$adapter = new \GuzzleHttp\Client(['base_uri' => '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

@@ -100,6 +100,8 @@ try {
100100
### Strava\API\Factory
101101
#### Usage
102102
```php
103+
use Strava\API\Factory;
104+
103105
// Configure your app ID, app token and callback uri
104106
$factory = new Factory();
105107
$OAuthClient = $factory->getOAuthClient(1234, 'APP-TOKEN', 'http://my-app/callback.php');
@@ -113,6 +115,8 @@ $factory->getAPIClient($token);
113115
### Strava\API\OAuth
114116
#### Usage
115117
```php
118+
use Strava\API\OAuth;
119+
116120
// Parameter information: https://strava.github.io/api/v3/oauth/#get-authorize
117121
$options = [
118122
'clientId' => 1234,
@@ -147,9 +151,13 @@ $oauth->getAccessToken($grant = 'authorization_code', $params = []);
147151
#### Usage
148152
```php
149153
// REST adapter (We use `Guzzle` in this project)
150-
$adapter = new \GuzzleHttp\Client(['base_uri' => 'https://www.strava.com/api/v3']);
154+
use GuzzleHttp\Client as GuzzleClient;
155+
use Strava\API\Service\REST;
156+
use Strava\API\Client;
157+
158+
$adapter = new GuzzleClient(['base_uri' => 'https://www.strava.com/api/v3/']);
151159
// Service to use (Service\Stub is also available for test purposes)
152-
$service = new Service\REST('RECEIVED-TOKEN', $adapter);
160+
$service = new REST('RECEIVED-TOKEN', $adapter);
153161

154162
// Receive the athlete!
155163
$client = new Client($service);
@@ -170,7 +178,7 @@ $client->getAthleteKom($id, $page = null, $per_page = null);
170178
$client->getAthleteZones();
171179
$client->getAthleteStarredSegments($id = null, $page = null, $per_page = null);
172180
$client->updateAthlete($city, $state, $country, $sex, $weight);
173-
$client->getActivityFollowing($before = null, $page = null, $per_page = null)
181+
$client->getActivityFollowing($before = null, $page = null, $per_page = null);
174182
$client->getActivity($id, $include_all_efforts = null);
175183
$client->getActivityComments($id, $markdown = null, $page = null, $per_page = null);
176184
$client->getActivityKudos($id, $page = null, $per_page = null);

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
"StravaPHP"
1010
],
1111
"require": {
12-
"php": ">=5.6",
12+
"php": ">=7.1",
1313
"league/oauth2-client": "~2.3",
14-
"guzzlehttp/guzzle": "~6.3"
14+
"guzzlehttp/guzzle": "~6.3",
15+
"ext-json": "*",
16+
"ext-curl": "*"
1517
},
1618
"require-dev": {
1719
"phpunit/phpunit": "^5"
@@ -21,6 +23,10 @@
2123
{
2224
"name": "Bas van Dorst",
2325
"email": "basvandorst@gmail.com"
26+
},
27+
{
28+
"name": "Bas Vredeling",
29+
"email": "bas@vredeling.nl"
2430
}
2531
],
2632
"minimum-stability": "stable",

phpunit.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
processIsolation="false"
1010
stopOnFailure="false"
1111
syntaxCheck="false">
12+
<filter>
13+
<whitelist processUncoveredFilesFromWhitelist="true">
14+
<directory suffix=".php">./src</directory>
15+
<exclude>
16+
<directory suffix=".php">./vendor</directory>
17+
<directory suffix=".php">./tests</directory>
18+
</exclude>
19+
</whitelist>
20+
</filter>
21+
<filter>
22+
<whitelist addUncoveredFilesFromWhitelist="true">
23+
<!-- this is the path of the files included in your clover report -->
24+
<directory suffix=".php">./src</directory>
25+
</whitelist>
26+
</filter>
1227
<testsuites>
1328
<testsuite name="Application Test Suite">
1429
<directory>./tests/</directory>

0 commit comments

Comments
 (0)