Completed
Push — develop ( b71e24...13e4b5 )
by Dieter
10:39
created

DateTime::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 8
loc 8
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
/**
3
 * Amadeus
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 */
7
8
namespace Amadeus\Client\Struct\SalesReports\DisplayQueryReport;
9
10
/**
11
 * DateTime
12
 *
13
 * @package Amadeus\Client\Struct\SalesReports\DisplayQueryReport
14
 * @author Dieter Devlieghere <[email protected]>
15
 */
16
class DateTime
17
{
18
    /**
19
     * @var string
20
     */
21
    public $year;
22
23
    /**
24
     * @var string
25
     */
26
    public $month;
27
28
    /**
29
     * @var string
30
     */
31
    public $day;
32
33
    /**
34
     * DateTime constructor.
35
     *
36
     * @param \DateTime|null $date
37
     */
38 View Code Duplication
    public function __construct($date)
0 ignored issues
show
Duplication introduced by
This method 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...
39
    {
40
        if ($date instanceof \DateTime) {
41
            $this->year = $date->format('Y');
42
            $this->month = $date->format('m');
43
            $this->day = $date->format('d');
44
        }
45
    }
46
}
47