1
|
|
|
<?php declare(strict_types = 1); |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Created by PhpStorm. |
5
|
|
|
* User: gordon |
6
|
|
|
* Date: 24/3/2561 |
7
|
|
|
* Time: 20:36 น. |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
namespace Suilven\FreeTextSearch\Container; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Class SearchResults |
14
|
|
|
* |
15
|
|
|
* Store the search results in a manner that is renderable in a SilverStripe template |
16
|
|
|
* |
17
|
|
|
* @package Suilven\FreeTextSearch\Container |
18
|
|
|
*/ |
19
|
|
|
class SearchResults |
20
|
|
|
{ |
21
|
|
|
|
22
|
|
|
/** @var array<string,int|bool|float|string> */ |
23
|
|
|
private $facets; |
24
|
|
|
|
25
|
|
|
/** @var string */ |
26
|
|
|
private $index; |
27
|
|
|
|
28
|
|
|
/** @var int */ |
29
|
|
|
private $page; |
30
|
|
|
|
31
|
|
|
/** @var int */ |
32
|
|
|
private $pageSize; |
33
|
|
|
|
34
|
|
|
/** @var string */ |
35
|
|
|
private $query; |
36
|
|
|
|
37
|
|
|
/** @var \SilverStripe\ORM\ArrayList */ |
38
|
|
|
private $records; |
39
|
|
|
|
40
|
|
|
/** @var float the time in seconds */ |
41
|
|
|
private $time; |
42
|
|
|
|
43
|
|
|
|
44
|
|
|
/** @param array<string,int|bool|float|string> $newFacets */ |
45
|
|
|
public function setFacets(array $newFacets): void |
46
|
|
|
{ |
47
|
|
|
$this->facets = $newFacets; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
|
51
|
|
|
public function setIndex(string $newIndex): void |
52
|
|
|
{ |
53
|
|
|
$this->index = $newIndex; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
|
57
|
|
|
public function getNumberOfResults(): int |
58
|
|
|
{ |
59
|
|
|
return \count($this->records); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
|
63
|
|
|
public function getPage(): int |
64
|
|
|
{ |
65
|
|
|
return $this->page; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
|
69
|
|
|
public function setPage(int $newPage): void |
70
|
|
|
{ |
71
|
|
|
$this->page = $newPage; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
|
75
|
|
|
public function getPageSize(): int |
76
|
|
|
{ |
77
|
|
|
return $this->pageSize; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
|
81
|
|
|
public function setPageSize(int $newPageSize): void |
82
|
|
|
{ |
83
|
|
|
$this->pageSize = $newPageSize; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
|
87
|
|
|
public function getQuery(): string |
88
|
|
|
{ |
89
|
|
|
return $this->query; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
|
93
|
|
|
public function setQuery(string $newQuery): void |
94
|
|
|
{ |
95
|
|
|
$this->query = $newQuery; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
|
99
|
|
|
public function setRecords(ArrayList $newRecords): void |
|
|
|
|
100
|
|
|
{ |
101
|
|
|
$this->records = $newRecords; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
|
105
|
|
|
public function getRecords(): \SilverStripe\ORM\ArrayList |
106
|
|
|
{ |
107
|
|
|
return $this->records; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
|
111
|
|
|
public function getTime(): float |
112
|
|
|
{ |
113
|
|
|
return $this->time; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
|
117
|
|
|
public function setTime(float $newTime): void |
118
|
|
|
{ |
119
|
|
|
$this->time = $newTime; |
120
|
|
|
} |
121
|
|
|
} |
122
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths