Skip to content

Commit

Permalink
Merge pull request #22 from xianqiliu/release/0.1.0
Browse files Browse the repository at this point in the history
release version 0.1.0 - together with @xianqiliu
  • Loading branch information
minjikarin authored Jun 29, 2022
2 parents 7399b8a + 46ded53 commit 4e73bcb
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHP Composer
name: build

on:
push:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: publish

on:
push:
tags: [ '*' ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php: [ 7.4 ]

name: PHP ${{ matrix.php }}
steps:
- name: Checkout amadeus-php
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}

- name: Report PHP version
run: php -v

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Install dependencies
run: composer install --ignore-platform-reqs

- name: Update dependencies
run: composer update --ignore-platform-reqs

- name: Run PHPStan for Grammar check
run: vendor/bin/phpstan analyse src tests --level 4

- name: Run PHPUnit for tests
run: vendor/bin/phpunit --coverage-text tests
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
src/client/cached_token.json
composer.lock
.idea/
vendor/
vendor/
.phpunit.cache
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

0.1.0 - 2022-06-29
--------------------

The 0.1.0 version of the Amadeus for Developers PHP SDK:

Add support for the [Flight Offers Search API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-offers-search/api-reference)

Add support for the [Flight Offers Price API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-offers-price/api-reference)

Add support for the [Flight Create Orders API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-create-orders/api-reference)

Add support for the [Airport & City Search API](https://developers.amadeus.com/self-service/category/air/api-doc/airport-and-city-search/api-reference)

Add support for the [Hotel Name Autocomplete API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-name-autocomplete/api-reference)

Add support for the [Hotel List API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-list/api-reference)

Add support for the [Hotel Search API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-search/api-reference)

Add support for the [Hotel Booking API](https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-booking/api-reference)

Add support for the [Flight Availabilities Search API](https://developers.amadeus.com/self-service/category/air/api-doc/flight-availabilities-search/api-reference)

Add support for the [Airport Routes API](https://developers.amadeus.com/self-service/category/air/api-doc/airport-routes/api-reference)

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Amadeus provides a rich set of APIs for the travel industry. For more details, c
This library requires PHP 7.4+. You can install the SDK via Composer

```
composer require amadeus4dev/amadeus-php:dev-master
composer require amadeus4dev/amadeus-php:0.1.0
```

## Getting Started
Expand Down
5 changes: 5 additions & 0 deletions src/Amadeus.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
*/
class Amadeus
{
/**
* The SDK version.
*/
public const VERSION = "0.1.0";

private Configuration $configuration;

private HTTPClient $client;
Expand Down
15 changes: 15 additions & 0 deletions src/client/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Amadeus\Client;

use Amadeus\Amadeus;
use Amadeus\Constants;

/**
Expand Down Expand Up @@ -48,6 +49,11 @@ class Request
*/
private ?string $bearerToken;

/**
* The version of the SDK used.
*/
private ?string $clientVersion;

/**
* The version of PHP used.
*/
Expand Down Expand Up @@ -103,6 +109,7 @@ public function __construct(
$this->params = $params;
$this->body = $body;
$this->bearerToken = $bearerToken;
$this->clientVersion = Amadeus::VERSION;
$this->languageVersion = phpversion();
$this->port = $config->getPort();
$this->ssl = $config->isSsl();
Expand Down Expand Up @@ -217,6 +224,14 @@ public function getBearerToken(): ?string
return $this->bearerToken;
}

/**
* @return string|null
*/
public function getClientVersion(): ?string
{
return $this->clientVersion;
}

/**
* @return string|null
*/
Expand Down
1 change: 1 addition & 0 deletions tests/client/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function testInitializer(): void
$this->assertEquals($params, $request->getParams());
$this->assertNull($request->getBody());
$this->assertEquals("token", $request->getBearerToken());
$this->assertEquals(Amadeus::VERSION, $request->getClientVersion());
$this->assertEquals(phpversion(), $request->getLanguageVersion());
$this->assertEquals(443, $request->getPort());
$this->assertTrue($request->isSsl());
Expand Down
2 changes: 2 additions & 0 deletions tests/referenceData/LocationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* @covers \Amadeus\Resources\Location
* @covers \Amadeus\Resources\Resource
* @covers \Amadeus\Resources\LocationAnalyticsTravelers
*
* @see https://developers.amadeus.com/self-service/category/air/api-doc/airport-and-city-search/api-reference
*/
final class LocationsTest extends TestCase
{
Expand Down

0 comments on commit 4e73bcb

Please sign in to comment.