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

DateRangeCount   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 37
ccs 4
cts 8
cp 0.5
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDocumentCount() 0 3 1
A __construct() 0 4 1
A getDate() 0 3 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