| Total Complexity | 11 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 13 | final class ObservationCollection implements Iterator |
||
| 14 | { |
||
| 15 | private $storage; |
||
| 16 | |||
| 17 | public function __construct() |
||
| 18 | { |
||
| 19 | $this->storage = new SplObjectStorage(); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function addWarning(Warning $warning): void |
||
| 23 | { |
||
| 24 | $this->storage->attach($warning); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function addKudos(Kudos $kudos): void |
||
| 28 | { |
||
| 29 | $this->storage->attach($kudos); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function addInfo(Info $info): void |
||
| 33 | { |
||
| 34 | $this->storage->attach($info); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function addError(Error $error): void |
||
| 38 | { |
||
| 39 | $this->storage->attach($error); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function empty(): bool |
||
| 43 | { |
||
| 44 | return $this->storage->count() === 0; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function current() |
||
| 48 | { |
||
| 49 | return $this->storage->current(); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function next() |
||
| 53 | { |
||
| 54 | $this->storage->next(); |
||
| 55 | } |
||
| 56 | |||
| 57 | public function key() |
||
| 60 | } |
||
| 61 | |||
| 62 | public function valid() |
||
| 63 | { |
||
| 64 | return $this->storage->valid(); |
||
| 65 | } |
||
| 66 | |||
| 67 | public function rewind() |
||
| 70 | } |
||
| 71 | } |
||
| 72 |