Passed
Push — bugfix/PSR-4_paths_missmatch ( d4b7f1 )
by Rafael
44:17
created

GroupItem::getMaximumScore()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.2963

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 1
cts 3
cp 0.3333
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1.2963
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Grouping;
19
20
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Result\SearchResultCollection;
21
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet;
22
use ApacheSolrForTypo3\Solr\Domain\Search\SearchRequest;
23
24
/**
25
 * Class GroupItem
26
 *
27
 * @author Frans Saris <[email protected]>
28
 * @author Timo Hund <[email protected]>
29
 */
30
class GroupItem extends SearchResultSet
31
{
32
    /**
33
     * @var string
34
     */
35
    protected string $groupValue = '';
36
37
    /**
38
     * @var int
39
     */
40
    protected int $allResultCount = 0;
41
42
    /**
43
     * @var int
44
     */
45
    protected int $start = 0;
46
47
    /**
48
     * @var float
49
     */
50
    protected float $maximumScore = 0.0;
51
52
    /**
53
     * @var SearchResultCollection
54
     */
55
    protected SearchResultCollection $searchResults;
56
57
    /**
58
     * @var Group
59
     */
60
    protected Group $group;
61
62
    /**
63
     * @param Group $group
64
     * @param string $groupValue
65
     * @param int $numFound
66
     * @param int $start
67
     * @param float $maxScore
68
     * @param SearchRequest $usedSearchRequest
69
     */
70
    public function __construct(
71
        Group $group,
72
        string $groupValue,
73
        int $numFound,
74
        int $start,
75
        float $maxScore,
76
        SearchRequest $usedSearchRequest
77
    ) {
78
        parent::__construct();
79
        $this->group = $group;
80
        $this->groupValue = $groupValue;
81
        $this->allResultCount = $numFound;
82
        $this->start = $start;
83
        $this->maximumScore = $maxScore;
84
        $this->searchResults = new SearchResultCollection();
85
        $this->usedSearchRequest = $usedSearchRequest;
86
    }
87
88
    /**
89
     * Get groupValue
90
     *
91
     * @return string
92
     */
93
    public function getGroupValue(): string
94
    {
95
        return $this->groupValue;
96
    }
97
98
    /**
99
     * Get start
100
     *
101
     * @return int
102
     */
103
    public function getStart(): int
104
    {
105
        return $this->start;
106
    }
107
108
    /**
109
     * @return Group
110
     */
111
    public function getGroup(): Group
112
    {
113
        return $this->group;
114
    }
115
}
116