Skip to content

Commit c2d06b7

Browse files
committed
version 3.18.0
1 parent 4a33330 commit c2d06b7

6 files changed

Lines changed: 97 additions & 26 deletions

File tree

.travis.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,33 @@ php:
33
- 7.3
44
- 7.4
55
- 8.0
6+
- 8.1
67

78
env:
8-
# - dependencies=--prefer-lowest
99
- dependencies=
1010

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

13+
matrix:
14+
include:
15+
- php: 7.3
16+
env: dependencies=lowest
17+
- php: 7.3
18+
env: dependencies=highest
19+
- php: 7.4
20+
env: dependencies=lowest
21+
- php: 7.4
22+
env: dependencies=highest
23+
- php: 8.0
24+
env: dependencies=lowest
25+
- php: 8.0
26+
env: dependencies=highest
27+
- php: 8.1
28+
env: dependencies=lowest
29+
- php: 8.1
30+
env: dependencies=highest
31+
1332
before_script:
14-
- composer self-update
15-
- composer update
33+
- if [ -z "$dependencies" ]; then composer install -n; fi;
34+
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-stable -n; fi;
35+
- if [ "$dependencies" = "highest" ]; then composer update -n; fi;

CHANGELOG renamed to CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.18.0] - 2021-03-24
8+
### Added
9+
- Compatibility with PHP 8.1
10+
- New API method added:
11+
- getUserPrivacySettings
12+
- getAdventure
13+
14+
## [3.16.0] - 2021-08-06
15+
### Added
16+
- Better exception management
17+
718
## [3.15.0] - 2021-05-22
819
### Added
920
- New API method added:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
}
1818
},
1919
"require": {
20-
"php": "^7.3 || ^8.0",
20+
"php": "^7.3 || ^8.0 || ^8.1",
2121
"monolog/monolog": "^2.0",
2222
"guzzlehttp/guzzle": "^7.0",
2323
"surfoo/oauth2-geocaching": "^1.4"
2424
},
2525
"require-dev": {
2626
"phpunit/phpunit": "^9.0",
27-
"phpstan/phpstan": "^0.12.0",
27+
"phpstan/phpstan": "^0.12",
2828
"friendsofphp/php-cs-fixer": "^3.0"
2929
},
3030
"scripts": {

src/Lib/Utils/Utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected static function base31Encode(int $input): string
134134

135135
while ($input > 0) {
136136
$result .= self::BASE_31_CHARS[$input % 31];
137-
$input = (int) $input / 31;
137+
$input = intval($input / 31);
138138
}
139139

140140
return \strrev($result);

src/Sdk/GeocachingSdk.php

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ public function __construct(HttpClientInterface $httpClient)
3030
$this->httpClient = $httpClient;
3131
}
3232

