Passed
Push — task/2976_TYPO3.11_compatibili... ( 803400...b598e4 )
by Rafael
33:58 queued 15:41
created

DateRangeCount::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\RangeBased\DateRange;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
*/
16
17
use DateTime;
18
19
/**
20
 * Value object that represent an date range count. The count has a date and the count of documents
21
 *
22
 * @author Frans Saris <[email protected]>
23
 * @author Timo Hund <[email protected]>
24
 */
25
class DateRangeCount
26
{
27
28
    /**
29
     * @var DateTime
30
     */
31
    protected $date;
32
33
    /**
34
     * @var int
35
     */
36
    protected $documentCount = 0;
37
38
    /**
39
     * @param $date
40
     * @param $documentCount
41
     */
42 1
    public function __construct($date, $documentCount)
43
    {
44 1
        $this->date = $date;
45 1
        $this->documentCount = $documentCount;
46 1
    }
47
48
    /**
49
     * @return \DateTime
50
     */
51
    public function getDate()
52
    {
53
        return $this->date;
54
    }
55
56
    /**
57
     * @return int
58
     */
59
    public function getDocumentCount()
60
    {
61
        return $this->documentCount;
62
    }
63
}
64