IteratorProxyMessageIterator::rewind()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\NotificationBundle\Iterator;
15
16
/**
17
 * @author Toni Uebernickel <[email protected]>
18
 */
19
class IteratorProxyMessageIterator implements MessageIteratorInterface
20
{
21
    /**
22
     * @var \Iterator
23
     */
24
    protected $iterator;
25
26
    public function __construct(\Iterator $iterator)
27
    {
28
        $this->iterator = $iterator;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function current()
35
    {
36
        return $this->iterator->current();
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function next(): void
43
    {
44
        $this->iterator->next();
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function key()
51
    {
52
        return $this->iterator->key();
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function valid()
59
    {
60
        return $this->iterator->valid();
61
    }
62
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function rewind(): void
67
    {
68
        $this->iterator->rewind();
69
    }
70
}
71