| Total Complexity | 6 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 10 | class Facet |
||
| 11 | { |
||
| 12 | /** @var string */ |
||
| 13 | private $name; |
||
| 14 | |||
| 15 | /** @var array<\Suilven\FreeTextSearch\Container\FacetCount> */ |
||
| 16 | private $facetCounts = []; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Facet constructor. |
||
| 20 | */ |
||
| 21 | public function __construct(string $name) |
||
| 22 | { |
||
| 23 | $this->name = $name; |
||
| 24 | } |
||
| 25 | |||
| 26 | |||
| 27 | /** @param string|float|int|bool $key $key */ |
||
| 28 | public function addFacetCount($key, int $count): void |
||
| 29 | { |
||
| 30 | $fc = new FacetCount($key, $count); |
||
| 31 | $this->facetCounts[] = $fc; |
||
| 32 | } |
||
| 33 | |||
| 34 | |||
| 35 | public function getName(): string |
||
| 38 | } |
||
| 39 | |||
| 40 | |||
| 41 | /** @return array<\Suilven\FreeTextSearch\Container\FacetCount> */ |
||
| 42 | public function getFacetCounts(): array |
||
| 43 | { |
||
| 44 | return $this->facetCounts; |
||
| 45 | } |
||
| 46 | |||
| 47 | |||
| 48 | /** @return array<string|float|int|bool, int> */ |
||
| 49 | public function asKeyValueArray(): array |
||
| 58 | } |
||
| 59 | } |
||
| 60 |