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

PointOfCommencement::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 7

Duplication

Lines 13
Ratio 100 %

Importance

Changes 0
Metric Value
dl 13
loc 13
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
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
 * PointOfCommencement
12
 *
13
 * @package Amadeus\Client\Struct\Air\MultiAvailability
14
 * @author Dieter Devlieghere <[email protected]>
15
 */
16 View Code Duplication
class PointOfCommencement
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    /**
19
     * @var string
20
     */
21
    public $location;
22
23
    /**
24
     * @var string
25
     */
26
    public $date;
27
28
    /**
29
     * @var string
30
     */
31
    public $time;
32
33
    /**
34
     * PointOfCommencement constructor.
35
     *
36
     * @param string $point
37
     * @param \DateTime|null $date
38
     */
39
    public function __construct($point, $date)
40
    {
41
        $this->location = $point;
42
43
        if ($date instanceof \DateTime) {
44
            $this->date = $date->format('dmy');
45
46
            $time = $date->format('Hi');
47
            if ($time !== '0000') {
48
                $this->time = $time;
49
            }
50
        }
51
    }
52
}
53