Passed
Pull Request — master (#1317)
by
unknown
21:24
created

DateTime::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace ApacheSolrForTypo3\Solr\System\Data;
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
/**
19
 * Class DateTimeProxy
20
 */
21
class DateTime extends \DateTime
22
{
23
    /**
24
     * @param string $time
25
     * @param \DateTimeZone $timezone
26
     */
27 4
    public function __construct($time = 'now', \DateTimeZone $timezone = null)
28
    {
29 4
        parent::__construct($time, $timezone);
30 4
    }
31
32
    /**
33
     * Returns the date formatted as ISO.
34
     *
35
     * @return string
36
     */
37 2
    public function __toString()
38
    {
39 2
        return $this->format(\DateTime::ISO8601);
40
    }
41
}
42