Completed
Push — master ( 8f168b...4b1795 )
by Dieter
09:49
created

Offer::createOfferCreateOffer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * amadeus-ws-client
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 * http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 *
19
 * @package Amadeus
20
 * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
21
 */
22
23
namespace Amadeus\Client\RequestCreator;
24
25
use Amadeus\Client\RequestOptions\OfferConfirmAirOptions;
26
use Amadeus\Client\RequestOptions\OfferConfirmCarOptions;
27
use Amadeus\Client\RequestOptions\OfferConfirmHotelOptions;
28
use Amadeus\Client\RequestOptions\OfferCreateOptions;
29
use Amadeus\Client\RequestOptions\OfferVerifyOptions;
30
use Amadeus\Client\Struct;
31
32
/**
33
 * Offer
34
 *
35
 * @package Amadeus\Client\RequestCreator
36
 * @author Dieter Devlieghere <[email protected]>
37
 */
38
class Offer
39
{
40
    /**
41
     * Offer_VerifyOffer
42
     *
43
     * @param OfferVerifyOptions $params
44
     * @return Struct\Offer\Verify
45
     */
46 4
    public function createOfferVerifyOffer(OfferVerifyOptions $params)
47
    {
48 4
        $req = new Struct\Offer\Verify(
49 4
            $params->offerReference,
50 4
            $params->segmentName
51 4
        );
52
53 4
        return $req;
54
    }
55
56
    /**
57
     * @param OfferConfirmAirOptions $params
58
     * @return Struct\Offer\ConfirmAir
59
     */
60 1
    public function createOfferConfirmAirOffer(OfferConfirmAirOptions $params)
61
    {
62 1
        return new Struct\Offer\ConfirmAir($params);
63
    }
64
65
66
    /**
67
     * Offer_ConfirmHotelOffer
68
     *
69
     * @param OfferConfirmHotelOptions $params
70
     * @return Struct\Offer\ConfirmHotel
71
     */
72 1
    public function createOfferConfirmHotelOffer(OfferConfirmHotelOptions $params)
73
    {
74 1
        return new Struct\Offer\ConfirmHotel($params);
75
    }
76
77
    /**
78
     * @param OfferConfirmCarOptions $params
79
     * @return Struct\Offer\ConfirmCar
80
     */
81 1
    public function createOfferConfirmCarOffer(OfferConfirmCarOptions $params)
82
    {
83 1
        return new Struct\Offer\ConfirmCar($params);
84
    }
85
86
    /**
87
     * Offer_CreateOffer
88
     *
89
     * Ok, I just realised this function name is a bit confusing. Sorry.
90
     *
91
     * @param OfferCreateOptions $params
92
     * @return Struct\Offer\Create
93
     */
94 1
    public function createOfferCreateOffer(OfferCreateOptions $params)
95
    {
96 1
        return new Struct\Offer\Create($params);
97
    }
98
}
99