33+
/**
34+
* swagger: GET /v{api-version}/adventures/{adventureId}
35+
*
36+
* @see https://api.groundspeak.com/documentation#get-adventure
37+
* @see https://api.groundspeak.com/api-docs/index#!/Adventures/Adventures_Get
38+
*
39+
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
40+
*/
41+
public function getAdventure(string $adventureId, array $options = [])
42+
{
43+
return $this->httpClient->get('adventures/' . $adventureId, [], $options);
44+
}
45+
3346
/**
3447
* swagger: GET /v{api-version}/adventures/search
3548
*
@@ -851,6 +864,19 @@ public function getTrackableLogs(string $referenceCode, array $query = [], array
851864
return $this->httpClient->get('trackables/' . $referenceCode . '/trackablelogs', $query, $options);
852865
}
853866

867+
/**
868+
* swagger: GET /v{api-version}/users/{referenceCode}/privacysettings
869+
*
870+
* @see https://api.groundspeak.com/documentation#get-user-privacy-settings
871+
* @see https://api.groundspeak.com/api-docs/index#!/Users/Users_GetUserPrivacySettings
872+
*
873+
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
874+
*/
875+
public function getUserPrivacySettings(string $referenceCode, array $options = [])
876+
{
877+
return $this->httpClient->get('users/' . $referenceCode . '/privacysettings', [], $options);
878+
}
879+
854880
/**
855881
* swagger: GET /v{api-version}/users/{referenceCode}
856882
*
@@ -864,6 +890,19 @@ public function getUser(string $referenceCode, array $query = [], array $options
864890
return $this->httpClient->get('users/' . $referenceCode, $query, $options);
865891
}
866892

893+
/**
894+
* swagger: GET /v{api-version}/optedoutusers
895+
*
896+
* @see https://api.groundspeak.com/documentation#get-opted-out-users
897+
* @see https://api.groundspeak.com/api-docs/index#!/Users/Users_GetOptedOutUsers
898+
*
899+
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
900+
*/
901+
public function getOptedOutUsers(array $query, array $options = [])
902+
{
903+
return $this->httpClient->get('optedoutusers', $query, $options);
904+
}
905+
867906
/**
868907
* swagger: GET /v{api-version}/users/{referenceCode}/images
869908
*
@@ -1163,19 +1202,6 @@ public function getTrackableLogTypes(array $options = [])
11631202
return $this->httpClient->get('trackablelogtypes', $options);
11641203
}
11651204

1166-
/**
1167-
* swagger: GET /v{api-version}/optedoutusers
1168-
*
1169-
* @see https://api.groundspeak.com/documentation#get-opted-out-users
1170-
* @see https://api.groundspeak.com/api-docs/index#!/Users/Users_GetOptedOutUsers
1171-
*
1172-
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
1173-
*/
1174-
public function getOptedOutUsers(array $query, array $options = [])
1175-
{
1176-
return $this->httpClient->get('optedoutusers', $query, $options);
1177-
}
1178-
11791205
/**
11801206
* swagger: GET /v{api-version}/wherigo/{guid}/cartridge
11811207
*

src/Sdk/GeocachingSdkInterface.php

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212

1313
interface GeocachingSdkInterface
1414
{
15+
/**
16+
* @see https://api.groundspeak.com/api-docs/index#!/Adventures/Adventures_Get
17+
*
18+
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
19+
*/
20+
public function getAdventure(string $adventureId, array $options = []);
21+
1522
/**
1623
* @see https://api.groundspeak.com/api-docs/index#!/Adventures/Adventures_Search
1724
*
@@ -451,13 +458,27 @@ public function getTrackableImages(string $referenceCode, array $query = [], arr
451458
*/
452459
public function getTrackableLogs(string $referenceCode, array $query = [], array $options = []);
453460

461+
/**
462+
* @see https://api.groundspeak.com/documentation#get-user-privacy-settings
463+
*
464+
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
465+
*/
466+
public function getUserPrivacySettings(string $referenceCode, array $options = []);
467+
454468
/**
455469
* @see https://api.groundspeak.com/documentation#get-user
456470
*
457471
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
458472
*/
459473
public function getUser(string $referenceCode, array $query = [], array $options = []);
460474

475+
/**
476+
* @see https://api.groundspeak.com/documentation#get-opted-out-users
477+
*
478+
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
479+
*/
480+
public function getOptedOutUsers(array $query, array $options = []);
481+
461482
/**
462483
* @see https://api.groundspeak.com/documentation#get-user-images
463484
*
@@ -619,13 +640,6 @@ public function getGeocacheLogTypes(array $options = []);
619640
*/
620641
public function getTrackableLogTypes(array $options = []);
621642

622-
/**
623-
* @see https://api.groundspeak.com/documentation#get-opted-out-users
624-
*
625-
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
626-
*/
627-
public function getOptedOutUsers(array $query, array $options = []);
628-
629643
/**
630644
* @return \Geocaching\Lib\Adapters\GuzzleHttpClient
631645
*/

0 commit comments

Comments
 (0)