| Total Complexity | 10 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class SearchFacets implements \Iterator |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var array[] |
||
| 10 | */ |
||
| 11 | private $selectedBuckets = []; |
||
| 12 | |||
| 13 | public function __get(string $facetId) |
||
| 14 | { |
||
| 15 | if (!array_key_exists($facetId, $this->selectedBuckets)) { |
||
| 16 | return []; |
||
| 17 | } |
||
| 18 | return $this->selectedBuckets[$facetId]; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function __set(string $facetId, $selectedBuckets) |
||
| 22 | { |
||
| 23 | $this->selectedBuckets[$facetId] = $selectedBuckets; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function __isset(string $facetId) |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritDoc} |
||
| 33 | */ |
||
| 34 | public function current() |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritDoc} |
||
| 41 | */ |
||
| 42 | public function next() |
||
| 43 | { |
||
| 44 | return next($this->selectedBuckets); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritDoc} |
||
| 49 | */ |
||
| 50 | public function key() |
||
| 51 | { |
||
| 52 | return key($this->selectedBuckets); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritDoc} |
||
| 57 | */ |
||
| 58 | public function valid() |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * {@inheritDoc} |
||
| 66 | */ |
||
| 67 | public function rewind() |
||
| 70 | } |
||
| 71 | } |
||
| 72 |