Completed
Push — master ( 57e9fb...792895 )
by Dieter
11:00 queued 03:24
created

Cabin::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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\RequestOptions\Fare\InformativeBestPricingWithoutPnr;
24
25
/**
26
 * Cabin
27
 *
28
 * new Cabin(
29
 *   Cabin::TYPE_FIRST_CABIN, Cabin::CLASS_BUSINESS
30
 * )
31
 *
32
 * @package Amadeus\Client\RequestOptions\Fare\InformativeBestPricingWithoutPnr
33
 * @author  tsari <[email protected]>
34
 */
35
class Cabin
36
{
37
    /**
38
     * Search only in the original cabin (the one from the segment)
39
     */
40
    const TYPE_DEFAULT = 'K';
41
42
    /**
43
     * Search only in the cabin(s) provided as "first cabin".
44
     */
45
    const TYPE_FIRST_CABIN = 'FC';
46
47
    /**
48
     * Search first in the cabin(s) provided as "first cabin", then in the cabin(s) provided as "second cabin".
49
     *
50
     * Note: must be used together with the "first cabin".
51
     */
52
    const TYPE_SECOND_CABIN = 'SC';
53
54
    /**
55
     * Search first in the cabin(s) provided as "first cabin", then in the cabin(s) provided as "second cabin",
56
     * and finally in the cabin(s) provided as "third cabin".
57
     *
58
     * Note: must be used together with the "first cabin" and "second cabin".
59
     */
60
    const TYPE_THIRD_CABIN = 'TC';
61
62
    /**
63
     * In case no fare is found in the cabin(s) provided with above option, defaults to any cabin.
64
     */
65
    const TYPE_DEFAULT_CABIN = 'P';
66
67
    const CLASS_FIRST            = 'F';
68
    const CLASS_BUSINESS         = 'C';
69
    const CLASS_ECONOMY          = 'Y';
70
    const CLASS_STANDARD_ECONOMY = 'M';
71
    const CLASS_PREMIUM_ECONOMY  = 'W';
72
73
    /**
74
     * @var string
75
     */
76
    private $type;
77
78
    /**
79
     * @var string
80
     */
81
    private $class;
82
83
    /**
84
     * Cabin constructor.
85
     *
86
     * @param string $type
87
     * @param string $class
0 ignored issues
show
Documentation introduced by
Should the type for parameter $class not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
88
     */
89 4
    public function __construct($type, $class = null)
90
    {
91 4
        $this->type  = $type;
92 4
        $this->class = $class;
93 4
    }
94
95
    /**
96
     * @return string
97
     */
98 4
    public function getType()
99
    {
100 4
        return $this->type;
101
    }
102
103
    /**
104
     * @return string
105
     */
106 4
    public function getClass()
107
    {
108 4
        return $this->class;
109
    }
110
}
111