| Total Complexity | 10 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class SearchFacets implements \Iterator |
||
| 14 | { |
||
| 15 | /** @var array[] */ |
||
| 16 | private $selectedBuckets = []; |
||
| 17 | |||
| 18 | public function __get(string $facetId) |
||
| 19 | { |
||
| 20 | if (!array_key_exists($facetId, $this->selectedBuckets)) { |
||
| 21 | return []; |
||
| 22 | } |
||
| 23 | |||
| 24 | return $this->selectedBuckets[$facetId]; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function __set(string $facetId, $selectedBuckets) |
||
| 28 | { |
||
| 29 | $this->selectedBuckets[$facetId] = $selectedBuckets; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function __isset(string $facetId) |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @inheritdoc |
||
| 39 | */ |
||
| 40 | public function current() |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @inheritdoc |
||
| 47 | */ |
||
| 48 | public function next() |
||
| 49 | { |
||
| 50 | return next($this->selectedBuckets); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @inheritdoc |
||
| 55 | */ |
||
| 56 | public function key() |
||
| 57 | { |
||
| 58 | return key($this->selectedBuckets); |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @inheritdoc |
||
| 63 | */ |
||
| 64 | public function valid() |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @inheritdoc |
||
| 73 | */ |
||
| 74 | public function rewind() |
||
| 77 | } |
||
| 78 | } |
||
| 79 |