DocumentInformations::getEndDate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of PHPProject - A pure PHP library for reading and writing
4
 * presentations documents.
5
 *
6
 * PHPProject is free software distributed under the terms of the GNU Lesser
7
 * General Public License version 3 as published by the Free Software Foundation.
8
 *
9
 * For the full copyright and license information, please read the LICENSE
10
 * file that was distributed with this source code. For the full list of
11
 * contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
12
 *
13
 * @link        https://github.com/PHPOffice/PHPProject
14
 * @copyright   2009-2014 PHPProject contributors
15
 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL version 3
16
 */
17
18
namespace PhpOffice\PhpProject;
19
20
/**
21
 * PHPProject_DocumentInformations
22
 *
23
 * @category    PHPProject
24
 * @package        PHPProject
25
 * @copyright    Copyright (c) 2012 - 2012 PHPProject (https://github.com/PHPOffice/PHPProject)
26
 */
27
class DocumentInformations
28
{
29
    /**
30
     * Start Date
31
     * @var int
32
     */
33
    private $startDate;
34
35
    /**
36
     * End Date
37
     * @var int
38
     */
39
    private $endDate;
40
41
    /**
42
     * Create a new PHPProject_DocumentInformations
43
     */
44 26
    public function __construct()
45
    {
46 26
    }
47
48
    /**
49
     * Get Start Date
50
     * @return int
51
     */
52 2
    public function getStartDate()
53
    {
54 2
        return $this->startDate;
55
    }
56
57
    /**
58
     * Set Start Date
59
     * @param int $pValue
60
     * @return DocumentInformations
61
     */
62 2
    public function setStartDate($pValue = null)
63
    {
64 2
        if ($pValue === null) {
65 1
            $pValue = time();
66 2
        } elseif (is_string($pValue)) {
67 2
            if (is_numeric($pValue)) {
68 1
                $pValue = intval($pValue);
69 1
            } else {
70 2
                $pValue = strtotime($pValue);
71
            }
72 2
        }
73 2
        $this->startDate = $pValue;
74 2
        return $this;
75
    }
76
77
    /**
78
     * Get End Date
79
     * @return int
80
     */
81 2
    public function getEndDate()
82
    {
83 2
        return $this->endDate;
84
    }
85
86
    /**
87
     * Set End Date
88
     * @param int $pValue
89
     * @return DocumentInformations
90
     */
91 1
    public function setEndDate($pValue = null)
92
    {
93 1
        if ($pValue === null) {
94 1
            $pValue = time();
95 1
        } elseif (is_string($pValue)) {
96 1
            if (is_numeric($pValue)) {
97 1
                $pValue = intval($pValue);
98 1
            } else {
99 1
                $pValue = strtotime($pValue);
100
            }
101 1
        }
102 1
        $this->endDate = $pValue;
103 1
        return $this;
104
    }
105
}
106