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

AirlineOrFlightOption::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 3
nop 3
1
<?php
2
/**
3
 * Amadeus
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 */
7
8
namespace Amadeus\Client\Struct\Air\MultiAvailability;
9
10
/**
11
 * AirlineOrFlightOption
12
 *
13
 * @package Amadeus\Client\Struct\Air\MultiAvailability
14
 * @author Dieter Devlieghere <[email protected]>
15
 */
16
class AirlineOrFlightOption
17
{
18
    const INDICATOR_EXCLUDE = 701;
19
    const INDICATOR_OPERATIONAL_CARRIER = 705;
20
21
    /**
22
     * @var FlightIdentification[]
23
     */
24
    public $flightIdentification = [];
25
26
    /**
27
     * self::INDICATOR_*
28
     *
29
     * @var int
30
     */
31
    public $excludeAirlineIndicator;
32
33
    /**
34
     * AirlineOrFlightOption constructor.
35
     * @param string[] $airlines
36
     * @param string $flightNumber
0 ignored issues
show
Documentation introduced by
Should the type for parameter $flightNumber 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...
37
     * @param int|null $indicator
38
     */
39
    public function __construct($airlines, $flightNumber = null, $indicator = null)
40
    {
41
        foreach ($airlines as $count=>$airline) {
42
            if ($count === 0) {
43
                $this->flightIdentification[] = new FlightIdentification($airline, $flightNumber);
44
            } else {
45
                $this->flightIdentification[] = new FlightIdentification($airline);
46
            }
47
        }
48
49
        $this->excludeAirlineIndicator = $indicator;
50
    }
51
}
52