SourceIterator   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 63
ccs 0
cts 28
cp 0
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getIterator() 0 4 1
A current() 0 4 1
A next() 0 4 1
A key() 0 4 1
A valid() 0 4 1
A rewind() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the 2amigos/yii2-exportable-widget project.
5
 * (c) 2amigOS! <http://2amigos.us/>
6
 * For the full copyright and license information, please view
7
 * the LICENSE file that was distributed with this source code.
8
 */
9
10
namespace dosamigos\exportable\iterators;
11
12
use dosamigos\exportable\contracts\SourceIteratorInterface;
13
use Iterator;
14
15
/**
16
 * SourceIterator implementation based on Iterator.
17
 */
18
class SourceIterator implements SourceIteratorInterface
19
{
20
    /**
21
     * @var Iterator
22
     */
23
    protected $iterator;
24
25
    /**
26
     * @param Iterator $iterator Iterator with string array elements
27
     */
28
    public function __construct(Iterator $iterator)
29
    {
30
        $this->iterator = $iterator;
31
    }
32
33
    /**
34
     * @return Iterator
35
     */
36
    public function getIterator()
37
    {
38
        return $this->iterator;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function current()
45
    {
46
        return $this->iterator->current();
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function next()
53
    {
54
        $this->iterator->next();
55
    }
56
57
    /**
58
     * {@inheritdoc}
59
     */
60
    public function key()
61
    {
62
        return $this->iterator->key();
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function valid()
69
    {
70
        return $this->iterator->valid();
71
    }
72
73
    /**
74
     * {@inheritdoc}
75
     */
76
    public function rewind()
77
    {
78
        $this->iterator->rewind();
79
    }
80
}
81