-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c80805
commit f4145fd
Showing
19 changed files
with
451 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM php:8.3-apache | ||
|
||
# Requirements | ||
RUN apt-get update \ | ||
&& apt-get install -y libxslt1-dev libzip-dev unzip git curl | ||
|
||
# PHP extensions | ||
RUN docker-php-ext-install soap | ||
RUN docker-php-ext-install xsl | ||
|
||
# Add the application | ||
ADD . /var/www | ||
WORKDIR /var/www | ||
|
||
RUN git config --system --add safe.directory /var/www | ||
|
||
# Install composer | ||
RUN curl -sS https://getcomposer.org/installer | php \ | ||
&& mv composer.phar /usr/bin/composer | ||
|
||
# Install dependencies | ||
RUN composer i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
image_name = amadeus-ws-client:build | ||
|
||
SHELL = /bin/sh | ||
|
||
build-docker-image: | ||
docker build -t $(image_name) -f Dockerfile . | ||
|
||
build-docker-image-once: | ||
make verify-docker-image-exists || make build-docker-image | ||
|
||
build-docker-image-no-cache: | ||
docker build --no-cache -t $(image_name) -f Dockerfile . | ||
|
||
verify-docker-image-exists: | ||
docker image inspect $(image_name) >/dev/null 2>&1 | ||
|
||
composer-install: | ||
docker run --rm -ti -v $(shell pwd):/var/www -w /var/www -u $(shell id -u) $(image_name) composer i | ||
|
||
phpunit: | ||
docker run --rm -ti -v $(shell pwd):/var/www -w /var/www -u $(shell id -u) $(image_name) ./vendor/bin/phpunit | ||
|
||
test: | ||
make build-docker-image-once | ||
make composer-install | ||
make phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/Amadeus/Client/RequestCreator/Converter/Service/BookPriceProductConv.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\RequestCreator\Converter\Service; | ||
|
||
use Amadeus\Client\RequestCreator\Converter\BaseConverter; | ||
use Amadeus\Client\RequestOptions\ServiceBookPriceProductOptions; | ||
use Amadeus\Client\Struct; | ||
|
||
/** | ||
* Service_BookPriceProduct Request converter | ||
* | ||
* @package Amadeus\Client\RequestCreator\Converter\Service | ||
*/ | ||
class BookPriceProductConv extends BaseConverter | ||
{ | ||
/** | ||
* @param ServiceBookPriceProductOptions $requestOptions | ||
* @param int|string $version | ||
* @return Struct\Service\BookPriceProduct | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Service\BookPriceProduct($requestOptions); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Amadeus/Client/RequestOptions/Service/BookPriceProduct/Recommendation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\RequestOptions\Service\BookPriceProduct; | ||
|
||
use Amadeus\Client\LoadParamsFromArray; | ||
|
||
class Recommendation extends LoadParamsFromArray | ||
{ | ||
/** | ||
* @var string|int | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* @var string[]|int[] One or more travelers to whom this service applies | ||
*/ | ||
public $customerRefIds = []; | ||
} |
43 changes: 43 additions & 0 deletions
43
src/Amadeus/Client/RequestOptions/ServiceBookPriceProductOptions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\RequestOptions; | ||
|
||
use Amadeus\Client\RequestOptions\Service\BookPriceProduct\Recommendation; | ||
|
||
/** | ||
* Service_BookPriceProduct Request Options | ||
* | ||
* @package Amadeus\Client\RequestOptions | ||
*/ | ||
class ServiceBookPriceProductOptions extends Base | ||
{ | ||
/** | ||
* @var string For all OpenTravel versioned messages, the version of the message is indicated by a decimal value. | ||
*/ | ||
public $version = '1.0'; | ||
|
||
/** | ||
* @var Recommendation[] | ||
*/ | ||
public $recommendations = []; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Amadeus/Client/ResponseHandler/Service/HandlerBookPriceProduct.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\ResponseHandler\Service; | ||
|
||
/** | ||
* HandlerBookPriceService | ||
* | ||
* @package Amadeus\Client\ResponseHandler\Service | ||
*/ | ||
class HandlerBookPriceProduct extends HandlerBookPriceService | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\Struct\Service; | ||
|
||
use Amadeus\Client\RequestOptions\ServiceBookPriceProductOptions; | ||
use Amadeus\Client\Struct\BaseWsMessage; | ||
use Amadeus\Client\Struct\Service\BookPriceProduct\Recommendation; | ||
|
||
class BookPriceProduct extends BaseWsMessage | ||
{ | ||
/** | ||
* @var Recommendation[] | ||
*/ | ||
public $Recommendation; | ||
|
||
public $Version; | ||
|
||
/** | ||
* @param ServiceBookPriceProductOptions $options | ||
*/ | ||
public function __construct($options) | ||
{ | ||
$this->Version = $options->version; | ||
|
||
foreach ($options->recommendations as $recommendation) { | ||
$this->Recommendation[] = new Recommendation($recommendation); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Amadeus/Client/Struct/Service/BookPriceProduct/Recommendation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\Struct\Service\BookPriceProduct; | ||
|
||
class Recommendation | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $RecoID; | ||
|
||
/** | ||
* @var string[] | ||
*/ | ||
public $CustomerRefIds; | ||
|
||
/** | ||
* @param \Amadeus\Client\RequestOptions\Service\BookPriceProduct\Recommendation $recommendationOptions | ||
*/ | ||
public function __construct($recommendationOptions) | ||
{ | ||
$this->RecoID = $recommendationOptions->id; | ||
|
||
if (!empty($recommendationOptions->customerRefIds)) { | ||
$this->CustomerRefIds = $recommendationOptions->customerRefIds; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.