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