Retrieve::__construct()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 4

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 10
ccs 8
cts 8
cp 1
rs 10
cc 4
nc 4
nop 3
crap 4
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\Struct\Pnr\Retrieve;
24
25
/**
26
 * Structure class for the Retrieve message part for PNR_Retrieve messages
27
 *
28
 * @package Amadeus\Client\Struct\Pnr\Retrieve
29
 * @author  Dieter Devlieghere <[email protected]>
30
 */
31
class Retrieve
32
{
33
    /**
34
     * @var string|int
35
     */
36
    public $type;
37
38
    /**
39
     * @var string
40
     */
41
    public $service;
42
43
    /**
44
     * @var string
45
     */
46
    public $tattoo;
47
48
    /**
49
     * @var string
50
     */
51
    public $office;
52
53
    /**
54
     * @var string
55
     */
56
    public $targetSystem;
57
58
    /**
59
     * @var string
60
     */
61
    public $option1;
62
63
    /**
64
     * @var string
65
     */
66
    public $option2;
67
68
    /**
69
     * Construct retrieve element
70
     *
71
     * @param string|int $retrievalType
72
     * @param string $office
73
     * @param string[] $options
74
     */
75 115
    public function __construct($retrievalType, $office, $options)
76
    {
77 115
        $this->type = $retrievalType;
78 115
        $this->office = $office;
79
80 115
        foreach ($options as $key => $option) {
81 10
            if ($key === 0) {
82 10
                $this->option1 = $option;
83 7
            } elseif ($key === 1) {
84 8
                $this->option2 = $option;
85 2
            }
86 46
        }
87 115
    }
88
}
89