Passed
Push — master ( 3cd8c6...9e747f )
by Timo
38:54 queued 16:17
created

AbstractRangeFacetItem   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 50
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRangeCounts() 0 4 1
A getGap() 0 4 1
getRangeString() 0 1 ?
A getUriValue() 0 4 1
A getCollectionKey() 0 4 1
1
<?php
2
namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\RangeBased;
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
19
/**
20
 * Abstract class that is used as base class for range facet items
21
 *
22
 * @author Frans Saris <[email protected]>
23
 * @author Timo Hund <[email protected]>
24
 * @package ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionsFacet
25
 */
26
abstract class AbstractRangeFacetItem extends AbstractFacetItem
27
{
28
29
    /**
30
     * @var array
31
     */
32
    protected $rangeCounts;
33
34
    /**
35
     * @var string
36
     */
37
    protected $gap;
38
39
    /**
40
     * @return string
41
     */
42
    public function getUriValue()
43
    {
44
        return $this->getRangeString();
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getCollectionKey()
51
    {
52
        return $this->getRangeString();
53
    }
54
55
    /**
56
     * @return array
57
     */
58 2
    public function getRangeCounts()
59
    {
60 2
        return $this->rangeCounts;
61
    }
62
63
    /**
64
     * @return string
65
     */
66 2
    public function getGap()
67
    {
68 2
        return $this->gap;
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    abstract protected function getRangeString();
75
}
76