Skip to content

Commit

Permalink
version 3.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Surfoo committed Mar 24, 2022
1 parent 4a33330 commit c2d06b7
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 26 deletions.
26 changes: 23 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,33 @@ php:
- 7.3
- 7.4
- 8.0
- 8.1

env:
# - dependencies=--prefer-lowest
- dependencies=

script: ./vendor/bin/phpunit --coverage-text

matrix:
include:
- php: 7.3
env: dependencies=lowest
- php: 7.3
env: dependencies=highest
- php: 7.4
env: dependencies=lowest
- php: 7.4
env: dependencies=highest
- php: 8.0
env: dependencies=lowest
- php: 8.0
env: dependencies=highest
- php: 8.1
env: dependencies=lowest
- php: 8.1
env: dependencies=highest

before_script:
- composer self-update
- composer update
- if [ -z "$dependencies" ]; then composer install -n; fi;
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-stable -n; fi;
- if [ "$dependencies" = "highest" ]; then composer update -n; fi;
11 changes: 11 additions & 0 deletions CHANGELOG → CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.18.0] - 2021-03-24
### Added
- Compatibility with PHP 8.1
- New API method added:
- getUserPrivacySettings
- getAdventure

## [3.16.0] - 2021-08-06
### Added
- Better exception management

## [3.15.0] - 2021-05-22
### Added
- New API method added:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
}
},
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.3 || ^8.0 || ^8.1",
"monolog/monolog": "^2.0",
"guzzlehttp/guzzle": "^7.0",
"surfoo/oauth2-geocaching": "^1.4"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"phpstan/phpstan": "^0.12.0",
"phpstan/phpstan": "^0.12",
"friendsofphp/php-cs-fixer": "^3.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/Utils/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected static function base31Encode(int $input): string

while ($input > 0) {
$result .= self::BASE_31_CHARS[$input % 31];
$input = (int) $input / 31;
$input = intval($input / 31);
}

return \strrev($result);
Expand Down
52 changes: 39 additions & 13 deletions src/Sdk/GeocachingSdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ public function __construct(HttpClientInterface $httpClient)
$this->httpClient = $httpClient;
}

/**
* swagger: GET /v{api-version}/adventures/{adventureId}
*
* @see https://api.groundspeak.com/documentation#get-adventure
* @see https://api.groundspeak.com/api-docs/index#!/Adventures/Adventures_Get
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getAdventure(string $adventureId, array $options = [])
{
return $this->httpClient->get('adventures/' . $adventureId, [], $options);
}

/**
* swagger: GET /v{api-version}/adventures/search
*
Expand Down Expand Up @@ -851,6 +864,19 @@ public function getTrackableLogs(string $referenceCode, array $query = [], array
return $this->httpClient->get('trackables/' . $referenceCode . '/trackablelogs', $query, $options);
}

/**
* swagger: GET /v{api-version}/users/{referenceCode}/privacysettings
*
* @see https://api.groundspeak.com/documentation#get-user-privacy-settings
* @see https://api.groundspeak.com/api-docs/index#!/Users/Users_GetUserPrivacySettings
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getUserPrivacySettings(string $referenceCode, array $options = [])
{
return $this->httpClient->get('users/' . $referenceCode . '/privacysettings', [], $options);
}

/**
* swagger: GET /v{api-version}/users/{referenceCode}
*
Expand All @@ -864,6 +890,19 @@ public function getUser(string $referenceCode, array $query = [], array $options
return $this->httpClient->get('users/' . $referenceCode, $query, $options);
}

/**
* swagger: GET /v{api-version}/optedoutusers
*
* @see https://api.groundspeak.com/documentation#get-opted-out-users
* @see https://api.groundspeak.com/api-docs/index#!/Users/Users_GetOptedOutUsers
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getOptedOutUsers(array $query, array $options = [])
{
return $this->httpClient->get('optedoutusers', $query, $options);
}

/**
* swagger: GET /v{api-version}/users/{referenceCode}/images
*
Expand Down Expand Up @@ -1163,19 +1202,6 @@ public function getTrackableLogTypes(array $options = [])
return $this->httpClient->get('trackablelogtypes', $options);
}

/**
* swagger: GET /v{api-version}/optedoutusers
*
* @see https://api.groundspeak.com/documentation#get-opted-out-users
* @see https://api.groundspeak.com/api-docs/index#!/Users/Users_GetOptedOutUsers
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getOptedOutUsers(array $query, array $options = [])
{
return $this->httpClient->get('optedoutusers', $query, $options);
}

/**
* swagger: GET /v{api-version}/wherigo/{guid}/cartridge
*
Expand Down
28 changes: 21 additions & 7 deletions src/Sdk/GeocachingSdkInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@

interface GeocachingSdkInterface
{
/**
* @see https://api.groundspeak.com/api-docs/index#!/Adventures/Adventures_Get
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getAdventure(string $adventureId, array $options = []);

/**
* @see https://api.groundspeak.com/api-docs/index#!/Adventures/Adventures_Search
*
Expand Down Expand Up @@ -451,13 +458,27 @@ public function getTrackableImages(string $referenceCode, array $query = [], arr
*/
public function getTrackableLogs(string $referenceCode, array $query = [], array $options = []);

/**
* @see https://api.groundspeak.com/documentation#get-user-privacy-settings
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getUserPrivacySettings(string $referenceCode, array $options = []);

/**
* @see https://api.groundspeak.com/documentation#get-user
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getUser(string $referenceCode, array $query = [], array $options = []);

/**
* @see https://api.groundspeak.com/documentation#get-opted-out-users
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getOptedOutUsers(array $query, array $options = []);

/**
* @see https://api.groundspeak.com/documentation#get-user-images
*
Expand Down Expand Up @@ -619,13 +640,6 @@ public function getGeocacheLogTypes(array $options = []);
*/
public function getTrackableLogTypes(array $options = []);

/**
* @see https://api.groundspeak.com/documentation#get-opted-out-users
*
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
public function getOptedOutUsers(array $query, array $options = []);

/**
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
*/
Expand Down

0 comments on commit c2d06b7

Please sign in to comment.