Completed
Push — master ( d8c0fd...a82346 )
by Dieter
14:52
created

FlightInfo   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 5
dl 0
loc 71
c 0
b 0
f 0
ccs 23
cts 23
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
C __construct() 0 28 7
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\Fare\MasterPricer;
24
25
/**
26
 * FlightInfo
27
 *
28
 * @package Amadeus\Client\Struct\Fare\MasterPricer
29
 * @author Dieter Devlieghere <[email protected]>
30
 */
31
class FlightInfo
32
{
33
    /**
34
     * @var CabinId
35
     */
36
    public $cabinId;
37
38
    /**
39
     * @var CompanyIdentity[]
40
     */
41
    public $companyIdentity = [];
42
43
    /**
44
     * @var FlightDetail
45
     */
46
    public $flightDetail;
47
48
    /**
49
     * @var InclusionDetail[]
50
     */
51
    public $inclusionDetail = [];
52
53
    /**
54
     * @var ExclusionDetail[]
55
     */
56
    public $exclusionDetail = [];
57
58
    /**
59
     * @var UnitNumberDetail[]
60
     */
61
    public $unitNumberDetail = [];
62
63
    /**
64
     * FlightInfo constructor.
65
     *
66
     * @param array $airlineOptions
67
     * @param array $flightTypes
68
     * @param array $includedConnections
69
     * @param array $excludedConnections
70
     * @param int|null $connections
71
     * @param bool $noAirportChange
72
     */
73 20
    public function __construct(array $airlineOptions, array $flightTypes, array $includedConnections = [], array $excludedConnections = [], $connections = null, $noAirportChange = false)
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 187 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
74
    {
75 20
        foreach ($airlineOptions as $qualifier => $airlines) {
76 4
            $this->companyIdentity[] = new CompanyIdentity(
77 4
                $qualifier,
78 2
                $airlines
79 2
            );
80 10
        }
81
82 20
        if (!empty($flightTypes)) {
83 4
            $this->flightDetail = new FlightDetail($flightTypes);
84 2
        }
85
86 20
        foreach ($includedConnections as $includedConnection) {
87 4
            $this->inclusionDetail[] = new InclusionDetail($includedConnection);
88 10
        }
89 20
        foreach ($excludedConnections as $excludedConnection) {
90 4
            $this->exclusionDetail[] = new ExclusionDetail($excludedConnection);
91 10
        }
92
93 20
        if (!is_null($connections)) {
94 4
            $this->unitNumberDetail[] = new UnitNumberDetail($connections, UnitNumberDetail::TYPE_NUM_OF_CONNECTIONS_ALLOWED);
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 126 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
95 2
        }
96
97 20
        if ($noAirportChange === true) {
98 4
            $this->unitNumberDetail[] = new UnitNumberDetail(1, UnitNumberDetail::TYPE_NO_AIRPORT_CHANGE);
99 2
        }
100 20
    }
101
}
102