Total Complexity | 12 |
Total Lines | 87 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class AlertPublisher implements \Iterator, \ArrayAccess, \Countable |
||
6 | { |
||
7 | private $alerts; |
||
8 | |||
9 | public function __construct(AlertManagerInterface $alertManager) |
||
10 | { |
||
11 | $this->alerts = $alertManager->getAlerts(); |
||
12 | } |
||
13 | |||
14 | /** |
||
15 | * @inheritdoc |
||
16 | */ |
||
17 | public function current() |
||
18 | { |
||
19 | return current($this->alerts); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @inheritdoc |
||
24 | */ |
||
25 | public function next() |
||
26 | { |
||
27 | next($this->alerts); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @inheritdoc |
||
32 | */ |
||
33 | public function key() |
||
34 | { |
||
35 | return key($this->alerts); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @inheritdoc |
||
40 | */ |
||
41 | public function valid() |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @inheritdoc |
||
48 | */ |
||
49 | public function rewind() |
||
50 | { |
||
51 | return reset($this->alerts); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | public function offsetExists($offset) |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | public function offsetGet($offset) |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @inheritdoc |
||
72 | */ |
||
73 | public function offsetSet($offset, $value) |
||
74 | { |
||
75 | $this->$this->alerts[$offset] = $value; |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @inheritdoc |
||
80 | */ |
||
81 | public function offsetUnset($offset) |
||
82 | { |
||
83 | unset($this->alerts[$offset]); |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @inheritdoc |
||
88 | */ |
||
89 | public function count() |
||
92 | } |
||
93 | } |
||
94 |