Passed
Pull Request — master (#489)
by Artem
05:00
created

Period   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 30
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
1
<?php
2
3
/**
4
 * amadeus-ws-client
5
 *
6
 * Copyright 2015 Amadeus Benelux NV
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this file except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 * http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 *
20
 * @package Amadeus
21
 * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
22
 */
23
24
namespace Amadeus\Client\Struct\Pay;
25
26
use Amadeus\Client\RequestOptions\PayListVirtualCardsOptions;
27
28
/**
29
 * Period
30
 *
31
 * @package Amadeus\Client\Struct\Pay
32
 * @author Konstantin Bogomolov <[email protected]>
33
 */
34
class Period
35
{
36
    /**
37
     * @var string
38
     */
39
    public $Start;
40
41
    /**
42
     * @var string
43
     */
44
    public $End;
45
46
    /**
47
     * @var string
48
     */
49
    public $EventType = 'Creation';
50
51
    /**
52
     * Period constructor.
53
     *
54
     * @param PayListVirtualCardsOptions $params
55
     */
56
    public function __construct(PayListVirtualCardsOptions $params)
57
    {
58
        if ($params->Period->start !== null) {
59
            $this->Start = $params->Period->start->format('Y-m-d');
60
        }
61
62
        if ($params->Period->end !== null) {
63
            $this->End = $params->Period->end->format('Y-m-d');
64
        }
65
    }
66
}
67