Passed
Pull Request — main (#3378)
by Mario
50:21 queued 18:39
created

NumericRangeCount   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
c 0
b 0
f 0
dl 0
loc 36
ccs 3
cts 7
cp 0.4286
rs 10

3 Methods

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