Completed
Push — develop ( a8951f...6805ee )
by Dieter
05:48
created

ConnectionOption::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 3
nop 2
1
<?php
2
/**
3
 * Amadeus
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 */
7
8
namespace Amadeus\Client\Struct\Air\MultiAvailability;
9
10
/**
11
 * ConnectionOption
12
 *
13
 * @package Amadeus\Client\Struct\Air\MultiAvailability
14
 * @author Dieter Devlieghere <[email protected]>
15
 */
16
class ConnectionOption
17
{
18
    /**
19
     * @var Connection
20
     */
21
    public $firstConnection;
22
23
    /**
24
     * @var Connection[]
25
     */
26
    public $secondConnection = [];
27
28
    /**
29
     * ConnectionOption constructor.
30
     *
31
     * @param string[] $connections
32
     * @param int|string|null $indicator Connection::INDICATOR_*
33
     */
34
    public function __construct($connections, $indicator = null)
35
    {
36
        foreach ($connections as $counter=>$connection) {
37
            if ($counter === 0) {
38
                $this->firstConnection = new Connection($connection, $indicator);
39
            } else {
40
                $this->secondConnection[] = new Connection($connection, $indicator);
41
            }
42
        }
43
    }
44
}
45