Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vredeling committed Jun 15, 2020
2 parents c307887 + c8e08b7 commit 9d8d7ba
Show file tree
Hide file tree
Showing 18 changed files with 952 additions and 907 deletions.
12 changes: 11 additions & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ checks:
php:
code_rating: true
duplication: true
build:
tests:
before:
- 'composer install --dev --prefer-source'
override:
-
command: 'vendor/bin/phpunit -c /home/scrutinizer/build/phpunit.xml --coverage-clover=clover-file'
coverage:
file: 'clover-file'
format: 'clover'
filter:
excluded_paths: [vendor/*, tests/*]
before_commands:
- 'composer install --dev --prefer-source'
tools:
external_code_coverage: true
external_code_coverage: false
php_mess_detector: true
php_code_sniffer: true
sensiolabs_security_checker: true
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: php
php:
- 5.6
- 7.1
install:
- composer --no-interaction install
script: phpunit --configuration phpunit.xml --coverage-clover=coverage.clover
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Use composer to install this StravaPHP package.
```
{
"require": {
"vredeling/StravaPHP": "^1.2.0"
"vredeling/stravaphp": "^1.2.0"
}
}
```
Expand Down Expand Up @@ -100,6 +100,8 @@ try {
### Strava\API\Factory
#### Usage
```php
use Strava\API\Factory;

// Configure your app ID, app token and callback uri
$factory = new Factory();
$OAuthClient = $factory->getOAuthClient(1234, 'APP-TOKEN', 'http://my-app/callback.php');
Expand All @@ -113,6 +115,8 @@ $factory->getAPIClient($token);
### Strava\API\OAuth
#### Usage
```php
use Strava\API\OAuth;

// Parameter information: https://strava.github.io/api/v3/oauth/#get-authorize
$options = [
'clientId' => 1234,
Expand Down Expand Up @@ -147,9 +151,13 @@ $oauth->getAccessToken($grant = 'authorization_code', $params = []);
#### Usage
```php
// REST adapter (We use `Guzzle` in this project)
$adapter = new \GuzzleHttp\Client(['base_uri' => 'https://www.strava.com/api/v3/']);
use GuzzleHttp\Client as GuzzleClient;
use Strava\API\Service\REST;
use Strava\API\Client;

$adapter = new GuzzleClient(['base_uri' => 'https://www.strava.com/api/v3/']);
// Service to use (Service\Stub is also available for test purposes)
$service = new Service\REST('RECEIVED-TOKEN', $adapter);
$service = new REST('RECEIVED-TOKEN', $adapter);

// Receive the athlete!
$client = new Client($service);
Expand All @@ -170,7 +178,7 @@ $client->getAthleteKom($id, $page = null, $per_page = null);
$client->getAthleteZones();
$client->getAthleteStarredSegments($id = null, $page = null, $per_page = null);
$client->updateAthlete($city, $state, $country, $sex, $weight);
$client->getActivityFollowing($before = null, $page = null, $per_page = null)
$client->getActivityFollowing($before = null, $page = null, $per_page = null);
$client->getActivity($id, $include_all_efforts = null);
$client->getActivityComments($id, $markdown = null, $page = null, $per_page = null);
$client->getActivityKudos($id, $page = null, $per_page = null);
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"StravaPHP"
],
"require": {
"php": ">=5.6",
"php": ">=7.1",
"league/oauth2-client": "~2.3",
"guzzlehttp/guzzle": "~6.3"
"guzzlehttp/guzzle": "~6.3",
"ext-json": "*",
"ext-curl": "*"
},
"require-dev": {
"phpunit/phpunit": "^5"
Expand Down
15 changes: 15 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">./vendor</directory>
<directory suffix=".php">./tests</directory>
</exclude>
</whitelist>
</filter>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<!-- this is the path of the files included in your clover report -->
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
Expand Down
Loading

0 comments on commit 9d8d7ba

Please sign in to comment.