Skip to content

Commit 4e73bcb

Browse files
authored
Merge pull request #22 from xianqiliu/release/0.1.0
release version 0.1.0 - together with @xianqiliu
2 parents 7399b8a + 46ded53 commit 4e73bcb

9 files changed

Lines changed: 95 additions & 3 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PHP Composer
1+
name: build
22

33
on:
44
push:

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags: [ '*' ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
php: [ 7.4 ]
14+
15+
name: PHP ${{ matrix.php }}
16+
steps:
17+
- name: Checkout amadeus-php
18+
uses: actions/checkout@v2
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@master
22+
with:
23+
php-version: ${{ matrix.php }}
24+
25+
- name: Report PHP version
26+
run: php -v
27+
28+
- name: Validate composer.json and composer.lock
29+
run: composer validate --strict
30+
31+
- name: Install dependencies
32+
run: composer install --ignore-platform-reqs
33+
34+
- name: Update dependencies
35+
run: composer update --ignore-platform-reqs
36+
37+
- name: Run PHPStan for Grammar check
38+
run: vendor/bin/phpstan analyse src tests --level 4
39+
40+
- name: Run PHPUnit for tests
41+
run: vendor/bin/phpunit --coverage-text tests

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
src/client/cached_token.json
22
composer.lock
33
.idea/
4-
vendor/
4+
vendor/
5+
.phpunit.cache

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Changelog
2+
3+
0.1.0 - 2022-06-29
4+
--------------------
5+
6+
The 0.1.0 version of the Amadeus for Developers PHP SDK:
7+
8+
Add support for the [Flight Offers Search API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-offers-search/api-reference)
9+
10+
Add support for the [Flight Offers Price API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-offers-price/api-reference)
11+
12+
Add support for the [Flight Create Orders API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-create-orders/api-reference)
13+
14+
Add support for the [Airport & City Search API](https://developers.amadeus.com/self-service/category/air/api-doc/airport-and-city-search/api-reference)
15+
16+
Add support for the [Hotel Name Autocomplete API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-name-autocomplete/api-reference)
17+
18+
Add support for the [Hotel List API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-list/api-reference)
19+
20+
Add support for the [Hotel Search API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-search/api-reference)
21+
22+
Add support for the [Hotel Booking API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-booking/api-reference)
23+
24+
Add support for the [Flight Availabilities Search API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-availabilities-search/api-reference)
25+
26+
Add support for the [Airport Routes API](https://developers.amadeus.com/self-service/category/air/api-doc/airport-routes/api-reference)
27+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Amadeus provides a rich set of APIs for the travel industry. For more details, c
99
This library requires PHP 7.4+. You can install the SDK via Composer
1010

1111
```
12-
composer require amadeus4dev/amadeus-php:dev-master
12+
composer require amadeus4dev/amadeus-php:0.1.0
1313
```
1414

1515
## Getting Started

src/Amadeus.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
*/
2020
class Amadeus
2121
{
22+
/**
23+
* The SDK version.
24+
*/
25+
public const VERSION = "0.1.0";
26+
2227
private Configuration $configuration;
2328

2429
private HTTPClient $client;

src/client/Request.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Amadeus\Client;
66

7+
use Amadeus\Amadeus;
78
use Amadeus\Constants;
89

910
/**
@@ -48,6 +49,11 @@ class Request
4849
*/
4950
private ?string $bearerToken;
5051

52+
/**
53+
* The version of the SDK used.
54+
*/
55+
private ?string $clientVersion;
56+
5157
/**
5258
* The version of PHP used.
5359
*/
@@ -103,6 +109,7 @@ public function __construct(
103109
$this->params = $params;
104110
$this->body = $body;
105111
$this->bearerToken = $bearerToken;
112+
$this->clientVersion = Amadeus::VERSION;
106113
$this->languageVersion = phpversion();
107114
$this->port = $config->getPort();
108115
$this->ssl = $config->isSsl();
@@ -217,6 +224,14 @@ public function getBearerToken(): ?string
217224
return $this->bearerToken;
218225
}
219226

227+
/**
228+
* @return string|null
229+
*/
230+
public function getClientVersion(): ?string
231+
{
232+
return $this->clientVersion;
233+
}
234+
220235
/**
221236
* @return string|null
222237
*/

tests/client/RequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function testInitializer(): void
6161
$this->assertEquals($params, $request->getParams());
6262
$this->assertNull($request->getBody());
6363
$this->assertEquals("token", $request->getBearerToken());
64+
$this->assertEquals(Amadeus::VERSION, $request->getClientVersion());
6465
$this->assertEquals(phpversion(), $request->getLanguageVersion());
6566
$this->assertEquals(443, $request->getPort());
6667
$this->assertTrue($request->isSsl());

tests/referenceData/LocationsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
* @covers \Amadeus\Resources\Location
3535
* @covers \Amadeus\Resources\Resource
3636
* @covers \Amadeus\Resources\LocationAnalyticsTravelers
37+
*
38+
* @see https://developers.amadeus.com/self-service/category/air/api-doc/airport-and-city-search/api-reference
3739
*/
3840
final class LocationsTest extends TestCase
3941
{

0 commit comments

Comments
 (0)