Passed
Pull Request — master (#1308)
by Timo
22:26
created

DateRangeCount   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 30.76%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 39
ccs 4
cts 13
cp 0.3076
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDate() 0 4 1
A getDocumentCount() 0 4 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 ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\AbstractFacetItem;
18
use DateTime;
19
20
/**
21
 * Value object that represent an date range count. The count has a date and the count of documents
22
 *
23
 * @author Frans Saris <[email protected]>
24
 * @author Timo Hund <[email protected]>
25
 * @package ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionsFacet
26
 */
27
class DateRangeCount
28
{
29
30
    /**
31
     * @var DateTime
32
     */
33
    protected $date;
34
35
    /**
36
     * @var int
37
     */
38
    protected $documentCount = 0;
39
40
    /**
41
     * @param $date
42
     * @param $documentCount
43
     */
44 1
    public function __construct($date, $documentCount)
45
    {
46 1
        $this->date = $date;
47 1
        $this->documentCount = $documentCount;
48 1
    }
49
50
    /**
51
     * @return \DateTime
52
     */
53
    public function getDate()
54
    {
55
        return $this->date;
56
    }
57
58
    /**
59
     * @return int
60
     */
61
    public function getDocumentCount()
62
    {
63
        return $this->documentCount;
64
    }
65
}
66